Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5310 for data/media/levels


Ignore:
Timestamp:
Dec 5, 2008, 10:08:56 PM (16 years ago)
Author:
mkaiser
Message:

Some changes.

Location:
data/media/levels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • data/media/levels/CuboidSpaceStation2.3.lua

    r5309 r5310  
    66-- The first argument ranSeed, must be false, or a positive Integer, if it is false your space station is always chosen randomly, if you give an integer,
    77--      your space station will be generated randomly, but once you have the space station it will be the same.
    8 function createSpaceStation(ranSeed)
     8-- The argument xLen defines how large the space station will be into the x-direction.
     9-- The argument xVar defines how much the space station will vary at the ends in x-direction, this is so that the station is no cube.
     10-- The argument yLen is the same as xLen, but for the y-direction.
     11-- The argument yVar is the same as xLen, but for the y-direction.
     12-- The argument zLen is the same as xLen, but for the z-direction.
     13-- The argument zVar is the same as xLen, but for the z-direction.
     14-- The argument givenScale scales the station proportionally in all directions.
     15function createSpaceStationPar(ranSeed, xLen, xVar, yLen, yVar, zLen, zVar, givenScale)
    916
    1017
     
    1219----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    1320-- This prints xml code, which creates a MovableEntity, which I need to attach all the parts of the space station.
    14 print("<MovableEntity scale=1 position=\"0,0,0\" velocity=\"0,0,0\" rotationaxis=\"0,0,0\" rotationrate=0 >")
     21print("<MovableEntity scale=1 position=\"0,0,0\" >")
    1522-- End create Movable Entity.
    1623----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     
    3542-- Define the maximal size of the space station, this is actually just for the grid, be sure that this value is big enough.
    3643sSSize=30
     44
     45--if xLen>=yLen and xLen>=zLen then
     46--      sSSize=xLen+20
     47--elseif yLen>=xLen and yLen>=zLen then
     48--      sSSize=yLen+20
     49--elseif zLen>=xLen and zLen>=yLen then
     50--      sSSize=zLen+20
     51--end
     52
    3753-- Define how many parts the space station has, this value has to be exact, so be sure to increment it if you're adding a new part.
    3854sSParts=9
     
    5066pDim=6
    5167-- Define the length in x-direction of the space station which will be occupied by bodyparts.
    52 xBPLength=4
     68xBPLength=xLen
    5369-- Define the variation of the edges of your bodyparts in the x-direction.
    54 xBPVar=1
     70xBPVar=xVar
    5571-- Define the length in y-direction of the space station which will be occupied by bodyparts.
    56 yBPLength=2
     72yBPLength=yLen
    5773-- Define the variation of the edges of your bodyparts in the y-direction.
    58 yBPVar=1
     74yBPVar=yVar
    5975-- Define the length in the z-direction of the space station which will be occupied by bodyparts.
    60 zBPLength=6
     76zBPLength=zLen
    6177-- Define the variation of the edges of your bodyparts in the z-direction.
    62 zBPVar=1
     78zBPVar=zVar
    6379-- Define the scale of the space station.
    64 sSScale=100
     80sSScale=givenScale
    6581-- Define the griddimension, be sure this value matches the size of a single space station part plus the size of a connection part, which means your parts must be:
    6682--      integer*(gridDim-connectionSize), then integer tells you how many griddimensions your part is.
     
    748764
    749765
    750 
     766-- This function is for the lazy guys, which do not care how the space station looks like, so I use some good standard values.
     767function createSpaceStation()
     768        createSpaceStationPar(false,4,1,2,1,6,1,100)
     769end
     770
  • data/media/levels/CuboidSpaceStation2.oxw

    r5309 r5310  
    2323?>
    2424
    25 
     25<!-- The following examples insert some space station in various ways, so I guess you will understand how to use my .lua file and the functions of it.
     26--->
    2627
    2728<!-- Here I add a space station at position 0,0,0 without velocity and no rotation.
     
    2930--->
    3031<?lua
    31         createSpaceStation(false)
     32        createSpaceStation()
    3233?>
    3334
    3435
    3536
    36 <!-- Here I add a space station at position 0,0,-1000 without velocity and no rotation.
     37<!-- Here I add a space station at position 0,0,-5000 without velocity and no rotation.
    3738--->
    3839<PositionableEntity scale=1 position="0,0,-5000">
    3940        <attached>
    4041                <?lua
    41                         createSpaceStation(false)
     42                        createSpaceStation()
    4243                ?>
    43                 </attached>
    44         </PositionableEntity>
     44        </attached>
     45</PositionableEntity>
     46
     47
     48
     49<!-- Here I add a space station at position 5000,0,0 with velocity 50,0,0 and a rotation so that the space station faces into the positive x-axis.
     50--->
     51<MovableEntity scale=1 position="5000,0,0" velocity="50,0,0" yaw=-90>
     52        <attached>
     53                <?lua
     54                        createSpaceStation()
     55                ?>
     56        </attached>
     57</MovableEntity>
     58
     59
     60
     61<!-- Here I add a space station at position -5000,0,0 without velocity but rotation around his own y-axis.
     62--->
     63<MovableEntity scale=1 position="-5000,0,0" rotationaxis="0,1,0" rotationrate=5>
     64        <attached>
     65                <?lua
     66                        createSpaceStation()
     67                ?>
     68        </attached>
     69</MovableEntity>
     70
     71
     72
     73<!-- Here I add a space station at position 10000,0,0 which will rotate around the position 0,0,0 and around his own axis in flight direction.
     74---- To do so, I create a MovableEntity at position 0,0,0 and attach another MovableEntity with relative coordinates to the first MovableEntity 10000,0,0.
     75---- I rotate the first MovableEntity, so the second Entity rotates around 0,0,0 in the x-,z-area with a radius 10000, and so does the space station,
     76---- because the space station is attached to the second MovableEntity with relative coordinates 0,0,0 (this is defined in the .lua file).
     77---- Then I rotate also the second MovableEntity around his own z-axis, so the space station rotates also around its own axis.
     78--->
     79<MovableEntity scale=1 position="0,0,0" rotationaxis="0,1,0" rotationrate=3>
     80        <attached>
     81                <MovableEntity scale=1 position="10000,0,0" rotationaxis="0,0,1" rotationrate=2>
     82                        <attached>
     83                                <?lua
     84                                        createSpaceStationPar(false,2,1,2,1,2,1,50)
     85                                ?>
     86                        </attached>
     87                </MovableEntity>
     88        </attached>
     89</MovableEntity>
    4590
    4691
Note: See TracChangeset for help on using the changeset viewer.