Jump to content
主视角中国

下雨了


moh8888

Recommended Posts

//www.mohchina.com
//88

start:

local.weatherf = spawn script_model "targetname" "weatherF" "classname" "func_rain" "origin" "( 1 1 1 )"
local.weatherf setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
local.weatherf notsolid
local.weatherf show
local.weatherf loopsound rain_ext

local.weatherr = spawn script_model "targetname" "weatherR" "classname" "func_rain" "origin" "( 1 1 1 )"
local.weatherr setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
local.weatherr notsolid
local.weatherr show

local.weatherw = spawn script_model "targetname" "weatherW" "classname" "func_rain" "origin" "( 1 1 1 )"
local.weatherw setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
local.weatherw notsolid
local.weatherw show
local.weatherw loopsound wind_weak

local.weatheri = spawn script_model "targetname" "weatherI" "classname" "func_rain" "origin" "( 1 1 1 )"
local.weatheri setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
local.weatheri notsolid
local.weatheri show
local.weatheri loopsound rain_ext

// 2nd stage, Repeat first

local.weatherf = spawn script_model "targetname" "weatherF" "classname" "func_rain" "origin" "( 1 1 1 )"
local.weatherf setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
local.weatherf notsolid
local.weatherf show
local.weatherf loopsound rain_ext

local.weatherr = spawn script_model "targetname" "weatherR" "classname" "func_rain" "origin" "( 1 1 1 )"
local.weatherr setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
local.weatherr notsolid
local.weatherr show

local.weatherw = spawn script_model "targetname" "weatherW" "classname" "func_rain" "origin" "( 1 1 1 )"
local.weatherw setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
local.weatherw notsolid
local.weatherw show
local.weatherw loopsound wind_weak

local.weatheri = spawn script_model "targetname" "weatherI" "classname" "func_rain" "origin" "( 1 1 1 )"
local.weatheri setsize ( -6000 -6000 -1000) ( 6000 6000 6000)
local.weatheri notsolid
local.weatheri show
local.weatheri loopsound rain_ext

wait 1

//thread weather
exec global/weather.scr
thread messages
end

weather:
// local.weatherroof local.weatherwindow local.weatherin local.weatherout local.weatherflash local.weathertreewind

// if (getcvar(superfps) == "1")
//  end

level.rain_width = "0.4"
level.rain_min_dist = 512
setcvar "cg_density" "35"
level.startedrainsound1 = 1
level.startedrainsound2 = 1

level.farplane = $world.farplane
level.farplane_color = $world.farplane_color

$world farplane level.farplane
$world farplane_color level.farplane_color

if (local.weatherf == NULL)
 level.weatherFs = 0
 else
 level.weatherFs = local.weatherf.size

if (level.weatherFs > 0)
 level.weatherF = exec global/makearray.scr local.weatherf

if (local.weatherr == NULL)
 level.weatherRs = 0
 else
 level.weatherRs = local.weatherr.size

if (level.weatherRs > 0)
{
 for(local.i=1;local.i <= level.weatherR.size;local.i++)
 {
 level.weatherR[local.i] model "fx/dummy.tik"
 }
}

if (local.weatheri == NULL)
 level.weatherIs = 0
 else
 level.weatherIs = local.weatheri.size

if (level.weatherIs > 0)
 level.weatherI = exec global/makearray.scr local.weatheri

if (local.weatherw == NULL)
 level.weatherWs = 0
 else
 level.weatherWs = local.weatherw.size

if (level.weatherWs > 0)
{
 for(local.i=1;local.i <= level.weatherR.size;local.i++)
 {
 level.weatherW[local.i] model "fx/dummy.tik"
 }
}

if ($wind == NULL)
 level.winds = 0
 else
 level.winds = $wind.size

if (level.winds > 0)
 level.wind = exec global/makearray.scr $wind


level waittill spawn
//end

level.rain = 0.0
spawn script_model "targetname" "playersound"
$playersound thread playersoundorg
$playersound model "fx/dummy.tik"
$playersound notsolid

spawn script_model "targetname" "playersound2"
$playersound2 thread playersoundorg
$playersound2 model "fx/dummy.tik"
$playersound2 notsolid

spawn script_model "targetname" "playersound3"
$playersound3 thread playersoundorg
$playersound3 model "fx/dummy.tik"
$playersound3 notsolid

thread unflash
wait 1
setcvar "r_fastsky" "0.5"
$world farplane level.farplane

if (level.windtime == NIL)
 level.windtime = 15

if (level.shuttertime == NIL)
 level.shuttertime = 0.8

if (level.rainvolume == NIL)
 level.rainvolume = -1

if (level.raindensity == NIL)
 level.raindensity = -1

if (level.thundertime == NIL)
 level.thundertime = 20

thread thunder
if (game.medic != NIL)
thread medicchanger
else
thread weatherchanger

thread treemovement

for (local.i=1;local.i<level.interiors+1;local.i++)
level.interior[local.i] thread rainin

for (local.i=1;local.i<level.exteriors+1;local.i++)
level.exterior[local.i] thread rainout



level.raindest = 0.0

thread weatherpattern
local.raintime = level.time
rainvar:
 
 if (level.rain < level.raindest)
 {
 thread weatherloop
 level.rain = level.rain + 0.1
 }
 else
 if (level.rain > level.raindest)
 {
 thread weatherloop
 level.rain = level.rain - 0.1
 }
 else
 if (level.time > local.raintime)
 {
 thread weatherloop
 local.raintime = level.time + 2
 }


 wait 0.1

goto rainvar


end





weatherpattern:
if (level.weatherpattern == 0)
{
local.windtime = 15
local.shuttertime = 0.8
local.rainvolume = -1
local.raindensity = -1
local.thundertime = 20
}
else
if (level.weatherpattern == 1)
{
local.windtime = 5
local.shuttertime = 0.3
local.rainvolume = 0.2
local.raindensity = 0.8
local.thundertime = 8
}
else
if (level.weatherpattern == 2)
{
local.windtime = 3
local.shuttertime = 0.2
local.rainvolume = 0.4
local.raindensity = 3
local.thundertime = 6
}
else
if (level.weatherpattern == 3)
{
local.windtime = 1.5
local.shuttertime = 0.1
local.rainvolume = 1
local.raindensity = 10
local.thundertime = 4
}


// local.trans = 0.15
local.trans = 0.07
level.windtime = (local.windtime * local.trans + (level.windtime * (1 - local.trans)))
level.shuttertime = (local.shuttertime * local.trans + (level.shuttertime * (1 - local.trans)))
level.raindensity = (local.raindensity * local.trans + (level.raindensity * (1 - local.trans)))
level.rainvolume = (local.rainvolume * local.trans + (level.rainvolume * (1 - local.trans)))
level.thundertime = (local.thundertime * local.trans + (level.thundertime * (1 - local.trans)))
//println ("Current wind:" + level.windtime + " current shutter:" + level.shuttertime + " current raindensity:" + level.raindensity + " current rainvolume:" + level.rainvolume + " current thundertime:" + level.thundertime)

if ((level.raindensity > 0.4) && (level.rainvolume < 0.1))
level.rainvolume = 0.1

wait 1
goto weatherpattern
end

weatherchanger:

level.weatherpattern = 0
wait 4
w:
level.weatherpattern = 1
wait 10
level.weatherpattern = 2
wait 15
level.weatherpattern = 3

wait 60
level.weatherpattern = 2
wait 15
level.weatherpattern = 1
wait 60
// level.weatherpattern = 0
// wait 60
goto w

end

// 77
medicchanger:

level.weatherpattern = 0
wait 5
w2:
level.weatherpattern = 1
wait 10
level.weatherpattern = 2
wait 15
level.weatherpattern = 3

wait 20
level.weatherpattern = 2
wait 5
level.weatherpattern = 0
wait 15
// level.weatherpattern = 0
// wait 60
goto w2

end






thunder:
wait (level.thundertime + randomint( (level.thundertime * 1.5) ))
local.num = (randomint (3) + 1)
if (local.num == 1)
{
thread flash
wait 0.2
thread unflash
wait 1
thread flash
wait 0.1
thread unflash
wait 0.1
thread flash
wait 0.1
thread unflash
wait (1 + (randomfloat(2)))
}
else
if (local.num == 2)
{
thread flash
wait 0.1
thread unflash
wait 0.1
thread flash
wait 0.1
thread unflash
wait 1
thread flash
wait 0.2
thread unflash
wait (1 + (randomfloat(2)))
}
else
if (local.num == 3)
{
thread flash
wait 0.1
thread unflash
wait 0.1
thread flash
wait 0.2
thread unflash
wait 0.5
thread flash
wait 0.1
thread unflash
wait (1 + (randomfloat(2)))
}

if (game.medic == NIL)
for(local.i = 0; local.i <= $player.size; local.i++)
{
 $player[local.i] playsound thunder
}
goto thunder

end

flash:
setcvar "r_fastsky" "1"
$world farplane_color (0.9 0.9 0.9)

for (local.i=1;local.i<level.weatherFs+1;local.i++)
level.weatherF[local.i] show

end

unflash:
setcvar "r_fastsky" "0"
$world farplane_color level.farplane_color

for (local.i=1;local.i<level.weatherFs+1;local.i++)
level.weatherF[local.i] hide

end


weatherloop:
weatherlooper:
if (level.raindensity < 0)
level.rain_density = 0
else
if (level.raindensity < 1)
level.rain_density = level.raindensity * 10
else
if (level.raindensity < 10)
level.rain_density = level.raindensity
else
level.rain_density = 0.003

level.rain_density = level.raindensity // WTF Mackey?

if (level.raindensity < 5)
local.raindensity = 50
else
local.raindensity = (50 + ((level.raindensity - 5) * 8))

level.rain_slant = local.raindensity

local.rainvolume = level.rainvolume - 0.3
local.rainvolume = local.rainvolume - level.rain

/*
if (level.startedrainsound1 == 0)
{
 level.startedrainsound1 = 1
 $playersound thread replaysound
}

*/

if (local.rainvolume > 0)
 $playersound loopsound rain_ext (local.rainvolume + 0.2) "levelwide"
else
 $playersound loopsound rain_ext 0

/*
if (level.startedrainsound2 == 0)
{
 level.startedrainsound2 = 1
 $playersound2 thread replaysound2
}

*/

if (level.rainvolume > 0.4)
 local.rainvolume = (0.4 - (level.rainvolume - 0.4))
else
 local.rainvolume = level.rainvolume

local.rainvolume = local.rainvolume - level.rain

if (local.rainvolume < 0.0)
 $playersound2 loopsound rain_puddle 0
else
 $playersound2 loopsound rain_puddle (local.rainvolume + 0.2) "levelwide"


local.rainvolume = level.rainvolume - (1.0 - level.rain)

if (local.rainvolume < 0.0)
 $playersound3 loopsound rain_int 0
else
 $playersound3 loopsound rain_int (local.rainvolume + 0.2) "levelwide"


for (local.i=1;local.i<level.weatherRs+1;local.i++)
{
 if (level.rainvolume < 0)
 level.weatherR[local.i] stoploopsound
 else
 {
 level.weatherR[local.i] loopsound rain_roof (level.rainvolume + 0.2) // "levelwide"
//  println ("rainroof at " + ((level.rainvolume + 0.2) / 2.5))
 }

}

for (local.i=1;local.i<level.weatherWs+1;local.i++)
{
 if (level.rainvolume < 0)
 level.weatherW[local.i] stoploopsound
 else
 level.weatherW[local.i] loopsound rain_window (level.rainvolume + 0.2) // "levelwide"
}

/*
for (local.i=1;local.i<level.winds+1;local.i++)
{
 if (level.rainvolume < 0)
 level.wind[local.i] stoploopsound
 else
 if (level.rainvolume > 0.5)
 level.wind[local.i] loopsound "sound/environment/wind_weak.wav" (level.rainvolume + 0.2) 192
 else
 level.wind[local.i] loopsound "sound/environment/wind_strong.wav" level.rainvolume 192
}
*/


end

treemovement:
local.num = (level.raindensity + 1.5) / 2.5
setcvar "r_static_shadermultiplier1" local.num
wait 1
goto treemovement
end


playersoundorg:

for(local.i = 0; local.i <= $player.size; local.i++)
{
 self.origin = $player[local.i].origin
}
end

rainin:
self waittill trigger
level.raindest = 1.0
wait 0.1
goto rainin
end

rainout:
self waittill trigger
level.raindest = 0.0
wait 0.1
goto rainout
end

replaysound:
wait 35.5

$playersound stopsound 5

 local.rainvolume = level.rainvolume - 0.3
 local.rainvolume = local.rainvolume - level.rain

if (local.rainvolume > 0)
 $playersound loopsound rain_ext (local.rainvolume + 0.2) "levelwide"
else
 $playersound loopsound rain_ext 0
goto replaysound
end

replaysound2:
wait 14

$playersound2 stopsound 5


if (level.rainvolume > 0.4)
 local.rainvolume = (0.4 - (level.rainvolume - 0.4))
else
 local.rainvolume = level.rainvolume

local.rainvolume = local.rainvolume - level.rain

if (local.rainvolume < 0.0)
 $playersound2 loopsound rain_puddle 0
else
 $playersound2 loopsound rain_puddle (local.rainvolume + 0.2) "levelwide"
goto replaysound2
end

messages:

while (1)
{
iprintln "88"
wait 1.5
iprintln "Download the weather script from:"
wait 1.5
iprintln "www.mohchina.com"
wait 120
}

end[/code]

S20041215192833.jpg

不过房顶都下透了....

Link to comment
Share on other sites

想房间不湿就要量房间的大体尺寸,将这部分除去,

剩下下雨的部分用长方型的面积一块一块复盖,

表示为几个立体长X宽X高(图中为6000X-6000X6000),

当然要找到(0 0 0)的定位点.....

长X宽X高简单一点要借助一些软件看了....

顺便说:单人图不下雨房间的上面是没雨的....同理

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

访客
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 创建新的...