Hello everyone.
I'm trying to get weather mod v6 to work on my roleplay server, The only bug I can't fix is that the rain particle effect spawns outside the skybox. Can any of you help me with getting it to spawn inside the skybox?
The 2 scripts that it uses are:
Client:
[code]
WEATHER={
["sunny"]={
Brightness=0,
Contrast=1,
Colour=1,
Precipitation=0,
SoundLevel=3.9,
Pitch=100,
},
["cloudy"]={
Brightness=0,
Contrast=1,
Colour=0.6,
Precipitation=0,
SoundLevel=3.9,
Pitch=100,
},
["rain"]={
Brightness=-0.07,
Contrast=0.9,
Colour=0.4,
Precipitation=10,
SoundLevel=3.9,
Pitch=100,
Sound="ambient/weather/rumble_rain_nowind.wav",
},
["heavyrain"]={
Brightness=-0.07,
Contrast=0.9,
Colour=0.4,
Precipitation=15,
SoundLevel=3.9,
Pitch=100,
Sound="ambient/weather/rumble_rain_nowind.wav",
},
["sunnyrain"]={
Brightness=0,
Contrast=0.7,
Colour=1.2,
Precipitation=10,
SoundLevel=3.9,
Pitch=100,
Sound="ambient/weather/rumble_rain_nowind.wav",
},
["storm"]={
--Brightness=-0.15,
--Contrast=0.7,
--Colour=0.1,
Brightness=0,
Contrast=0.3,
Colour=1,
Precipitation=30,
SoundLevel=2.9,
Pitch=100,
Sound="ambient/weather/rumble_rain.wav",
},
["dark"]={
Brightness=0,
Contrast=0.3,
Colour=1,
Precipitation=0,
SoundLevel=2.9,
Pitch=100,
},
["darkrain"]={
Brightness=0,
Contrast=0.3,
Colour=1,
Precipitation=5,
SoundLevel=3.9,
Pitch=100,
Sound="ambient/weather/rumble_rain_nowind.wav",
},
}
local CurWeather={
Brightness=0,
Contrast=1,
Colour=1,
Precipitation=0,
Pitch=100,
SoundLevel=3.9,
Pitch=100,
}
SetGlobalString("weather","sunny")
local WeatherSound=nil
local PrevWeather="sunny"
local LastLightning=0
function WeatherOverlay()
if render.GetDXLevel() < 80 then return end
local WeatherName=GetGlobalString("weather")
if not WeatherName or not WEATHER[WeatherName] then WeatherName="sunny" end
local traced = {}
traced.start = LocalPlayer():GetPos()
traced.endpos = LocalPlayer():GetPos()+Vector(0,0,40)
traced.mask = MASK_NPCWORLDSTATIC
local tr=util.TraceLine(traced)
if tr.HitWorld then
CurWeather.Brightness=math.Approach( CurWeather.Brightness, math.Clamp(WEATHER[WeatherName].Brightness,0,5), 0.01 )
CurWeather.Contrast=math.Approach( CurWeather.Contrast, math.Clamp(WEATHER[WeatherName].Contrast,1,5), 0.01 )
CurWeather.Colour=math.Approach( CurWeather.Colour, math.Clamp(WEATHER[WeatherName].Colour,1,5), 0.01 )
else
CurWeather.Brightness=math.Approach( CurWeather.Brightness, WEATHER[WeatherName].Brightness, 0.01 )
CurWeather.Contrast=math.Approach( CurWeather.Contrast, WEATHER[WeatherName].Contrast, 0.01 )
CurWeather.Colour=math.Approach( CurWeather.Colour, WEATHER[WeatherName].Colour, 0.01 )
end
CurWeather.Precipitation=math.Approach( CurWeather.Precipitation, math.Clamp(WEATHER[WeatherName].Precipitation,0,25), 0.01 )
local ScrColTab = {}
ScrColTab[ "$pp_colour_addr" ] = 0
ScrColTab[ "$pp_colour_addg" ] = 0
ScrColTab[ "$pp_colour_addb" ] = 0
ScrColTab[ "$pp_colour_brightness" ]= CurWeather.Brightness
ScrColTab[ "$pp_colour_contrast" ] = CurWeather.Contrast
ScrColTab[ "$pp_colour_colour" ] = CurWeather.Colour
ScrColTab[ "$pp_colour_mulr" ] = 0
ScrColTab[ "$pp_colour_mulg" ] = 0
ScrColTab[ "$pp_colour_mulb" ] = 0
DrawColorModify(ScrColTab)
if not PrevWeather or PrevWeather~=WeatherName then
if WeatherSound then WeatherSound:Stop() end
if WEATHER[WeatherName].Sound then
WeatherSound=CreateSound(LocalPlayer(),WEATHER[WeatherName].Sound)
WeatherSound:Play()
PrevWeather=WeatherName
else
WeatherSound=nil
end
end
if CurTime()>LastLightning and CurWeather.Precipitation>10 then
if math.random(1,20)==10 then
LastLightning=CurTime()+30
CurWeather.Contrast=5
timer.Simple(0.2,function()
CurWeather.Contrast=WEATHER[WeatherName].Contrast
end)
timer.Simple(3,function()
surface.PlaySound(Format("ambient/atmosphere/thunder%i.wav",math.random(1,4)))
end)
end
end
if WeatherSound and tr.HitWorld or (WeatherSound and LocalPlayer():InVehicle()) then
CurWeather.SoundLevel=math.Approach( CurWeather.SoundLevel, 2, 0.195 )
CurWeather.Pitch=math.Approach( CurWeather.Pitch, 50, 2 )
WeatherSound:SetSoundLevel(CurWeather.SoundLevel)
WeatherSound:ChangePitch(CurWeather.Pitch)
elseif WeatherSound then
CurWeather.SoundLevel=math.Approach( CurWeather.SoundLevel, 3.9, 0.195 )
CurWeather.Pitch=math.Approach( CurWeather.Pitch, 100, 2 )
WeatherSound:SetSoundLevel(CurWeather.SoundLevel)
WeatherSound:ChangePitch(CurWeather.Pitch)
end
end
hook.Add("RenderScreenspaceEffects", "WeatherOverlay", WeatherOverlay)
local LastEffect=0
function WeatherThink()
local WeatherName=GetGlobalString("weather")
if not WeatherName or not WEATHER[WeatherName] then WeatherName="sunny" end
if CurWeather.Precipitation>0 then
if CurTime()>LastEffect then
LastEffect=CurTime()+1
local eff=EffectData()
eff:SetMagnitude(CurWeather.Precipitation)
util.Effect("rain",eff)
end
end
end
hook.Add("Think","",WeatherThink)
[/code]And Server:
[code]--Weather Stuff
--Modified By Fisheater
--Thank you to Rick Dark for creating the weathermod system!
--Never forget about the servers :)
AddCSLuaFile( "autorun/client/cl_weather.lua" )
--Making sure that the client downloads the material for the rain
resource.AddFile("materials/particle/rprain.vmt")
resource.AddFile("materials/particle/rprain.vtf")
storm_active = false;
function Console( ply, text, chat )
if( ply:EntIndex() == 0 ) then
Msg( text .. "\n" );
else
ply:PrintMessage( 2, text );
if( chat ) then
ply:PrintMessage( 3, text );
end
end
end
function BeginStorm()
storm_active = true
SetGlobalString("weather","dark")
timer.Simple( 8, function()
if( storm_active ) then
for k, v in pairs( player.GetAll() ) do
v:ConCommand("play " .. Format("ambient/atmosphere/thunder%i.wav",math.random(1,4)) )
end
end
end );
timer.Simple( 10, function()
if( storm_active ) then
SetGlobalString("weather","storm")
end
end );
timer.Simple( 480, function()
if( storm_active ) then
SetGlobalString("weather","dark")
end
end );
timer.Simple( 490, function()
if( storm_active ) then
SetGlobalString("weather","sunny")
end
end );
timer.Simple( 510, function()
storm_active = false
end );
end
function WeatherPromptStorm( ply, cmd, arg )
if( ply:EntIndex() ~= 0 and not ply:IsAdmin() ) then return; end
if not storm_active then
Console( ply, "Created a storm.", true );
BeginStorm();
else
Console( ply, "A Storm is already in progress!", true );
end
end
concommand.Add( "weather_storm", WeatherPromptStorm );
concommand.Add( "weather_promptstorm", WeatherPromptStorm );
function WeatherDay( ply, cmd, arg )
if( not ply:IsAdmin() ) then return; end
if not storm_active then
SetGlobalString("weather","sunny")
end
end
concommand.Add( "weather_day", WeatherDay );
concommand.Add( "weather_
I have the same problem. I'm using the same mod.
[url]http://www.garrysmod.org/downloads/?a=view&id=87694[/url]
It would be great if I could get it to work.
Sorry, you need to Log In to post a reply to this thread.