Trigger event
Line 2: | Line 2: | ||
Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. You could also move a floor when player touches some area. Not only buttons can trigger things, for example enemy could open a door when dies. | Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. You could also move a floor when player touches some area. Not only buttons can trigger things, for example enemy could open a door when dies. | ||
+ | |||
+ | For Blood Omnicide, trigger event was extended to allow custom instructions. | ||
=== Event input === | === Event input === | ||
Line 13: | Line 15: | ||
* Instructions are case insensative | * Instructions are case insensative | ||
* ';' is the separator between instructions | * ';' is the separator between instructions | ||
− | * If trigger instructions not begin with "SELECT " | + | * If trigger instructions not begin with "SELECT ", scripts automatically executes "SELECT TARGETS" at beginning. |
* Empty instructions defaults to "SELECT TARGETS;CALL" | * Empty instructions defaults to "SELECT TARGETS;CALL" | ||
Line 26: | Line 28: | ||
| align=center | 1 | | align=center | 1 | ||
| SELECT/ADD | | SELECT/ADD | ||
− | | Starts (select) | + | | Starts (select) or expands (add) selection of [[Entity | entities]]. |
* SELECT TARGETS - select entity to which i'm targeted | * SELECT TARGETS - select entity to which i'm targeted |
Revision as of 08:04, 17 July 2012
Trigger event (verb to trigger) is most useful event. It allows interaction between game objects.
Many entities can trigger other entities, or be triggered. For example you could open and close a door with a button, so here the button triggers the door. You could also move a floor when player touches some area. Not only buttons can trigger things, for example enemy could open a door when dies.
For Blood Omnicide, trigger event was extended to allow custom instructions.
Event input
- self - entity trigger event is being processed on
- activator - who lets event go (usually player)
- parameters - instructions for trigger event, fetched from "targetparm" field of self.
Event rules
- Instructions are case insensative
- ';' is the separator between instructions
- If trigger instructions not begin with "SELECT ", scripts automatically executes "SELECT TARGETS" at beginning.
- Empty instructions defaults to "SELECT TARGETS;CALL"
Instructions
Order | Syntax | Description |
---|---|---|
1 | SELECT/ADD | Starts (select) or expands (add) selection of entities.
|
2 | INFOPORTION <OPERATOR> | Manipulate infoportions on activator.
|
3 | CALL | This triggers all selected entities with their default action.
Can prefix this instruction with <classname:>. In this case trigger event will only be processed on entities with matching class name. Examples: select targets;effect_light:call select byid 145;call |
4 | <CUSTOM ACTION> | One of object's supported custom trigger actions. Classname filter is supported.
Examples: select targets;effect_light:on select byid 145;trigger_puzzle:toggle 2 1 3 |
5 | BREAK or NOCALL | Immediately exit trigger event. |
6 | ? | Each entity class can have special call parameters. Like doors have directives to open and close, enemies can change their path or spawn in special origin. |
Event keys
Trigger event have general keys that is used for it.
Sometimes this keys are used by other kind of events too. This special behavior is defined in particular class reference.
Key | Description | Default value |
---|---|---|
Target | target | All entities with matching targetname will be triggered. |
Target parameters | targetparm | When entity is triggered, this is instructions for trigger event (see instructions above); |
Targetname | targetname | Entities with matching target will trigger this entity. |