Trigger event

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
m
 
(22 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
{{TOCRIGHT}}
 
Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.
 
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. Not only buttons can trigger things, for example enemy could trigger 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. Not only buttons can trigger things, for example enemy could trigger a door when dies.
  
For Blood Omnicide, trigger event was extended to allow custom instructions.  
+
In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event.  
  
=== Event input ===
+
===Event input===
  
 
* self - entity trigger event is being processed on
 
* self - entity trigger event is being processed on
Line 11: Line 12:
 
* parameters - instructions for trigger event, fetched from "targetparm" field of self.
 
* parameters - instructions for trigger event, fetched from "targetparm" field of self.
  
=== Event rules ===
+
===Event rules===
  
 
* Instructions are case insensative
 
* Instructions are case insensative
 +
* Instruction keywords are separated by space and TAB (except for braces)
 
* ';' is the separator between instructions
 
* ';' is the separator between instructions
 
* If trigger instructions not begin with "SELECT ", scripts automatically executes "SELECT TARGETS" at beginning.
 
* 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"
  
 +
==Instructions==
  
== Instructions ==
+
'''SELECT/ADD'''
 +
:Starts (select) or expands (add) selection of [[Entity | entities]].
 +
:* SELECT TARGETS - select entity to which i'm targeted
 +
:* SELECT TARGETERS - select entities which are targeted to me
 +
:* SELECT BYID ''<id1> <id2> <id3> ... <idX>'' - select entities by their save id's
 +
:* SELECT BYTARGETNAME ''<targetname1> <targetname2> ... <targetnameX>'' - select entities by their targetnames
  
{| width=85% cellspacing=0 cellpadding=4 border=1 style="border-collapse: collapse"
+
'''INFOPORTION ''OPERATOR'''''
! width=2% bgcolor=#EEDFDF | Order
+
:Manipulate [[Infoportions | infoportions]] on activator:
! width=10% bgcolor=#EEDFDF | Syntax
+
:* '''INFO SET''' ''infoportion'' - add/update infoportion
! width=88% bgcolor=#EEDFDF | Description
+
:* '''INFO DEL''' ''infoportion'' - delete infoportion
|-
+
:* '''INFO INC''' ''infoportion'' ''increase_by'' - increase infoportion value by 1 or by custom value (of presented)
| align=center | 1
+
:* '''INFO DEC''' ''infoportion'' ''decrease_by'' - increase infoportion value by 1 or by custom value (of presented)
| SELECT/ADD
+
| Starts (select) or expands (add) selection of [[Entity | entities]].
+
  
* SELECT TARGETS - select entity to which i'm targeted
+
'''CALL'''
* SELECT TARGETERS - select entities which are targeted to me
+
:This triggers all selected entities with their default action.
* SELECT BYID ''<id1> <id2> <id3> ... <idX>'' - select entities by their save id's
+
:Can prefix this instruction with <classname:>. In this case trigger event will only be processed on entities with matching class name.
* SELECT BYTARGETNAME ''<targetname1> <targetname2> ... <targetnameX>'' - select entities by their targetnames
+
:Examples:
|-
+
::select targets;effect_light:call
| align=center | 2
+
::select byid 145;call
| INFOPORTION <OPERATOR>
+
| Manipulate [[Infoportion | infoportions]] on activator.
+
  
* INFOPORTION SET ''infoportion'' - add/update infoportion
+
'''''CUSTOM ACTION'''''
* INFOPORTION DEL ''infoportion'' - delete infoportion
+
:One of object's supported custom trigger actions. Classname filter is supported.
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
+
:Examples:
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
+
::select targets;effect_light:on
|-
+
::select byid 145;trigger_puzzle:toggle 2 1 3
| align=center | 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.
+
'''BREAK or NOCALL'''
 +
:Immediately exit trigger event.
  
Examples:
+
==Event keys==
 
+
select targets;effect_light:call
+
 
+
select byid 145;call
+
|-
+
| align=center | 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
+
|-
+
| align=center | 5
+
| BREAK or NOCALL
+
| Immediately exit trigger event.
+
|}
+
 
+
== Event keys ==
+
  
 
Trigger event have general keys that is used for it.
 
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.
+
Sometimes this keys are used by other kind of events too. This special behavior (if presented) is defined in particular class reference.
  
 
{{entity fields}}
 
{{entity fields}}
Line 92: Line 73:
 
{{entity fields end}}
 
{{entity fields end}}
  
__NOTOC__
+
== See also ==
 +
* [[Pattern script]]
 +
 
 +
{{finished}}

Latest revision as of 04:19, 23 November 2012

Contents

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. Not only buttons can trigger things, for example enemy could trigger a door when dies.

In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event.

[edit] 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.

[edit] Event rules

  • Instructions are case insensative
  • Instruction keywords are separated by space and TAB (except for braces)
  • ';' 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"

[edit] Instructions

SELECT/ADD

Starts (select) or expands (add) selection of entities.
  • SELECT TARGETS - select entity to which i'm targeted
  • SELECT TARGETERS - select entities which are targeted to me
  • SELECT BYID <id1> <id2> <id3> ... <idX> - select entities by their save id's
  • SELECT BYTARGETNAME <targetname1> <targetname2> ... <targetnameX> - select entities by their targetnames

INFOPORTION OPERATOR

Manipulate infoportions on activator:
  • INFO SET infoportion - add/update infoportion
  • INFO DEL infoportion - delete infoportion
  • INFO INC infoportion increase_by - increase infoportion value by 1 or by custom value (of presented)
  • INFO DEC infoportion decrease_by - increase infoportion value by 1 or by custom value (of presented)

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

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

BREAK or NOCALL

Immediately exit trigger event.

[edit] 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 (if presented) 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.

[edit] See also

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox