Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 34 and Version 35 of content/LevelHowTo


Ignore:
Timestamp:
Feb 23, 2012, 6:03:16 PM (13 years ago)
Author:
jo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • content/LevelHowTo

    v34 v35  
    240240    <StaticEntity position="<?lua print(y) ?>,0,<?lua print(z) ?>" scale="<?lua print(math.random() * 10 + 5) ?>" collisionType="static" >
    241241<?lua end ?>
    242 
    243 
    244242}}}
    245243
    246244
    247245== Triggers && Events ==
    248 Example: ../data/levels/events.oxw
    249 
     246Example: ../data/levels/events.oxw
     247
     248So 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.
     249A 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}}}
     262DistanceTriggers 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.
    250263
    251264== Quests ==