Modme Forums

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

Game Modding | Call of Duty: Black Ops 3 | Scripting


genrix41:

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:

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:

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:

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:

Clip method doesnt work


genrix41:

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.