Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 205

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 208

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 389

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 530

Deprecated: Function split() is deprecated in /var/www/siebn.de/wiki/inc/auth.php on line 154
bs2_codinghelp_interactiontrigger [Burning Sand Wiki]
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/siebn.de/wiki/inc/template.php on line 242
 

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/parser.php on line 66

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/lexer.php on line 292

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 22

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 49

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 213

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 241

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 295

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 328

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 575

Deprecated: Function split() is deprecated in /var/www/siebn.de/wiki/inc/parser/metadata.php on line 289

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/xhtml.php on line 939

Help Main Menu

Interactions Trigger

Interactions Trigger are Interactions that provoke a Trigger.
Any trigger maybe called by an InteractionTrigger.
Syntax:

InteractionTrigger ElementName1 ElementName2 TriggerName Rate [Exception]

This work basically the same as a normal interaction, except that the reacting element are not transformed into another, instead they execute a trigger at the given rate. This trigger can be any BS2 command or function.

First thing to know is that when you use a function as the trigger, if the function has parameters to give, then you must put your trigger in <> with the parameters. You must also call it with EXEC before it.

InteractionTrigger TNT Fire <EXEC InteractionFill1 ELEMENT:TNT(Exploding)> 50000

This example is from the default BS2 elements, you can see that the function InteractionFill1 need a parameter and it has the EXEC before it and all this between <>.

Another thing to know with InteractionTrigger is that the first reacting elements you provide, ElementName1 and ElementName2 become INTERACTION1 and INTERACTION2.
Each element X,Y will be available as X1,Y1 for first element and X2,Y2 for the second element.

With this you can recreate basic interaction, so let's just see some basic interaction and its equivalent written in a trigger.

Example1 (Salt & Water)

Interaction Salt Water Clear Saltwater 10000
Same as:
InteractionTrigger Salt Water SaltWaterTrigger 10000
REMOVETRIGGER SaltWaterTrigger
ON SaltWaterTrigger DRAW ELEMENT:Clear POINT X1 Y1
ON SaltWaterTrigger DRAW ELEMENT:Saltwater POINT X2 Y2

The first Trigger line draw a pixel of Clear at X1,Y1. (X1,Y1 correspond to the coordinate of the pixel of Salt).
The second Trigger line draw a pixel of Saltwater at X2,Y2. (X2,Y2 correspond to the coordinate of the pixel of Water).
This will result in the pixel of Salt replaced by a pixel of Clear, and the pixel of Water replaced by a pixel of Saltwater.

 

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/siebn.de/wiki/inc/template.php on line 785
bs2_codinghelp_interactiontrigger.txt · Last modified: 2008/08/08 14:19 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki