Post tutorial RSS Level Editing Scripting by Prospero. Part. 17

Torches (and all other flaming objects) have a light bulit into the model and a particle system linked. They are created as with all other objects, but they have two extra parameters.

Posted by on - Basic Client Side Coding

Tut18 Torches.

Torches (and all other flaming objects) have a light bulit into the model and a particle system linked.

They are created as with all other objects, but they have two extra parameters.


Set the FiresIntensity to [0.0] for the maximum flame. As you increase this value, the flame will get less until none is visible.
(about [46] in think)

Lights has a number of values.

python code:
Lights =  [(10.0,0.03125,(255,196,128))]

First is the brightness. 0 is no light. 10 is about average. You can increase fora brighter light. (The max in the game is about 60).
Second value is the Precission. Not exactly sure how this works.
Last set of three is the colour (r,g,b). You can alter the colour of the light, but the flame will alway remain orange.

A nice feature in the game is the ability to light hand torches and to light wall torches with hand torches. Only three types can be used like this:

"Antorcha" (hand torch)
"Antorchaenpared" (wall torch)
"Palangana" (fire bowl)

To make a hand torch that can be lit, create it 'dead', that is

python code:
Lights= [(0.0,0.03125,(255,196,128))]

then add this:

python code:

First value is the brightness of the light when the totch is lit.
Second the fire intensity when torch is lit.

The last sets the time it will burn. -1 is everlasting. 180 will make it go out after 3minutes. You can only use them once.

The same method applies for wall torches, but the Player must have a lit torch in hand to use them.

btw. The "Antorcha" is officially a weapon. It's hit points are low in it's unlit state. BUT when you light them they aquire FIRE damage. If you create them ready lit you must still apply the SetUseable
code to enable the FIRE damage.

There is only one carryable torch, but lots of static ones. If you want to light other types you must use this little trick:

in DefFuncs...

python code:

# This adds the obj "LamparaNegra" to the useable torches.


python code:
Reference.EntitiesSelectionData["LamparaNegra_367"]=(8,2500,MenuText.GetMenuText("Sacred Torch"))

Do the last part for each individual torch object. The text at the end will show as the onscreen 'hint'

This code in this tut needs two extra imports. I won't say what as you should be able to spot them by now.

Certain flaming objects are just flames: They are "BoladeFuego" and the like. You can create lights in the LED which are compiled into the .bw file but you can also create lights seperately in script under the Kind:

"Entity Spot"

They have various parameters like:

Color= 255,113,10
Precission=0.8 #(?)

Set CastShadows param to 1 for shadows,0 for none. If you want to kill the cast shadows on a torch object use:

python code:
lo=AuxFuncs.GetSpot(lite1)  # lite1 being the var of obj

Lastly, You may have noticed in the game that hand torches tend to go out when you go outside. There is a sound reason for this. Waving a light source about in a big area can affect framerates dramatically and you don't really need a torch outside anyway. Assign a function
'Apagala' (name doesn't matter. It's Spanish for 'turn it off' )
to any sectors near the exit(s) from an interior place.

python code:
def Apagala(sector,entity):
    if a.Kind == "Antorcha":
        print"My Torch has gone out!"
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.