1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Fixing A Weather System

Discussion in 'Programming' started by Dremek, Nov 15, 2013.

  1. I'm using the map City 17, and I'm trying to get rain NOT to go through some of the roofs.

    Now, I modified it in everyway possible, but I can't seem to NOT make it go through some of the roofs.

    This is the code that checks if you are outside, so it will draw the rain outside.

    Can anyone help me on this?

    That is code that seems to work with OTHER systems, but it gives me this error when I replace it:
    The code is in cl_weather, but it's not working for some reason.

    Any help? I'm trying to solve this as we speak, since I'm new to LUA itself. (A programmer, but just new to LUA.)

    Line 16 is: trace.endpos = trace.start + Vector( 0, 0, 32768 );

    EDIT: I've fixed the error, my code now: http://pastebin.com/HQU99x1w


    But it still goes through the ceiling, help?


    EDIT EDIT: I know it has something to do with the weather height, but how can I make it not go indoors?
     
  2. Bump: Help?
     
  3. Tommy

    Tommy Guest

    you could try setting it so the weather height is different at different areas of the map

    so its higher at the buildings and lower at the ground

    so it wont hit the building but itll hit the ground

    idk just a suggestion
     
  4. Razor

    Razor Guest

    Or you could check if there is anything on top of the player :\
    Rather than going down like that :\
    Okay my bad.

    This is how I'd do it

    Code:
    local function IsOutside()
    	local lp = LocalPlayer()
    	local pos = lp:GetPos()
    	local mins, maxs = lp:GetCollisionBounds()
    	local trace = { }
    	trace.start = pos
    	trace.endpos = pos + (lp:GetUp() * 32768)
    	trace.mins = mins
    	trace.maxs = maxs
    
    	local tr = util.TraceHull(trace)
    	
    	if(tr.Hit and tr.HitSky) then return true end;
    	
    	return false
    end
     
  5. Thanks, I'll check the code out.

    I'll edit on the results!
     
  6. Nope, it still goes through the ceiling.

    The funny thing though, is that when I fly up closer to the ceiling, the rain stops.

    That's sort of why I think it has to do with weather height.
     
  7. Mage

    Mage Guest

    You'd most likely have to set the collision so it wouldn't hit the buildings.
     
  8. It's not collision, that's not the problem.

    I'm looking on how to fix weather height. Because when you noclip/fly near the ceiling the rain will stop.

    It works in short buildings, but anything too high, it rains.
     
  9. Mage

    Mage Guest

    Oh I see, okay yeah, but if you heightened it, wouldn't that affect how it comes down outside?
     
  10. Razor

    Razor Guest

    By the way, I just realized I sticked by your "if then return".

    You could simply do:
    Code:
    return (tr.Hit and tr.HitSky)
     

Previous Readers (Total: 0)