BigTruck's Fan Page

BOD Python Scripting

13 - Sun, Water, Footsteps

You will have noticed on some maps the sun is visible and casts nice rays. If you would like this in your map it is eeeeeeeeeze.

In your DefFuncs.py file add:
Bladex.SetSun(1,-10,8,16)
I have no idea what the first arg, 1 is for so just leave it as 1 and forget it. The last 3 args should match the settings of the External light in the LED. The position of the sunflare will then be consistant with all the cast shadows. btw. In the RAS maps the sun is created in a file sol.py. For some reason the sunflare is not saved in memory like all the entities and is absent in the saved games. If you put the code in DefFuncs.py it will be recreated as the savegame loads. The sunflare is optional. It is purely cosmetic and does not emit light.

Water

Water is easy enough. You just have to be careful with your coords to avoid floods. In the LED, move cursor to where you want a pool. Note X and Y readings. You need a 'seed point' which can be anywhere within where you want a wet bit. The water will flow out in the manner of real water (watch for leaks.). The critical part is the Z reading as this sets the water level. Make sure it doesn't overflow or it can be very embarassing. The code is:
pool1= Bladex.CreateEntity("Pool1","Entity Water",-7000,500,43000)
pool1.Reflection=0.7
pool1.Color=0,0,0 #red,green,blue
Tweak the Color (0 to 255) and Reflection (0 to 1) to your preference.
If you have a lot of pools, you can make a seperate file, or you can put the pools in objs.py.

Footsteps

This is a very cool feature of the game that allows you to assign different footstep sounds to various textures. Also, it affects the sound made when a surface is hit. (Arrows hit snow with nice crunch.)

Make a file 'TextureMaterials.py'. This is a Key file and must have that exact name. Shortcut here: Copy this file intact from one of the RAS maps and Paste it into your own map. If you using a texture set from a particular map, grab the one from that map. You need not edit it then. Exec it in cfg.py. Useful tip. Keep this file at the end of the execs so it is loaded last. If you have footstep sounds when the map is loaded, you then know that there are no errors in the other files.