Jump to content

maps triggers


soloooy0
 Share

Recommended Posts

Estoy editando un mapa, para hacer un disparo, numancia, necesito saber ciertas cosas sobre la creación de mapas ...
¿Cómo podría hacer que el ataque gaia cada x veces, las posiciones iniciales del mapa no sean automáticas en el editor superior?
El manual de Atlas está muy desactualizado y no da respuestas a nada de lo que necesito.
¿Cómo pongo unidades en estructuras gaia?
Actualmente el mapa no funciona pero es una
creación bastante hermosa de @ Lankusnav
Gracias por la ayuda

screenshot0002.png

Currently it has too many failures to finish putting things on the map, so it is clean of some parts .....

Edited by soloooy0
  • Like 2
Link to comment
Share on other sites

Quote

I'm editing a map, to make a shot, Numancia, I need to know certain things about creating maps ...
How could I make the gaia attack every x times, the initial positions of the map are not automatic in the top editor?
The Atlas manual is very outdated and doesn't give answers to anything I need.
How do I put units in gaia structures?
Currently the map doesn't work but it's a
rather beautiful creation of 'Lankusnav
Thank you for your help.

 

Link to comment
Share on other sites

Open your map .xml with a text editor of choice, I recommend Notepad++.

Add the following line:

Spoiler

{
  "CircularMap": true,
  "Description": "text",
  "Keywords": ["trigger"],
  "Name": "YourMap",
  "PlayerData": [
    {},
    {},
    {}
  ],
  "Preview": "icon.png",
  "TriggerScripts": [
    "scripts/TriggerHelper.js",
    "skirmishes/YourTrigger.js"
  ],

  "VictoryConditions": [
    "conquest"
  ]
}

 

Create your trigger script.js based on this code:

Spoiler

Trigger.prototype.SpawnAndAttack = function()
{
    var intruders = TriggerHelper.SpawnUnitsFromTriggerPoints(
            pickRandom(["C", "B"]), "units/athen_infantry_marine_archer_e", this.attackSize, 0);   //  use whatever unit you want here

           // c and b  trigger objects are defined as spawn point for gaia unit

    for (var origin in intruders)
    {
        var playerID = TriggerHelper.GetOwner(+origin);
        var cmd = null;
        for (var target of this.GetTriggerPoints("A"))   // gaia will walk to  trigger object a
        {
            if (TriggerHelper.GetOwner(target) != playerID)
                continue;
            var cmpPosition = Engine.QueryInterface(target, IID_Position);
            if (!cmpPosition || !cmpPosition.IsInWorld)
                continue;
            // store the x and z coordinates in the command
            cmd = cmpPosition.GetPosition();
            break;
        }
        if (!cmd)
            continue;
        cmd.type = "attack-walk";
        cmd.entities = intruders[origin];
        cmd.targetClasses = { "attack": ["Unit", "Structure"] };   //  checks for enemy units and structures to attack
        cmd.allowCapture = false;  //if true gaia will try to capture your buildings
        cmd.queued = true;
        ProcessCommand(0, cmd);
    }

    // enlarge the attack time and size
    var rand = randFloat(1, 3);
    this.attackTime *= rand;
    this.attackSize = Math.round(this.attackSize * rand);
    this.DoAfterDelay(this.attackTime, "SpawnAndAttack", {});
};

{
    let cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger);
    cmpTrigger.attackSize = 1;    // attack with 1 soldier
    cmpTrigger.attackTime = 60 * 1000;   // attack every 1 minute
    cmpTrigger.DoAfterDelay(cmpTrigger.attackTime, "SpawnAndAttack", {});
}

 

 

Lastly add trigger objects to your map by using Atlas:

Spoiler

285658831_triggerpoints.thumb.png.703c6d247c696662417698b9e560227e.png

 

Quote

How do I put units in gaia structures?

It is not possible to place units in buildings using Atlas.

Edited by Panther
-
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

42 minutes ago, soloooy0 said:

big problem atlas doesn't let me play any gameInkederror_LI.thumb.jpg.5b9ddd033079c79c3fd47e4e627583cd.jpg

I have to reinstall 0ad or how error reports are sent
this happens to me with all the maps, both because they are by default as mine (custom)

What mods do you use?

Link to comment
Share on other sites

  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...