• Welcome Guest, The new Modme forums are here! Please visit here for all recommended information.

Answered Zeroy's Rain - How to restrict the rain to certain map zone/area.

genrix41

Member
So I successfully implemented the rain on my map following this tutorial.

But I need to restrict the rain to certain zone.

My map is consisting of several separate small areas. Each one has it's own volume_sun. These areas are really far from each other and not connected (only with teleports).

One zone- winter with snow. Another - foggy beach. Another one - rainy forests.

The thing is -I need rain only in forests. How can I achieve that?

I think it can be done using lighting states.

For example Zeroy is using this stuff to turn the rain off:

Code:
function watch_lightstate() // for debug
{

    level waittill("power_on"); // Wait until power is switched on

    level clientfield::set("rain_fx_stop", 1); //Stops the rain
  
    wait 0.5;

    level clientfield::set("decal_toggle", 1); //Hide the decals

    wait 0.5;

    level util::set_lighting_state( 1 ); // Set new Lightstate
}
Or maybe this code could be used:

Code:
function rain_toggle( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
{
    if(newVal)
    {
        level.rain_fx_enabled = false;
    } else {
        level.rain_fx_enabled = true;
    }
}
So maybe it is possible to set rain to use only 1 lighting state, which will be set for certain volume_sun I need and set other volume_suns to different states.
 

genrix41

Member
I think it could be also done with clip texture all over the areas, where I don't need the rain. This way the game will think this is indoor areas and will stop generate the rain. Need to test it though.
 

genrix41

Member
As stupid as it is but the fake building simulation worked. I placed the brush with random texture all over the part of the map where I dont need the rain. The side of the brush visible to the player was caulked.
 
Top