CTP2 Bureau The Modding Knowledgebase |
|
Apolyton CTP2 forums Apolyton CTP2 archives Source Code Project SVN |
Search the site: |
SLIC TriggersTriggers in old-style CTP1-format may still be used in CTP2 (including the AE) on UI components. Examples from AOM show that (1.) this works and (2.) it may be useful in order to display additional (game-/player-/civ-) information in the form of messages.by BureauBertSLIC Triggers on UI ComponentsFrom Joe Rumsey's SLIC 1.2 introduction: There is also a special format for triggering by UI components: Trigger 'name' on "UI Component Name" when (expression) { It behaves in the same way as the normal format, except that it is only evaluated when the UI component is used. The name follows the same rules as for message boxes. The body of the trigger is executed only when the expression is true (not equal to 0). A SLIC expression is a C-style mathematical expression. These are all valid expressions:
The variables used in the expression for a trigger determine when the trigger might be run. For example, if the built-in variable unit.built is used, the trigger condition will be checked whenever a unit is built. However, any given trigger is never placed in more than one list of triggers to be checked. So while a trigger whose only built-in variable in the conditional is g.player will be checked whenever a player's turn begins, one that uses both g.player and unit.built will only be checked when a unit is built. The author has tried to make the order of which variables takes precedence as logical as possible. Some variables make no sense when used in the same expression (E.G. city.built and unit.sighted can't be fired at the same time). In other cases, the list the trigger is added to should be the one that will fire more often. Examples from AOMtrigger 'TSPDiplomacy' on "ControlPanelWindow.ControlPanel.ShortcutPad.FrenzyButton" when (1) |
This site is currently maintained by: BureauBert (Webmaster) Maquiladora (Manager) Legal Notice: Legal Notice Statistics: 123562 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne |