Page 1 of 1

func_rain

Posted: Mon Jan 12, 2009 5:47 pm
by SilentAngel
is possible fo use func_rain in scripting, because I would put some rain ai a stock map...
I don't know how func_rain works, so I tried some ways but don't get it to work! :?

Posted: Mon Jan 12, 2009 6:53 pm
by $oldier Of Ra
Yes, however there are 2 downsides:
- Rain is very laggy; scripted or through radiant
- Through scripting, your rain will fall through roofs, floors etc...

Place this in your script and thread it. You may also need to exec global/weather.scr.

Code: Select all

rain:
spawn script_model "targetname" "weatherF" "classname" "func_rain" "origin" "( 1 1 1 )" "angle" "0"
$weatherF setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
$weatherF notsolid
$weatherF show

spawn script_model "targetname" "weatherR" "classname" "func_rain" "origin" "( 1 1 1 )" "angle" "0"
$weatherR setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
$weatherR notsolid
$weatherR show

spawn script_model "targetname" "weatherW" "classname" "func_rain" "origin" "( 1 1 1 )" "angle" "0"
$weatherW setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
$weatherW notsolid
$weatherW show

spawn script_model "targetname" "weatherI" "classname" "func_rain" "origin" "( 1 1 1 )" "angle" "0"
$weatherI setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
$weatherI notsolid
$weatherI show
end

Posted: Mon Jan 12, 2009 8:11 pm
by SilentAngel
thanx bro.
okay, let see if I've understood:
this script apply the func_rain to a specified entity(targetname) isn't it?
so if it's it what does weatherF means and why the script is repeated 4 times?

Posted: Tue Jan 13, 2009 7:07 pm
by $oldier Of Ra
Huh? What specified entity would that be? :? I spawned multiple func_rain and given them targetnames, so I use those applied targetnames to continue adding some properties to the spawned func_rain. It's another way instead of using local, group or level vars.

4 of them thickens the rain like the one you know from the sniper mission etc (I think all SP missions with rain used 4). Use 1 or 2 if you like (I would recommend it because of the lag); also these specific targetnames get handled by the weather.scr

But I'll mention it again; your rain will fall through walls, roofs, ceilings etc... it'll look like crap, not to mention the lag.

Posted: Tue Jan 20, 2009 2:51 pm
by SilentAngel
it wouldn't if I spown it to cover only yhe outside...
it will give me some days of work because of the coords and sizes that I have to calculate to do this, but it will be good..isn't it?

Posted: Tue Jan 20, 2009 8:53 pm
by $oldier Of Ra
The more func_rain you spawn, the more the map will lag. Besides, how odd and unrealistic would it look to see it raining everywhere except over roofs? Because if you would have placed rain over a roof, then it would fall through it, wouldn't it :)?
It seems like you're stuck here. It is impossible to get proper rain without doing it in radiant. Either accept this or don't script func_rain.