y Triggers
Overview
The idea of search triggers is it enables you to find any newly created units in the game and perform actions based on what it currently is. For example you might want an SPCMeteor to cast whenever a building is destroyed or to create a unit at every bolt strike. Unlike most triggers this will find all units created - even unsearchable ones which change in area would not normally work on!
Changes from previous version
This new version resolves a lot of the issues and complaints from the previous version:
Getting started
Below is a simple example which makes a lighting storm summon anubites:
Insert a trigger with run immediately, looped, and active checked and put on highest priority. Insert the following effects:
Run the scenario and cast a lighting storm and enjoy your new army!
Play around with the effects and you will quickly learn lots of neat tricks you can do!
Variables
To make it easier to work with players the system supports variables. An example of something you want to do might be to deploy units the same player as the owner of the unit. To do this use the trigger effect:
This will ask you to input a variable name such as p. In a later trigger effect where you input a player, you can put the variable name you entered instead. E.g. you can grant a player a god power based on the player of the unit. Note that if you are using yArmy Deploy for comps online the player is actually making a string and needs entering in the form "+VariableName+" instead.
Delegating search handling
One of the annoyances with the original ySearch was you had to perform all handling all inside a single trigger. This got difficult to work with very quickly with a lot of effects to handle. I have now added to support delegate the handling to other triggers. To use the effect:
Enter a unique name for a delegate handler. I normally put the trigger name doing the handling. Note that spaces in the name is not permitted.
Next to make a trigger perform the handling, insert a trigger and make it inactive. For the first effect insert the effect:
Enter the same unique name you entered earlier to handle.
Database searching
This allows found units to be stored and then freely searched separately to the y triggers. This can be used to allow re-searching previously found units. To add units to a database use the effect:
This will store the unit for searching later (There is a non y version allowing existing units to be added also). You can then search the units freely with a similar structure to search triggers using instead the following structure:
Units that no longer exist (Dead and corpse gone) are automatically pruned out the database for efficiency. You can also remove units found during a search so they will not be found in future searches with the effect:
This removes the currently found unit from the database. The database name should match what is currently being found.
Troubleshooting
If you encounter a trigger locks check the following things:
Download
[This message has been edited by nottud (edited 12-29-2019 @ 04:53 PM).]