Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 62 and Version 63 of content/LevelHowTo


Ignore:
Timestamp:
Sep 9, 2015, 12:30:07 PM (9 years ago)
Author:
fvultier
Comment:

Added an example that uses templates. Section about WaypointPatrolController added.

Legend:

Unmodified
Added
Removed
Modified
  • content/LevelHowTo

    v62 v63  
    1717    <Template link=lodtemplate_default /> <!-- Opening and closing tag 2 at once -->
    1818</templates>                              <!-- Closing tag 1 -->
     19
     20<!-- This is a comment. -->
    1921}}}
    2022                                                       
     
    133135||spaceshipghost||"templates/spaceshipGhost.oxt"||stealth aircraft ||
    134136||spaceshipHXY||"templates/spaceshipHXY.oxt"||||
    135 ||spaceshipHXYSL||"templates/spaceshipHXYSL.oxt"|fast||
     137||spaceshipHXYSL||"templates/spaceshipHXYSL.oxt"||fast||
    136138||spaceshipTransporterSL||"templates/spaceshipTransporterSL.oxt"||slow transporter||
    137139||spaceshipTransporter||"templates/spaceshipTransporter.oxt"||slow transporter, equal to SL version||
     
    174176Take a look at the "waypoints.oxw" level to learn more about the WaypointController.
    175177
     178== WaypointPatrolController ==
     179
     180An advanced version of the WaypointController is the WaypointPatrolController. Spaceships controlled by a simple WaypointController will never shoot at you, however if you replace the WaypointController by a WaypointPatrolController they do if you get close enough to them. Try it by setting the "alertnessradius" and "attackradius" attributes properly.
     181
     182== Templates ==
     183
     184Let's expand the above example a little:
     185{{{
     186#!xml
     187<SpaceShip position="300,0,0" lookat="0,0,0" team=3>
     188    <templates>
     189        <Template link=spaceshipescort />
     190    </templates>
     191    <controller>
     192        <WaypointController accuracy=10 team=3>
     193            <waypoints>
     194                <StaticEntity position="300,0,0" />
     195                <StaticEntity position="300,500,0" />
     196                <StaticEntity position="0,500,0" />
     197                <StaticEntity position="0,0,0" />
     198            </waypoints>
     199        </WaypointController>
     200    </controller>
     201</SpaceShip>
     202
     203<SpaceShip position="300,500,0" lookat="0,0,0" team=3>
     204    <templates>
     205        <Template link=spaceshipassff2 />
     206    </templates>
     207    <controller>
     208        <WaypointController accuracy=10 team=3>
     209            <waypoints>
     210                <StaticEntity position="300,0,0" />
     211                <StaticEntity position="300,500,0" />
     212                <StaticEntity position="0,500,0" />
     213                <StaticEntity position="0,0,0" />
     214            </waypoints>
     215        </WaypointController>
     216    </controller>
     217</SpaceShip>
     218
     219<SpaceShip position="0,500,0" lookat="0,0,0" team=3>
     220    <templates>
     221        <Template link=spaceshippirate />
     222    </templates>
     223    <controller>
     224        <WaypointController accuracy=10 team=3>
     225            <waypoints>
     226                <StaticEntity position="300,0,0" />
     227                <StaticEntity position="300,500,0" />
     228                <StaticEntity position="0,500,0" />
     229                <StaticEntity position="0,0,0" />
     230            </waypoints>
     231        </WaypointController>
     232    </controller>
     233</SpaceShip>
     234}}}
     235There are now three different spaceships all following the same route. If you want to modify a single waypoint for all spaceships you have to change it at three different place in the XML code. A better approach is the use of templates:
     236{{{
     237#!xml
     238<Template name=waypointstemplate>
     239    <WaypointController>
     240        <waypoints>
     241            <StaticEntity position="300,0,0" />
     242            <StaticEntity position="300,500,0" />
     243            <StaticEntity position="0,500,0" />
     244            <StaticEntity position="0,0,0" />
     245        </waypoints>
     246    </WaypointController>
     247</Template>
     248
     249<SpaceShip position="300,0,0" lookat="0,0,0" team=3>
     250    <templates>
     251        <Template link=spaceshipescort />
     252    </templates>
     253    <controller>
     254        <WaypointController accuracy=10 team=3>
     255            <templates>
     256                <Template link=waypointstemplate />
     257            </templates>
     258        </WaypointController>
     259    </controller>
     260</SpaceShip>
     261
     262<SpaceShip position="300,500,0" lookat="0,0,0" team=3>
     263    <templates>
     264        <Template link=spaceshipassff2 />
     265    </templates>
     266    <controller>
     267        <WaypointController accuracy=10 team=3>
     268            <templates>
     269                <Template link=waypointstemplate />
     270            </templates>
     271        </WaypointController>
     272    </controller>
     273</SpaceShip>
     274
     275<SpaceShip position="0,500,0" lookat="0,0,0" team=3>
     276    <templates>
     277        <Template link=spaceshippirate />
     278    </templates>
     279    <controller>
     280        <WaypointController accuracy=10 team=3>
     281            <templates>
     282                <Template link=waypointstemplate />
     283            </templates>
     284        </WaypointController>
     285    </controller>
     286</SpaceShip>
     287}}}
     288
    176289== [http://www.orxonox.net/doxygen/classorxonox_1_1_pickup_spawner.html Pickups]  ==
     290
    177291Pickups give a player a temporary bonus when collecting it. Bonuses are invisibility, health, boost,  shield, a drone, ...
    178292 1. Include the pickupsRepresentationTemplates. This include should be somewhere between the LevelInfo and the opening Level tag.
     
    254368
    255369== ParticleEmitter ==
    256 Particle emitters are WorldEntities that run a particle effect. Define their position using the "position" attribute. The "source" attribute defines which particle effect is executed. All Orxonox particel effects are stored in the data/particle folder.
     370Particle emitters are WorldEntities that run a particle effect. Define their position using the "position" attribute. The "source" attribute defines which particle effect is executed. All Orxonox particle effects are stored in the data/particle folder.
    257371{{{
    258372#!xml
     
    608722Example: ../data/levels/quests.oxw
    609723
    610 
    611 == Templates ==
    612 
    613 
    614724== Best Practices ==
    615725 * Make objects that belong to each other be close to each other. Ideally the trigger is placed right before the object listening to the trigger's event. Use comments to mark groups that belong together.