Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 52 and Version 53 of content/LevelHowTo


Ignore:
Timestamp:
Dec 28, 2013, 8:40:42 PM (11 years ago)
Author:
jo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • content/LevelHowTo

    v52 v53  
    305305{{{
    306306#!xml
    307     <!-- When this Pawn is destroyed -->
    308     <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType="dynamic" mass="100000" name="kaboom" radarname = "Box 1">
    309         <attached>
    310             <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
    311         </attached>
    312         <collisionShapes>
    313            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
    314         </collisionShapes>
    315     </Pawn>
    316 
    317   <!-- an event called "kaboom" is created -->
    318   <SimpleNotification message="Right click on the next target." broadcast="true">
    319         <events>
    320             <trigger>
    321                 <EventListener event="kaboom" />
    322             </trigger>
    323         </events>
    324     </SimpleNotification>
     307<!-- When this Pawn is destroyed -->
     308<Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType="dynamic" mass="100000" name="kaboom" radarname = "Box 1">
     309    <attached>
     310        <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
     311    </attached>
     312    <collisionShapes>
     313        <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
     314    </collisionShapes>
     315</Pawn>
     316
     317<!-- an event called "kaboom" is created -->
     318<SimpleNotification message="Right click on the next target." broadcast="true">
     319    <events>
     320        <trigger>
     321            <EventListener event="kaboom" />
     322        </trigger>
     323    </events>
     324</SimpleNotification>
    325325}}}
    326326
     
    330330{{{
    331331#!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>
     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>
    335335}}}
    336336
     
    339339{{{
    340340#!xml
    341     <EventTrigger name="boxtrigger4" activations="1" stayactive="true" delay=0.1>
     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>
    342354      <events>
    343355        <trigger>
     
    345357        </trigger>
    346358      </events>
    347       <EventTrigger name="boxtrigger3" activations="1" stayactive="true" delay=0.1>
     359      <EventTrigger name="boxtrigger1" activations="1" stayactive="true" delay=0.1>
    348360        <events>
    349361          <trigger>
     
    351363          </trigger>
    352364        </events>
    353         <EventTrigger name="boxtrigger2" activations="1" stayactive="true" delay=0.1>
     365      </EventTrigger>
     366    </EventTrigger>
     367  </EventTrigger>
     368</EventTrigger>
     369}}}
     370
     371 * A trigger can have several triggers that are combined with boolean logic:
     372{{{
     373#!xml
     374<Trigger name="duball2" mode="and" stayactive="true">
     375    <EventTrigger activations="1" stayactive="true" delay=4 >
     376       <events>
     377          <trigger>
     378             <EventListener event="duball1" />
     379          </trigger>
     380       </events>
     381    </EventTrigger>
     382    <EventTrigger activations="1" invert="true">
     383      <events>
     384        <trigger>
     385          <EventListener event="toHydroFarmer" />
     386        </trigger>
     387      </events>
     388    </EventTrigger>
     389</Trigger>
     390}}}
     391In this case the "duball2" event triggers a message but only, if the event "toHydroFarmer" was not triggered before. This is achieved by inverting (not-operation) the "toHydroFarmer" event and combining the two corresponding EventTriggers with "and".
     392
     393=== What events can do ===
     394 * Making objects (in)visible:
     395{{{
     396#!xml
     397<DistanceTrigger name="switchBillboards" position="-900,640,600" target="Pawn" distance=70 stayActive="true" delay=1/>
     398
     399<!-- switchBillboards makes this billboard INVISIBLE -->
     400<BlinkingBillboard position="-900,640,600" frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,0.05">
     401   <events>
     402      <visibility>
     403        <EventTrigger invert=true>
     404          <events>
     405           <trigger>
     406             <EventListener event=switchBillboards />
     407           </trigger>
     408         </events>
     409        </EventTrigger>
     410      </visibility>
     411   </events>
     412</BlinkingBillboard>
     413
     414<!-- switchBillboards makes this billboard VISIBLE -->
     415<Billboard position="-900,640,600" amplitude=1 material="Flares/lensflare" colour="0,0.8,0.1">
     416  <events>
     417    <visibility>
     418        <EventTrigger>
    354419          <events>
    355420            <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  * A trigger can have several triggers that are combined with boolean logic:
    372 {{{
    373 #!xml
    374     <Trigger name="duball2" mode="and" stayactive="true">
    375         <EventTrigger activations="1" stayactive="true" delay=4 >
    376            <events>
    377               <trigger>
    378                  <EventListener event="duball1" />
    379               </trigger>
    380            </events>
    381         </EventTrigger>
    382         <EventTrigger activations="1" invert="true">
    383           <events>
    384             <trigger>
    385               <EventListener event="toHydroFarmer" />
     421              <EventListener event=switchBillboards />
    386422            </trigger>
    387423          </events>
    388424        </EventTrigger>
    389     </Trigger>
    390 }}}
    391 In this case the "duball2" event triggers a message but only, if the event "toHydroFarmer" was not triggered before. This is achieved by inverting (not-operation) the "toHydroFarmer" event and combining the two corresponding EventTriggers with "and".
    392 
    393 === What events can do ===
    394  * Making objects (in)visible:
    395 {{{
    396 #!xml
    397 <DistanceTrigger name="switchBillboards" position="-900,640,600" target="Pawn" distance=70 stayActive="true" delay=1/>
    398 
    399 <!-- switchBillboards makes this billboard INVISIBLE -->
    400 <BlinkingBillboard position="-900,640,600" frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,0.05">
    401           <events>
    402             <visibility>
    403               <EventTrigger invert=true>
    404                 <events>
    405                   <trigger>
    406                     <EventListener event=switchBillboards />
    407                   </trigger>
    408                 </events>
    409               </EventTrigger>
    410             </visibility>
    411           </events>
    412 </BlinkingBillboard>
    413 
    414 <!-- switchBillboards makes this billboard VISIBLE -->
    415 <Billboard position="-900,640,600" amplitude=1 material="Flares/lensflare" colour="0,0.8,0.1">
    416           <events>
    417             <visibility>
    418               <EventTrigger>
    419                 <events>
    420                   <trigger>
    421                     <EventListener event=switchBillboards />
    422                   </trigger>
    423                 </events>
    424               </EventTrigger>
    425             </visibility>
    426           </events>
     425    </visibility>
     426  </events>
    427427</Billboard>
    428428}}}
     
    430430{{{
    431431#!xml
    432     <TeamSpawnPoint team=0 position="2000,1500,-1500" direction="-1,-1,1" spawnclass=SpaceShip pawndesign=spaceshipspacecruiser>
    433         <events>
    434             <activity>
    435                 <EventListener event="attack" />
    436             </activity>
    437         </events>
    438     </TeamSpawnPoint>
    439 }}}
    440 
    441 {{{
    442 #!xml
    443     <SpaceShip position="3000,-4000,4000" lookat="-1300,-600,900" name="attacker"visible="true">
    444         <events>
    445             <visibility>
    446                 <EventListener event="ondock" />
    447             </visibility>
    448         </events>
    449         <templates>
    450             <Template link=spaceshippirate /> <!--spaceshipTransporter -->
    451         </templates>
    452         <controller>
    453             <WaypointPatrolController alertnessradius=3129 team=1 active=false>
    454                 <waypoints>
    455                     <Model mesh="cube.mesh" scale=0 position="-1300,-600,900" />
    456                     <Model mesh="cube.mesh" scale=0 position="0,0,0" />
    457                 </waypoints>
    458                 <events>
    459                     <activity>
    460                         <EventListener event="attack" /> <!-- activates enemies-->
    461                      </activity>
    462                 </events>
    463             </WaypointPatrolController>
    464         </controller>
    465     </SpaceShip>
     432<TeamSpawnPoint team=0 position="2000,1500,-1500" direction="-1,-1,1" spawnclass=SpaceShip pawndesign=spaceshipspacecruiser>
     433    <events>
     434        <activity>
     435            <EventListener event="attack" />
     436        </activity>
     437    </events>
     438</TeamSpawnPoint>
     439}}}
     440
     441{{{
     442#!xml
     443<SpaceShip position="3000,-4000,4000" lookat="-1300,-600,900" name="attacker"visible="true">
     444    <events>
     445        <visibility>
     446            <EventListener event="ondock" />
     447        </visibility>
     448    </events>
     449    <templates>
     450        <Template link=spaceshippirate /> <!--spaceshipTransporter -->
     451    </templates>
     452    <controller>
     453        <WaypointPatrolController alertnessradius=3129 team=1 active=false>
     454            <waypoints>
     455                <Model mesh="cube.mesh" scale=0 position="-1300,-600,900" />
     456                <Model mesh="cube.mesh" scale=0 position="0,0,0" />
     457            </waypoints>
     458            <events>
     459                <activity>
     460                    <EventListener event="attack" /> <!-- activates enemies-->
     461                 </activity>
     462            </events>
     463        </WaypointPatrolController>
     464    </controller>
     465</SpaceShip>
    466466}}}
    467467 * Executing '''ConsoleCommands''' (= executing code):
     
    469469#!xml
    470470<!-- End the Mission (success) -->
    471    <Script code="Mission endMission true" onLoad="false">
    472         <events>
    473             <trigger>
    474                 <EventListener event=endOfLevel />
    475             </trigger>
    476         </events>
    477     </Script>
     471<Script code="Mission endMission true" onLoad="false">
     472    <events>
     473        <trigger>
     474            <EventListener event=endOfLevel />
     475        </trigger>
     476    </events>
     477</Script>
    478478}}}
    479479The ConsoleCommand "'''Mission endMission true'''" gets executed, which will end the mission and make the player accomplish the mission.