Call of duty bo3: Rain

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Intro

Several elements are needed to add rain into a MP/ZM map:

  • Clientscript for rain on player (rather than placing rain FXs in the map)
  • Weathergrime Volume (controls size and pitch of rain drop impacts)
  • Volume decals with special raindrop material
  • Outdoor Occlusion Volume to kill rain FX indoors
NOTE: This is not a super-mega step-by-step hold-your-hand type tutorial, its for advanced Radiant users to an extend

Clientscript

  • Script is included in the assets on last part
  • Here is the main script that controls the player Rain:
function rain_player( localclientnum )
{
    self endon( "disconnect" );
    self endon( "entityshutdown" );

    self.rain_fx_tag = Spawn( localClientNum, self.origin, "script_model" );
    self.rain_fx_tag setModel("tag_origin");

    self.rain_fx = PlayFxOnTag( localClientNum, level._effect[ "player_rain" ], self.rain_fx_tag, "tag_origin" );

    SetFXIgnorePause( localClientNum, self.rain_fx, true );
    SetFXOutdoor( localClientNum , self.rain_fx);

    while(1)
    {
        waitrealtime( 0.1 );
        if(level.rain_fx_enabled)
        {
            if(!isdefined(self.rain_fx))
            {
                self.rain_fx = PlayFxOnTag( localClientNum, level._effect[ "player_rain" ], self.rain_fx_tag, "tag_origin" );

                SetFXIgnorePause( localClientNum, self.rain_fx, true );
                SetFXOutdoor( localClientNum , self.rain_fx);
            }
            self.rain_fx_tag.origin = self.origin;
        } else {
            if(isdefined(self.rain_fx))
            {
                DeleteFX( localclientnum, self.rain_fx );
                self.rain_fx = undefined;
            }
        }
        
    }
}

Weathergrime Volume

  • The volume decal will not display anything until the rain setting in the weathergrime volume is > 0
  • The higher the rain setting (0-1) the more rain drops will appear
  • You must also set the WeatherPitch to 90 which indicates the rain is coming from above
  • The tiling will dictate how the drops are set on the volume decals

Volume Decals

  • You must place a volume decal on every surface where rain drops should appear
  • There are 2 stock materials for raindrops:
t7_decal_raindrops
t7_decal_raindrops_fast
  • You must rotate the volume decal as per usual to get the material to show
  • If Weathergrime Volume is properly setup you should see the rain drops in Radiant
  • You can use the feathering to attenuate raindrops on the non Z axis (depending how you rotate the decal)

Outdoor volume

  • In radiant you have to add an outdoor volume covering your whole playable area. ( Make sure to check enabled0-3, else the snow goes through your brushes still )
  • The Pitch is set for Rain straight down, this can set set also for angled Rain
  • Make a copy of zm_usermap.gsc and copy that into your map folder. Make sure to include it into your zone.
  • Open the file and find this line:
level util::set_lighting_state( 1 );

And replace with this:

level util::set_lighting_state( 0 );

Assets

  • Download example Asylum / Verruckt map setup with Rain and LightStates HERE

Credits

Ardivee
ZeRoY
Treyarch