Call of duty bo3: Rain

From COD Modding & Mapping Wiki
Revision as of 17:44, 27 July 2017 by Zeroy (talk | contribs) (→‎Assets)
Jump to navigation Jump to search

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

  • Outdoor volume are very simple, just drag from the Entity Browser and set all States (0-4) or only one if using multiple states
  • Place in all the buildings and places where you DO NOT WANT Rain FX to be visible
  • The Pitch is set for Rain straight down, this can set set also for angled Rain
Note: The outdoor volumes are not super accurate, sometimes some FXs will still show indoors

Assets

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

Credits

Ardivee
ZeRoY
Treyarch