Trigger event

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
(Instructions)
m
 
(56 intermediate revisions by one user not shown)
Line 1: Line 1:
= Event basics =
+
{{TOCRIGHT}}
 +
Trigger event (verb '''''to trigger''''') is most useful event. It allows interaction between game objects.
  
Call event is most useful event. It allows interaction between many game aspects.
+
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.
  
It happens when trigger get touched, on monster dies, each object can have it's own behavior and launch call event under it's own circumstances.
+
In Blood Omnicide, trigger event can have custom instructions which is used to control the way entities react to the event.  
  
But structure of event is same all the time.
+
===Event input===
  
'''Call 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.
  
* self - entity call is being processed on
+
===Event rules===
* activator - who lets event go (usually player or monster)
+
* parameters - instructions for call event, fetched from "targetparm" field of self.
+
 
+
'''Call parameters 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 call instructions not begin with "SELECT ", "SELECT TARGETS;" is automatically added
+
* 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==
  
 +
'''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
  
= Instructions =
+
'''INFOPORTION ''OPERATOR'''''
 +
:Manipulate [[Infoportions | 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)
  
{| width=100% cellspacing=0 cellpadding=4 border=1 style="border-collapse: collapse"
+
'''CALL'''
! width=2% | Order
+
:This triggers all selected entities with their default action.
! width=25% | Syntax
+
:Can prefix this instruction with <classname:>. In this case trigger event will only be processed on entities with matching class name.
! width=73% | Description
+
:Examples:
|-
+
::select targets;effect_light:call
| 1
+
::select byid 145;call
| SELECT/ADD
+
| Starts (select) and expands (add) selection of [[Entity | entities]], which will be called.
+
  
* SELECT TARGETS - select entity to which i'm targeted
+
'''''CUSTOM ACTION'''''
* SELECT TARGETERS - select entities which are targeted to me
+
:One of object's supported custom trigger actions. Classname filter is supported.
* SELECT BYID ''<id1> <id2> <id3> ... <idX>'' - select entities by their save id's
+
:Examples:
* SELECT BYTARGETNAME ''<targetname1> <targetname2> ... <targetnameX>'' - select entities by their save id's
+
::select targets;effect_light:on
|-
+
::select byid 145;trigger_puzzle:toggle 2 1 3
| 2
+
| INFOPORTION <OPERATOR>
+
| Manipulate [[Infoportion | infoportions]] on activator.
+
  
* INFOPORTION SET ''infoportion'' - adds/update infoportion
+
'''BREAK or NOCALL'''
* INFOPORTION DEL ''infoportion'' - delete infoportion
+
:Immediately exit trigger event.
* INFOPORTION INC ''infoportion'' ''[increase_by]'' - increase infoportion value by 1 or by custom value (of presented)
+
* INFOPORTION DEC ''infoportion'' ''[decrease_by]'' - increase infoportion value by 1 or by custom value (of presented)
+
|-
+
| 3
+
| CALL
+
| This calls all selected entities with their default action.
+
  
Can prefix this instruction with <classname:>. In this case call event will only be processed on entities with matching class name.
+
==Event keys==
  
Examples:
+
Trigger event have general keys that is used for it.
  
select targets;effect_light:call
+
Sometimes this keys are used by other kind of events too. This special behavior (if presented) is defined in particular class reference.
  
select byid 145;call
+
{{entity fields}}
 
|-
 
|-
| 4
+
| Target
| <CUSTOM ACTION>
+
| target
| This is actually much like call, but action is one of object's supported custom call parameters.
+
| All entities with matching targetname will be triggered.
 
|-
 
|-
| 4
+
| Target parameters
| BREAK or NOCALL
+
| targetparm
| Immediately exit call event.
+
| When entity is triggered, this is instructions for trigger event (see instructions above);
|}
+
|-
 +
| Targetname
 +
| targetname
 +
| Entities with matching target will trigger this entity.
 +
{{entity fields end}}
 +
 
 +
== 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