Difference between revisions of "Trigger Libraries"

From HIVE
Jump to navigation Jump to search
 
m (1 revision: StarEdit.net Wiki)
 
(No difference)

Latest revision as of 06:16, 21 November 2010

Libraries are collections of trigger functions. Normally they are complete sets of trigger functions (actions, conditions, functions) belonging to a topic.

How to import Trigger Libraries

Right click in the trigger module's library field and select "library" and then the import option.

How to use a Trigger Library

The library's content will show up in their correct selection windows. So a function returning an integer will be in the list when the editor wants you to pick an integer-returning function, conditions will be in the conditions list, etc. The library's name will be shown next to it.

How to create a Library

In the trigger editor, go to View and check Show libraries. Now, a frame on the top left of the trigger editor appears. In there you can see the libraries the map currently uses. Now, to create a new library, right-click > library > New library. A new folder should appear; give it a name. Now, copy (or cut) and paste the triggers you want the library to have in it, finally, right-click the folder again and export it by going to library > export library.

How to use/call actions, conditions and functions

Lets say, you have a trigger and you want it to call a condition: Simply create a new condition and search for the name of the condition, or find it in the category "General" while browsing through the list of available conditions. The same works for actions and functions. Triggers must be executed by using the action "Run Trigger".

Known issues of Trigger Libraries

For now (version 1.1.3), the "grammar syntax" in a library will disappear when you import it into a map. For example, instead of a function which was grammatically structured like this: Bring(Player X brings at least Y Units to Region) would look like this: Bring(x, at least, y, region).

Operators (presets) as parameters apparently can only be == or !=. Although, while calling the function/action/condition/trigger via another trigger, you can enter "<", ">" and the like, it will return an error when trying to save. A workaround for this is to create a new set of parameters and using (inside of the triggers) if-statements to check what the user has selected.

See Also