Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 70 and Version 71 of content/LevelHowTo


Ignore:
Timestamp:
Nov 3, 2015, 11:46:16 PM (8 years ago)
Author:
fvultier
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • content/LevelHowTo

    v70 v71  
    357357</SpaceShip>
    358358}}}
     359
     360== Pawn ==
     361If an object in your level should have health and be killable you need the Pawn class. Pawns can have a weapon system, can have a shield and if you shoot at them they'll die if their health is reduced to zero.
     362{{{
     363#!xml
     364<Pawn team=1 health=30 shieldhealth=130 initialshieldhealth=130 maxshieldhealth=150 shieldabsorption=0.95 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box>
     365    <attached>
     366        <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     367    </attached>
     368    <collisionShapes>
     369        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     370    </collisionShapes>
     371</Pawn>
     372}}}
     373Pawn interits from ControllableEntity.
    359374
    360375== [http://www.orxonox.net/doxygen/classorxonox_1_1_pickup_spawner.html Pickups]  ==
     
    635650{{{
    636651#!xml
    637 <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,0.05"/>
    638 <DistanceTrigger name="flying1" position="0,0,0" target="Pawn" distance=10 stayActive="true" delay=2/>
    639 
    640 <SimpleNotification message="Let's fly to the blinking light." broadcast="true">
     652<Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,0"/>
     653<SimpleNotification message="Red Backlight." broadcast="true">
     654  <events>
     655    <trigger>
     656      <DistanceTrigger position="0,0,0" target="ControllableEntity" distance=25 stayActive="true"/>
     657    </trigger>
     658  </events>
     659</SimpleNotification>
     660}}}
     661'''DistanceTriggers''' are activated, 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 event can only be created once.
     662In the next example the DistanceTrigger ist no more placed inside the SimpleNotification. Instead it ist placed outside and a EventListerner is placed inside.
     663{{{
     664#!xml
     665<Backlight position="0,200,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="0,0,1"/>
     666<DistanceTrigger name="flying1" position="0,200,0" target="Pawn" distance=10 stayActive="true" delay=2/>
     667<SimpleNotification message="Blue Backlight." broadcast="true">
    641668    <events>
    642669       <trigger>
     
    646673</SimpleNotification>
    647674}}}
    648 '''DistanceTriggers''' are activated, 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 event can only be created once. The name '''flying1''' 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 2 seconds.
     675The name '''flying1''' 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 2 seconds.
     676The EventListener provides an 1:n mapping between one listener and multiple event-sources. In the next example any of the two event listeners will show the simple notification:
     677{{{
     678#!xml
     679<Backlight position="0,400,100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="0,1,0"/>
     680<Backlight position="0,400,-100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="0,1,0"/>
     681<DistanceTrigger name="flying2" position="0,400,-100" distance=25 target="ControllableEntity" />
     682<DistanceTrigger name="flying2" position="0,400,100" distance=25 target="ControllableEntity" />
     683<SimpleNotification message="Green Backlight." broadcast="true">
     684  <events>
     685    <trigger>
     686      <EventListener event="flying2" />
     687    </trigger>
     688  </events>
     689</SimpleNotification>
     690}}}
    649691The problem of distance triggers is that you have to rely on that the player is actually activating it as intended. Try to attract the player by using bliking billboards, pickups to reward the player, ... and make the radius large enough such that the player can hardly miss it.
    650692Another problem might be that the distance trigger is triggered by another Pawn/Spaceship/... (whatever is specified as target). To exclude certain objects to activate the trigger or to only allow a specific object to activate the trigger, the '''DistanceTriggerBeacon''' was created: