Changeset 5307 for data/contentcreation/pps/MirkoKaiser/CuboidSS/Version2/levels/CuboidSpaceStation2.2.lua
- Timestamp:
- Dec 4, 2008, 10:49:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/contentcreation/pps/MirkoKaiser/CuboidSS/Version2/levels/CuboidSpaceStation2.2.lua
r5306 r5307 1 --<?lua2 3 4 function createSpaceStation()5 1 -- This lua script creates a totally random generated space station for the orxonox computer game! 6 2 7 3 8 4 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. 12 function createSpaceStation(xPos,yPos,zPos, xVel,yVel,zVel, xRotAxis,yRotAxis,zRotAxis, RotRate, xRotOnce,yRotOnce,zRotOnce) 13 14 15 9 16 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 10 17 -- 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 >") 18 print("<MovableEntity scale=1 position=\"") print(xPos) print(",") print(yPos) print(",") print(zPos) 19 print("\" velocity=\"") print(xVel) print(",") print(yVel) print(",") print(zVel) 20 print("\" rotationaxis=\"") print(xRotAxis) print(",") print(yRotAxis) print(",") print(zRotAxis) print("\" rotationrate=") print(RotRate) 21 print(" pitch=") print(xRotOnce) print(" yaw=") print(yRotOnce) print(" roll=") print(zRotOnce) print(" >") 14 22 -- End create Movable Entity. 15 23 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- … … 249 257 bodyParts[leftSidePartsIndex[1]][0][0][0][5]="roll=90 pitch="..math.random(0,180) 250 258 bodyParts[rightSidePartsIndex[1]][0][0][0][6]="roll=-90 pitch="..math.random(0,180) 251 259 bodyParts[rightSidePartsIndex[1]][0][0][0][8]="rotationaxis=\"1,0,0\" rotationrate=5" 252 260 bodyParts[leftSidePartsIndex[1]][0][0][0][0]=1 253 261 bodyParts[leftSidePartsIndex[1]][0][0][1][0]=1 … … 545 553 if check == 1 then 546 554 -- This prints the part. 547 printModel(x,y,z,tempSidePartIndex, false,1)555 printModel(x,y,z,tempSidePartIndex,true,1) 548 556 partSet=1 549 557 -- This actualizes the grid array with the values of the array bodyParts at the position tempSidePartIndex. … … 599 607 if check == 1 then 600 608 -- This prints the part. 601 printModel(x,y,z,tempSidePartIndex, false,2)609 printModel(x,y,z,tempSidePartIndex,true,2) 602 610 partSet=1 603 611 -- This actualizes the grid array with the values of the array bodyParts at the position tempSidePartIndex. … … 737 745 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 738 746 739 end 740 741 --?> 747 748 749 -- End the createSpaceStation function. 750 end 751 752 753
Note: See TracChangeset
for help on using the changeset viewer.