Page 1 of 1
Flickering light?
Posted: Mon Feb 03, 2003 11:57 pm
by wacko
Is it possible to make light flicker? I want to add some torches but the light they give should - well - flicker.

Posted: Tue Feb 04, 2003 12:45 am
by [253RID]General-Haines
Glad u made this post I too was wondering how to make light ~Bulbs~ Flicker
Posted: Tue Feb 04, 2003 7:10 am
by wacko
Will be a script... Hopefully one for all torches (bulbs) which I can give some values in the entity-inspector, so they won't flicker exactly in the same rhythm!
Posted: Tue Feb 04, 2003 7:32 am
by jv_map
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)
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
Posted: Tue Feb 04, 2003 8:23 am
by wacko
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?
Posted: Tue Feb 04, 2003 8:38 am
by jv_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
This should do it.
Posted: Tue Feb 04, 2003 9:10 am
by wacko
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)
Posted: Tue Feb 04, 2003 9:10 pm
by wacko
In 9 out of 10 cases, I'm just too stupid, but I'm trying now for don't know how long. Is there the slightest possibilty, that this can't work?
Posted: Tue Feb 04, 2003 9:18 pm
by jv_map
Have you enabled dynamic lighting in the advanced options?
Well there is a slight possibility it doesn't work

.
Posted: Tue Feb 04, 2003 9:34 pm
by wacko
I have enabeld everthing, turned everything to HIGH, MAX, COMPLEX, restarted MOHAA, checked script and map aqgain. No way

Could you do a small map+scr to show us how?
Posted: Tue Feb 04, 2003 9:39 pm
by [253RID]General-Haines
mine didnt work either

lol
Posted: Thu Feb 06, 2003 6:07 pm
by wacko
Something new? Could anyone make it work?
Posted: Thu Feb 06, 2003 6:34 pm
by jv_map
Hmm maybe try a different model

Posted: Thu Feb 06, 2003 6:46 pm
by wacko
What kind of model did you have in mind? I tried fx/lanternflame.tik, but it made no difference...
Maybe you could comment your script, as I have really NO idea, what I could try to change in it.
Posted: Sun Feb 16, 2003 1:48 pm
by wacko
Thanks to Jv!
The solution is
here