| 328 | A triggers can be combined in several ways: |
| 329 | * A trigger can have a trigger. The outer trigger can only be triggered, after the inner trigger was triggered: |
| 330 | {{{ |
| 331 | #!xml |
| 332 | <DistanceTrigger name="navigationend" position="0,0,0" distance=950 target="SpaceShip" stayActive="false" delay=1.1> |
| 333 | <DistanceTrigger name="flying4" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=1/> |
| 334 | </DistanceTrigger> |
| 335 | }}} |
| 336 | |
| 337 | In "missionOne.oxw" the order the player destroys the boxes should not influence the order the messages arrive, what the player should do next after having destroyed such a box. |
| 338 | The solution to this problem is naming each box as "box". When the fist box is destroyed, the innermost EventTrigger listens to the event "box" and creates the "boxtrigger1" event in return. Similarly, when the next box is destroyed later, the innermost EventTrigger is not triggered again, as it stays active. That way, the next EventTrigger is triggered that way. |
| 339 | {{{ |
| 340 | #!xml |
| 341 | <EventTrigger name="boxtrigger4" activations="1" stayactive="true" delay=0.1> |
| 342 | <events> |
| 343 | <trigger> |
| 344 | <EventListener event="box" /> |
| 345 | </trigger> |
| 346 | </events> |
| 347 | <EventTrigger name="boxtrigger3" activations="1" stayactive="true" delay=0.1> |
| 348 | <events> |
| 349 | <trigger> |
| 350 | <EventListener event="box" /> |
| 351 | </trigger> |
| 352 | </events> |
| 353 | <EventTrigger name="boxtrigger2" activations="1" stayactive="true" delay=0.1> |
| 354 | <events> |
| 355 | <trigger> |
| 356 | <EventListener event="box" /> |
| 357 | </trigger> |
| 358 | </events> |
| 359 | <EventTrigger name="boxtrigger1" activations="1" stayactive="true" delay=0.1> |
| 360 | <events> |
| 361 | <trigger> |
| 362 | <EventListener event="box" /> |
| 363 | </trigger> |
| 364 | </events> |
| 365 | </EventTrigger> |
| 366 | </EventTrigger> |
| 367 | </EventTrigger> |
| 368 | </EventTrigger> |
| 369 | }}} |
| 370 | |
| 371 | |