Updated July 24, 2005
HOME PAGE > AUTHORS > PROSPERO > BOD PYTHON SCRIPTING (13)
Tut13. 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