248 | | Example: ../data/levels/events.oxw |
249 | | |
| 246 | Example: ../data/levels/events.oxw |
| 247 | |
| 248 | So far your level design is static. Everything is placed in the level, when it is loaded (except the spawned objects) and doesn't change its behaviour once loaded. Via the trigger/event system you can make the level react on what the player does. |
| 249 | A trigger is like a button. When you activate it, something happens. |
| 250 | {{{ |
| 251 | #!xml |
| 252 | <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=6/> |
| 253 | |
| 254 | <SimpleNotification message="Let's fly to the blinking light."> |
| 255 | <events> |
| 256 | <trigger> |
| 257 | <EventListener event="flying1" /> |
| 258 | </trigger> |
| 259 | </events> |
| 260 | </SimpleNotification> |
| 261 | }}} |
| 262 | DistanceTriggers are artivated, when the target (e.g. a pawn, a spaceship, ...) is close enough to the distance trigger (defined via "distance"). The stayActive attribute keeps the switch activated once triggered. The name attribute is needed in order to catch the event, when the trigger was activated. The SimpleNotification is sent to the player when the trigger is activated. Note that the trigger is activated with a delay of 6 seconds. |