Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 4, 2008, 10:49:52 PM (15 years ago)
Author:
mkaiser
Message:

Some changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • data/contentcreation/pps/MirkoKaiser/CuboidSS/Version2/levels/CuboidSpaceStation2.2.lua

    r5306 r5307  
    1 --<?lua
    2 
    3 
    4 function createSpaceStation()
    51-- This lua script creates a totally random generated space station for the orxonox computer game!
    62
    73
    84
     5-- This function creates a randomly generated space station.
     6-- The first three arguments (xPos,yPos,zPos) are the position of the space station.
     7-- The next tree arguments (xVel,yVel,zVel) are the velocity of the space station.
     8-- The arguments (xRotAxis,yRotAxis,zRotAxis) are the rotation axis, with respect to which the space ship will rotate. Each argument can be 0 or 1.
     9-- The argument RotRate defines how fast the space station will rotate.
     10-- The arguments (xRotOnce,yRotOnce,zRotOnce) define in which direction the space station will face, if they are all zero, the station will face into the negative
     11--      z-direction, and the positive y-direction is the top side of the station.
     12function createSpaceStation(xPos,yPos,zPos, xVel,yVel,zVel, xRotAxis,yRotAxis,zRotAxis, RotRate, xRotOnce,yRotOnce,zRotOnce)
     13
     14
     15
    916----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    1017-- This prints xml code, which creates a MovableEntity, which I need to attach all the parts of the space station.
    11 
    12 -- If you want to move, rotate or displace the whole space station, this is the line you have to change.
    13 print("<MovableEntity scale=1 position=\"0,0,") print(-500) ("\" velocity=\"0,0,0\" rotationaxis=\"0,0,1\" rotationrate=0 yaw=180 >")
     18print("<MovableEntity scale=1 position=\"") print(xPos) print(",") print(yPos) print(",") print(zPos)
     19print("\" velocity=\"") print(xVel) print(",") print(yVel) print(",") print(zVel)
     20print("\" rotationaxis=\"") print(xRotAxis) print(",") print(yRotAxis) print(",") print(zRotAxis) print("\" rotationrate=") print(RotRate)
     21print(" pitch=") print(xRotOnce) print(" yaw=") print(yRotOnce) print(" roll=") print(zRotOnce) print(" >")
    1422-- End create Movable Entity.
    1523----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     
    249257bodyParts[leftSidePartsIndex[1]][0][0][0][5]="roll=90 pitch="..math.random(0,180)
    250258bodyParts[rightSidePartsIndex[1]][0][0][0][6]="roll=-90 pitch="..math.random(0,180)
    251 
     259bodyParts[rightSidePartsIndex[1]][0][0][0][8]="rotationaxis=\"1,0,0\" rotationrate=5"
    252260bodyParts[leftSidePartsIndex[1]][0][0][0][0]=1
    253261bodyParts[leftSidePartsIndex[1]][0][0][1][0]=1
     
    545553                if check == 1 then
    546554                        -- This prints the part.
    547                         printModel(x,y,z,tempSidePartIndex,false,1)
     555                        printModel(x,y,z,tempSidePartIndex,true,1)
    548556                        partSet=1
    549557                        -- This actualizes the grid array with the values of the array bodyParts at the position tempSidePartIndex.
     
    599607                if check == 1 then
    600608                        -- This prints the part.
    601                         printModel(x,y,z,tempSidePartIndex,false,2)
     609                        printModel(x,y,z,tempSidePartIndex,true,2)
    602610                        partSet=1
    603611                        -- This actualizes the grid array with the values of the array bodyParts at the position tempSidePartIndex.
     
    737745----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    738746
    739 end
    740 
    741 --?>
     747
     748
     749-- End the createSpaceStation function.
     750end
     751
     752
     753
Note: See TracChangeset for help on using the changeset viewer.