Page 1 of 2
Thriller light beam ? Plz help
Posted: Mon Jan 17, 2005 1:08 am
by [NER-BNL]Veteran
Does anyone know how to make a light beam go on and off , like in those thriller movie.
// Scene is a dark hallway in a mental institution
Someone please help, or point me to a tut.
Greetz Veti (Mapping noob)
Posted: Mon Jan 17, 2005 1:26 am
by lizardkid
give your light a key/value of
targetname/flickerLight
and put this into notepad
Code: Select all
main:
// misc DM stuff and other junk that needs to be included
level waittill spawn
level.flickerThatLight = 1
thread flickeringLight
end
flickeringLight:
while(level.flickerThatLight == 1)
{
wait 15
$flickerLight hide
wait .3
$flickerLight show
wait 2
$flickerLight hide
wait .3
$flickerLight show
wait .5
$flickerLight hide
wait 5
$flickerlight hide
wait .5
$flickerLight show
}
end
save it as the same name as your map with a .scr extension instead. (say your map's name is myMap.map, save this as myMap.scr) and put it with the map after you've compiled
this is a pretty smple bit of code, hide makes it disappear, show makes it appear. it's a really cool effect though, when applied indoors.
mess with those wait values (wait
5) to get the light flickering just like you want it, i used those for an electric light in a dark garrison once. it had a cool effect in the building, but the model's shading looked awful, so use wisely.
Posted: Mon Jan 17, 2005 7:51 am
by wacko
I would recommend adding a corona to make it more realistic.
Then, I couldn't make a light entity hide or show ingame.
But:
u can add to ur map a script_origin and make it light in the script. This light though will be visible on the backsides of walls it shines on
If u don't care, then here we go:
Add a light bulb.
Add a script_origin where u want the light to be. Give it model : fx/dummy.tik and targetname : fx_light_01
Add another script_origin where u want the corona to be. Give it model : static/corona_reg.tik and targetname : fx_light_01 and imho scale : 0.5
In ur script something like
Code: Select all
main:
// misc DM stuff and other junk that needs to be included
level waittill spawn
thread flickeringLight
end
flickeringLight:
while(1)
{
wait (randomfloat 2)
$fx_light_01 light 1 1 1 (randomfloat 100+300)
$fx_corona_01 show
wait (randomfloat 2)
$fx_light_01 light 1 1 1 0 //R(0-1) G(0-1) B(0-1) Radius
$fx_corona_01 hide
}
end
Here's this stuff (map+scr) in a zip
Dunno what the randomize parameters do (well, change the values, but how exactly) and I was too lazy to find out.

Posted: Mon Jan 17, 2005 11:07 am
by [NER-BNL]Veteran
Thanx wacko, gonna try it out right away!!!
Greetz Veti
Posted: Mon Jan 17, 2005 11:12 am
by Elgan
isnt (randomfloat 100+300) the same as (randomfloat 400):S
and flloat
Posted: Mon Jan 17, 2005 11:21 am
by wacko
Elgan wrote:isnt (randomfloat 100+300) the same as (randomfloat 400):S
and flloat
if I only knew

i think it does a random number between 300 and 400 or 200 and 400 or dunno. then, there's 'randomint 300 100' which imho does from 300 to 400.
But this is rather embarrassing, cauz prob there are more who know than who don't. All I know is that 'randomflow max' and 'randomint max' return a value between 0 and max and 'randomfloat a b' does something else

Posted: Mon Jan 17, 2005 12:02 pm
by bdbodger
isnt (randomfloat 100+300) the same as (randomfloat 400):S
and flloat
(randomfloat 100 + 300) is every number between 300 and 399 , randomfloat 400 is every number between 0 and 399 and randomfloat (100 + 300) is the same as randomfloat 400 isn't it ?
Posted: Mon Jan 17, 2005 1:19 pm
by Elgan
bdbodger wrote:
isnt (randomfloat 100+300) the same as (randomfloat 400):S
and flloat
(randomfloat 100 + 300) is every number between 300 and 399 , randomfloat 400 is every number between 0 and 399 and randomfloat (100 + 300) is the same as randomfloat 400 isn't it ?
i guess that wud make sense. didnt know that you could set a min and a max using +:S
Posted: Mon Jan 17, 2005 3:13 pm
by wacko
sounds good, yes. thnx Bd
So:
randomint and randomfloat do the same but randomint can just handle integers?!
and
randomint (value) gives a result of
between 0 and (value)
randomint (value) + anothervalue obviously (now

) a result
between (0 + anothervalue) and (value + anothervalue). So it's not a special min and max parameter, but rather simple mathematics, like anynumber + 5 is more than 5 and less than anynumber + 6.
Any objections or coments?
Posted: Tue Jan 18, 2005 1:38 pm
by bdbodger
not sure how many digits randomfloat goes to 4 maybe ? 300.0000 to 399.9999 ?
Posted: Wed Jan 19, 2005 11:00 am
by [NER-BNL]Veteran

This is how i'm sitting behind my comp right now....
Tried the lightbeam tut.. made the texture, but it shows up as a black and blue squared texture... I'm i missing something or... i'm i just being blond again..?
Got a problem with the compiler also... When i compile it starts up mohaa, but console opens, and it reads CAN'T FIND LOCALISATION ENTRY... and COULDN"T LOAD thriller.bsp
(couldn't make a screenie , sinds i haven't got I-net at the moment

)
Posted: Wed Jan 19, 2005 12:23 pm
by wacko
I presume u see black/blue squares in radiant!?
what did u call ur texture, where did u put it?
what is in ur shader file?
Posted: Thu Jan 20, 2005 10:20 am
by [NER-BNL]Veteran
shader text was a copy past of your tut, and named the textures the same.. Just put it in my_textures instead of beam... but made only those changes in the text of the shader that reffered to ....\textures\beam
and yes it shows up in black/blue in radiant...
Can't test the map ... cause he can't find the .bsp of my map.... Mbuilder doesn't create it or something
Posted: Thu Jan 20, 2005 11:21 am
by wacko
So, u're shader looks like:
Code: Select all
textures/my_textures/beamfade
{
qer_editorimage textures/my_textures/beamfade.tga
qer_keyword utility
qer_trans .4
surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm trans
cull none
sort additive
{
map textures/my_textures/beamdust.tga
blendFunc add
tcMod scroll 0.05 0
tcMod scale 1 1
nextbundle
map textures/my_textures/beamfade.tga
}
}
The tga files are 24bit and in mohaa/main/textures/my_textures/beamdust.tga and mohaa/main/textures/my_textures/beamfade.tga
plz check this (typo?)
then 'bout mbuilder.
it does show the map in the map list (lower right)? Then it has found it. Open the 'other options' and check the 'Pause after...'. U will now be able to read what it did in e.g. the bsp stage. There's probably a leak in ur map u'd have to fix first.
Posted: Thu Jan 20, 2005 12:04 pm
by [NER-BNL]Veteran
oke i'll check it... but even with the simple room it didn't work..
paths are set correctly...
Could it be that i got a soundfix from Wombat installed, my some of my sounds dissappeared after dl'ing a map... used the wombat soundfix to fix it..