
Flickering light?
Moderator: Moderators
Flickering light?
Is it possible to make light flicker? I want to add some torches but the light they give should - well - flicker.


-
[253RID]General-Haines
- Sergeant Major
- Posts: 114
- Joined: Fri Jan 17, 2003 7:46 pm
- Location: New Jersey USA
- Contact:
Glad u made this post I too was wondering how to make light ~Bulbs~ Flicker
253rd Regimental Infantry Division

Our Spearhead Total conversion mod is now recruiting. http://www.thegreendevils.tk

Our Spearhead Total conversion mod is now recruiting. http://www.thegreendevils.tk
Yes that's possible, and not even that difficult!
First, you need a model to emit light. It doesn't have to be a visible model, but should just be a model. You could use a script model with model 'fx/dummy.tik'. Assign a targetname of 'lightflicker'.
In your script, create these threads below your main thread. Remember to start the 'lights:' thread at level start-up (below waittill spawn)
First, you need a model to emit light. It doesn't have to be a visible model, but should just be a model. You could use a script model with model 'fx/dummy.tik'. Assign a targetname of 'lightflicker'.
In your script, create these threads below your main thread. Remember to start the 'lights:' thread at level start-up (below waittill spawn)
Code: Select all
lights:
for(local.i = 1; local.i <= $lightflicker.size; local.i++)
{
$lightflicker[local.i] light 256 0.9 0.7 0.7 // radius, RGB
$lightflicker[local.i] thread flicker
}
end
flicker:
while(1)
{
self lightOn
wait (randomfloat 1.5)
self lightOff
wait (randomfloat 1.5)
}
end
This looks pretty easy! Thanks! Unfortunately, I have no script or a main thread. So, first I need to find something about this problem first. Is there a tut for monkeys? I was mapping all the time without scripting, these times seem to be over now.
If I need now special script for anything else in my map, is it enough to make a new textfile, copy the stuff in it and call it torchmap.scr or whatever and put it into the maps/dm folder together with the torchmap.map?
If I need now special script for anything else in my map, is it enough to make a new textfile, copy the stuff in it and call it torchmap.scr or whatever and put it into the maps/dm folder together with the torchmap.map?
Code: Select all
main:
level waittill spawn
for(local.i = 1; local.i <= $lightflicker.size; local.i++)
{
$lightflicker[local.i] light 256 0.9 0.7 0.7 // radius, RGB
$lightflicker[local.i] thread flicker
}
end
flicker:
while(1)
{
self lightOn
wait (randomfloat 1.5)
self lightOff
wait (randomfloat 1.5)
}
end
Unfortunately nothing happens. Map is main/maps/dm/dm_crypt.map
I made a dm_crypt.scr with your code in main/maps/dm, in the map where this torch is, I replaced(!) the light entity with the script_model with classname:script_model, model:fx/dummy.tik, origin:-101.85 2.16 96.23, targetname:lightflicker and testanim:idle
Now there is no light, no flicker just a torch with flames (as before)
I made a dm_crypt.scr with your code in main/maps/dm, in the map where this torch is, I replaced(!) the light entity with the script_model with classname:script_model, model:fx/dummy.tik, origin:-101.85 2.16 96.23, targetname:lightflicker and testanim:idle
Now there is no light, no flicker just a torch with flames (as before)
-
[253RID]General-Haines
- Sergeant Major
- Posts: 114
- Joined: Fri Jan 17, 2003 7:46 pm
- Location: New Jersey USA
- Contact:
mine didnt work either
lol
253rd Regimental Infantry Division

Our Spearhead Total conversion mod is now recruiting. http://www.thegreendevils.tk

Our Spearhead Total conversion mod is now recruiting. http://www.thegreendevils.tk
