| 205 | | <!-- First, the script has to be included. --> |
| 206 | | #!xml <?lua |
| 207 | | dofile("includes/CuboidSpaceStation.lua") |
| 208 | | ?> |
| 209 | | |
| 210 | | <!-- Usage: Creates a modular space station --> |
| 211 | | <StaticEntity scale=1 position="4650,5350,-11050" name=base visible=true active=true yaw=60> |
| 212 | | <attached> |
| 213 | | <?lua |
| 214 | | createSpaceStationPar(9851,2,1,2,1,2,1,100) |
| 215 | | ?> |
| 216 | | </attached> |
| 217 | | </StaticEntity> |
| | 205 | #!xml |
| | 206 | <!-- First, the script has to be included (only once). --> |
| | 207 | <?lua |
| | 208 | dofile("includes/asteroidField.lua") |
| | 209 | ?> |
| | 210 | |
| | 211 | <!-- Usage: Creates an asteroid belt --> |
| | 212 | <?lua |
| | 213 | asteroidBelt(20000, 0, 13000, -48, -34, 70, 100, 200, 22000, 20000, 500, 1) |
| | 214 | ?> |
| | 215 | <!-- asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog) --> |
| 227 | | <!-- A for loop. the index i starts from 1, is increased up to 10 by adding +1. --> |
| 228 | | }}} |
| 229 | | |
| 230 | | * Insert randomized values. By doing so your level's appearance is slightly changing whenever it is loaded. |
| 231 | | {{{ |
| 232 | | #!xml |
| 233 | | <?lua print(math.random() * 10 + 5) ?> |
| | 227 | }}} |
| | 228 | Note that '''<?lua print(i*100 + 50) ?>''' directly inserts the calculated value when the level is loaded. |
| | 229 | |
| | 230 | * Randomized values, sinus, cosinus and more. (Via sinus and cosinus circular shapes can be created easily. The randomization changes your level's appearance whenever it is reloaded.) |
| | 231 | {{{ |
| | 232 | #!xml |
| | 233 | <?lua |
| | 234 | max = 16 |
| | 235 | for i = 0, max, 1 |
| | 236 | do |
| | 237 | y = math.sin(i/max*6)*750 |
| | 238 | z = math.cos(i/max*6)*750 |
| | 239 | ?> |
| | 240 | <StaticEntity position="<?lua print(y) ?>,0,<?lua print(z) ?>" scale="<?lua print(math.random() * 10 + 5) ?>" collisionType="static" > |
| | 241 | <?lua end ?> |
| | 242 | |
| | 243 | |