Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 1 and Version 2 of code/Scripting


Ignore:
Timestamp:
Apr 6, 2008, 1:39:11 PM (17 years ago)
Author:
bknecht
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/Scripting

    v1 v2  
    1111
    1212If your using the special lua tags ''<?lua'' and ''?>'' you can create levels easier. You could use loops to generate more objects and you can let a level depend on earlier accomplishments of the player. If you use random parameters you can even create a level which looks slightly different every time a player plays it. Here some examples how you could use Lua in our level files.
     13
     14=== Asteroid field ===
     15As I write this wiki page we have a level with 226 asteroids in it. For each asteroid we need one line of XML code:
     16{{{
     17...
     18<Model position="-9613,-4258,4537" scale="103" mesh="ast1.mesh" rotationAxis="0.820812,0.60695,0" rotationRate="13" />
     19<Model position="-6169,19264,-4878" scale="69" mesh="ast3.mesh" rotationAxis="0,0.585115,0.235653" rotationRate="32" />
     20<Model position="8717,-16685,9115" scale="37" mesh="ast4.mesh" rotationAxis="0.0512168,0.899599,0" rotationRate="15" />
     21...
     22}}}
     23
     24With the scripting engine we could generate those asteroids a lot easier:
     25{{{
     26... (has to be tested first)
     27}}}