Pulsing lights..
Moderator: Moderators
-
Franaticus Satanii
- Colour Sergeant
- Posts: 84
- Joined: Tue Aug 19, 2003 5:38 pm
- Location: Florida, USA
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
ok sorry 1st of all for taking so long to read this thread and 2ndly sorry to Wacko for changing the method but
create a brush
change to script_object
press n with the brush selected
then enter
key: model
value: fx/dummy.tik
key: targetname
value: pulsating_light
then in script
main:
thread pulsating_light 30
end
pulsating_light local.light:
$pulsating_light light 1 0 0 30 //1 0 0 30 repesent red green blue range
$pulsating_light thread dim_me local.light
end
dim_me local.light:
self light 1 0 0 local.light
wait .2
if (local.light > 30)
{local.light = local.light - 5
self thread dim_me local.light}
else
{self thread light_me local.light}
end
light_me local.light:
self light 1 0 0 local.light
wait .2
if (local.light < 100)
{local.light = local.light + 5
self thread light_me local.light}
else
{self thread dim_me local.light}
end
/*change the values of 30 and 100 if the light is too bright or too dim
and change the wait .2 value to greater numbers if the increment time is to slow
*/
create a brush
change to script_object
press n with the brush selected
then enter
key: model
value: fx/dummy.tik
key: targetname
value: pulsating_light
then in script
main:
thread pulsating_light 30
end
pulsating_light local.light:
$pulsating_light light 1 0 0 30 //1 0 0 30 repesent red green blue range
$pulsating_light thread dim_me local.light
end
dim_me local.light:
self light 1 0 0 local.light
wait .2
if (local.light > 30)
{local.light = local.light - 5
self thread dim_me local.light}
else
{self thread light_me local.light}
end
light_me local.light:
self light 1 0 0 local.light
wait .2
if (local.light < 100)
{local.light = local.light + 5
self thread light_me local.light}
else
{self thread dim_me local.light}
end
/*change the values of 30 and 100 if the light is too bright or too dim
and change the wait .2 value to greater numbers if the increment time is to slow
*/
hope this helps, prob not cos it's all foreign 2 me :-/
nuggets, u don't have to be sorry!!!
Especially, because your script can't do what my model does: It still makes an invisible light (like tltrude said). If it's hovering in the air without some brushes around, you won't see anything. Instead, yours can light up near brushfaces but
Also, when using a scripted light, don't forget, that it won't be blocked by brushes, but even light up their backside (As I had to find out while playing with those torches) That's because during compilation the light isn't yet existing.
Heydrich, you're welcome. Additionally, if you wanted to
- change the color of the corona, you would have to edit the corona_red.tga
- change the size, edit the scale of the model in the entity properties of it (select it, press 'n')
- change something else, in the corona_red.shader, play with the line
tcMod stretch sin 1.5 0.75 1 0.1, where in this case
sin is the wave function (could be 'sin' _/??\__, 'triangle' /\/\, 'square'__|??|__|, 'sawtooth' /|/|, inversesawtooth' |\|\)
1.5 is the base scale
0.75 is the amplitude (1 would double the scale)
1 is the phase (of no importance here)
0.1 is the frequency (the number of peaks per second)
Especially, because your script can't do what my model does: It still makes an invisible light (like tltrude said). If it's hovering in the air without some brushes around, you won't see anything. Instead, yours can light up near brushfaces but
and that's what the model doesHeydrich wrote:(that he doesn't)...need this light to actually produce lighting...just to give the appearance of pulsing slowly.
Also, when using a scripted light, don't forget, that it won't be blocked by brushes, but even light up their backside (As I had to find out while playing with those torches) That's because during compilation the light isn't yet existing.
Heydrich, you're welcome. Additionally, if you wanted to
- change the color of the corona, you would have to edit the corona_red.tga
- change the size, edit the scale of the model in the entity properties of it (select it, press 'n')
- change something else, in the corona_red.shader, play with the line
tcMod stretch sin 1.5 0.75 1 0.1, where in this case
sin is the wave function (could be 'sin' _/??\__, 'triangle' /\/\, 'square'__|??|__|, 'sawtooth' /|/|, inversesawtooth' |\|\)
1.5 is the base scale
0.75 is the amplitude (1 would double the scale)
1 is the phase (of no importance here)
0.1 is the frequency (the number of peaks per second)
-
Franaticus Satanii
- Colour Sergeant
- Posts: 84
- Joined: Tue Aug 19, 2003 5:38 pm
- Location: Florida, USA
Hey, maybe another newbies perspective might help, couldnt u do this in the script:
tower_pulse:
$redcorona scale 2
wait 0.1
$redcorona scale 1.9
wait 0.1
$redcorona scale 1.8
wait 0.1
$redcorona scale 1.7
wait 0.1
$redcorona scale 1.6
wait 0.1
$redcorona scale 1.5
wait 0.1
$redcorona scale 1.4
wait 0.1
$redcorona scale 1.3
wait 0.1
$redcorona scale 1.2
wait 0.1
$redcorona scale 1.1
wait 0.1
goto tower_pulse
end
I know it is very primitive but wouldn't that work??
Bilko.
tower_pulse:
$redcorona scale 2
wait 0.1
$redcorona scale 1.9
wait 0.1
$redcorona scale 1.8
wait 0.1
$redcorona scale 1.7
wait 0.1
$redcorona scale 1.6
wait 0.1
$redcorona scale 1.5
wait 0.1
$redcorona scale 1.4
wait 0.1
$redcorona scale 1.3
wait 0.1
$redcorona scale 1.2
wait 0.1
$redcorona scale 1.1
wait 0.1
goto tower_pulse
end
I know it is very primitive but wouldn't that work??
Bilko.