Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 91 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
CoD4 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
How to add rappelling with sound to COD4MW SP map
Versions: You must be logged in to view history.

First of all a big thank you and lots of credit to sam_fisher3000 for his tutorial and pointing the way with code, scripting and zone file info. Without his help and guidance I would not have been able to get rappelling to work and therefore write this tutorial.

Before starting, I should say that this is quite a long tutorial. Also I’m going to assume that you know your way round Radiant, can create a basic map and are comfortable with the compile tools.

Here is a list of the things needed to get rappelling working;

1. A map with a suitable tall building or other surface to rappel off to which are added a pathnode and trigger.

2. A zone file with the necessary entries.

3. A GSC file with the correct script.

4. An animation GSC file with the correct script.

5. A properly modified sound alias CSV file.

Okay here’s a screenshot of the basic map I made for this tutorial;

image01

IMPORTANT! The surface the player is going to rappel off needs to be at least 980 units above the surface that he is going to land on. If it’s any less than 980 units, the rope will poke through the skybox/lightgrid and the player will fall of the end of the rope into empty black space. It can be a little more than 980 units, but if it’s too high the player will come off the end of the rope and die when he hits the ground.

We need to add a couple of items to this basic map to get our player to rappel off the roof of the tall building.

The first thing to add is a pathnode.

To add this item, rightclick anywhere on the 2D grid, then click on node, then click on pathnode.

image02

The pathnode appears as a red box with the text node_pathnode as shown below

image03

The pathnode needs to be positioned near to the surface that the player is going to rappel off. The positioning of the pathnode is quite important because the rappelling rope spawns from the site of the pathnode. On my map the pathnode needs to be positioned as shown in the screenshot below.

image04

The final position of the pathnode might need a little “tweaking” in your map to get a realistic effect.

When you are happy with the position of the pathnode press the N key to bring up the entity window.

In the Key box type targetname, and in the Value box type player_rappel_node NOTE THE UNDERSCORES!

Press enter and the KVP (Key Value Pair) will appear

Also the pathnode needs to point out from the wall or surface that the player is going to be rappelling down, so in my case I need to click on the 360 button below the Key and Value boxes (if you look down on the pathnode from above ther should be a red arrow pointing out and away from the wall) when you have done this press the N key to close the entity window. Then press the esc key to deselect the pathnode.

 image05

 Now we need to add a trigger. Rightclick in the 2D grid, click on trigger, then click on use.

image06

A red box should appear with the text trigger_use.

image07

This trigger needs to be positioned just in front of the pathnode added previously, so that as the player walks towards the desired rappel or abseil point he will walk through the trigger.

I made mine to stretch the whole width of the roof and 128 units tall so there is no way that the player could approach the rappel or abseil point without passing through the trigger. The base of the trigger should be flush with the surface of the roof.

image08

When you are happy with the position of the trigger and with it still selected press the N key to bring up the entity window. Now type targetname in the Key box and rappel_trigger in the Value box. Press enter.

The entity window should look like the screenshot below.

image09

Press the N key and the entity box should disappear. Press the esc key to deselect the trigger.

The next thing to do is to link the pathnode to the trigger. Select the pathnode first then holding the shift key select the trigger.

image10

With both items selected press the W key. A blue line should appear linking the pathnode to the trigger. This blue line should have an arrow on it pointing from the pathnode towards the trigger. The trigger and pathnode should appear as shown in the screen cap below.

image11

 

Press the esc key to deselect anything that might still be selected.

The third thing I'm going to add is a prefab of a fire hydrant. This is not at all necessary it just adds a touch of realism and makes it look like the player has got something to tie the rope to.

Rightclick anywhere on the 2d, click on misc then click on prefab.

 image12

In the selection box click on the misc_models folder.

image13

Select the com_firehydrant.map and open it.

image14

On my map this needs to be positioned so that the base of the hydrant is flush with the surface of the roof (that's in the Z axis), 48 units in from the outside face of the wall the player is going to rappel or abseil down (that's in the X axis) and inline with the pathnode looking down on the roof from above (that's in the Y axis).

image15

The map is now ready for rappeling or abseiling to be added. That all happens via scripts and csv files so we can save the map and close Radiant.

I’m indebted to sam_fisher3000 for the code which I’ve slightly modified. Okay first off we’ll create the map’s gsc file. If the most basic gsc file looks like this;

main()

{

maps_load::main();

}

then we need to add all the lines in pink as shown here;

 

#include maps_utility;

#include maps_anim;

#include common_scriptsutility;

#include animscriptsutility;

main()

{

maps_load::main();

mapsyourmapname_anim::main();

thread player_rappel();

}

player_rappel()

{

eRope = spawn_anim_model( "rope" );

node = getnode( "player_rappel_node", "targetname" );

rope_glow = spawn_anim_model( "player_rope_obj" );

rope_glow hide();

node thread anim_first_frame_solo( rope_glow, "rappel_for_player" );

rope_glow hide();

model = spawn_anim_model( "player_rig" );

model hide();

node anim_first_frame_solo( model, "rappel" );

rappel_trigger = getent( "rappel_trigger", "targetname" );

rappel_trigger trigger_on();

rappel_trigger sethintstring( &"SCRIPT_PLATFORM_HINTSTR_RAPPEL" );

rappel_trigger waittill( "trigger" );

rope_glow hide();

level.player allowprone( false );

level.player allowcrouch( false );

level.player disableweapons();

model lerp_player_view_to_tag( "tag_player", 0.5, 0.9, 35, 35, 45, 0 );

wait 1;

rope = spawn_anim_model( "player_rope" );

node thread anim_first_frame_solo( rope, "rappel_for_player" );

node thread anim_single_solo( model, "rappel" );

node thread anim_single_solo( rope, "rappel_for_player" );

node waittill( "rappel" );

level.player unlink();

wait 0.5;

rope hide();

level.player enableweapons();

level.player allowprone( true );

level.player allowcrouch( true );

wait 5;

thread player_rappel();

}

For this tutorial I saved my map as yourmapname so the gsc file needs to be saved as yourmapname.gsc.

OBVIOUSLY you’ll need to change “yourmapname” to whatever you call your map wherever “yourmapname” appears in green type. Okay that’s the main GSC file taken care of.

The second thing we’ll do is creat the map animation gsc. Copy the text below and save as yourmapname_anim.gsc.

 

#include maps_anim;

#using_animtree("generic_human");

main()

{

thread player_rappel();

script_models();

}

#using_animtree( "player" );

player_rappel()

{

level.scr_animtree["player_rig"] = #animtree;

level.scr_model["player_rig"] = "viewhands_player_sas_woodland";

level.scr_anim["player_rig"]["rappel"] = %sniper_escape_player_rappel;

}

#using_animtree( "script_model" );

script_models()

{

level.scr_animtree["rope"] = #animtree;

level.scr_model["rope"] = "rope_coil";

level.scr_anim["player_rope"]["rappel_for_player"] = %sniper_escape_player_start_rappelrope100;

level.scr_animtree["player_rope"] = #animtree;

level.scr_model["player_rope"] = "rappelrope100_le";

level.scr_anim[ "rope" ][ "rappel_end" ] = %sniper_escape_rappel_finish_rappelrope100;

level.scr_anim[ "rope" ][ "rappel_start" ] = %blackout_rappel_start_rappelrope100;

level.scr_anim[ "rope" ][ "rappel_idle" ][ 0 ] = %sniper_escape_rappel_idle_rappelrope100;

level.scr_anim[ "player_rope_obj" ][ "rappel_for_player" ] = %sniper_escape_player_start_rappelrope100;

level.scr_animtree[ "player_rope_obj" ] = #animtree;

level.scr_model[ "player_rope_obj" ] = "rope_coil_obj";

}

 

Now we’ll add the things we need to give us the sound effects for rappelling.

The following wav files need to be saved in a folder called “foley” in the Call of Duty 4 - Modern Warfaremainsound directory. If the “foley” folder does not exist you’ll have to create it. I’ve included all the wav files in the attached file.

 

scn_rappel_clipout1.wav

scn_rappel_liftrope_clickin1.wav

scn_rappel_pushoff1.wav

scn_rappel_pushoff2.wav

 

Next We need a sound alias file. Just copy all the text in pink below and save as a PLAIN TEXT FILE called rappel.csv. The “csv” extension is IMPORTANT. It needs to be saved to the Call of Duty 4 - Modern Warfarerawsoundaliases folder. Once again you’ll need to replace the “yourmapname” text in green with the name of your map. This part is easier to do if you can open the csv file in excel and adjust the column widths to fit the entries. That way you can make sure of keeping things aligned. Just make sure to save as a plain csv file when you’ve done. All the commas etc are VITAL!

 

,,"If the first column for a row is blank, then the row is ignored"

,"If the first column for a row is blank, then the row is ignored",

# The first non-comment line of a sound alias file specifies the key name for all values appearing in this column.,,

"# This means it is safe to swap entire columns around, though you should never swap partial columns.",,

"# You can invent new keys, but the game will ignore them if it doesn't know about them.",,

"# You can leave out keys, but the ""name"" and ""file"" keys must always be present.",,

 

,name,name of the alias that is used to play this sound (required)

,sequence,"used to uniquely identify alias entries when more than one sound goes to an alias, used only to catch unwanted duplicates (default = 0)"

,file,the name of the file that contains the sound data (required)

,vol_min,"0 is silent, 1 is full volume (default = 1)"

,vol_max,"0 is silent, 1 is full volume (default = same as vol_min)"

,vol_mod,"blank causes no effect on vol_min and vol_max, otherwise the string must match a string in the volumemodgroups.def file and the value in that file corresponding to that string will be used to adjust vol_min and vol_max, clamped to the valid range"

,pitch_min,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = 1)"

,pitch_max,"1 is normal playback, 2 is twice as fast, 0.5 is half as fast (default = same as pitch_min)"

,dist_min,"within this distance in inches, the sound is always full volume (default = 120)"

,dist_max,"outside this distance in inches, the sound is not started. If left blank or set to 0, the sound will play from any distance. This does not affect sound volume falloff."

,channel,"auto, menu, weapon, voice, item, body, local, music, announcer (default = auto)"

,type,primed (a streamed sound which gets primed on some platforms) / streamed / loaded (default = loaded)

,probability,weight to use for the weighted probability of playing this sound instead of another sound (default = 1)

,loop,"whether this sound is ""looping"" or ""nonlooping"" (default = ""nonlooping"")"

,masterslave,"if ""master"", this is a master sound. If a number, then this sound's volume will be multiplied by that number (a percentage between 0 and 1) any master sound is playing. If blank, then neither master nor slave."

,loadspec,"space-separated list of which maps should use this alias; eg, ""burnville dawnville"". If blank, the alias is used on all maps."

,compression,"a string corresponding to an entry in ""XMAUpdate.tbl"" which is used to determine compression by XMAUpdate.exe"

,secondaryaliasname,"defined the name of an additional sound alias to play in addition to the current alias being played. Note that it is an error for the secondaryalias to also define a secondaryaliasname (eg, if B is a secondaryalias of A, B is not allowed to have its own secondaryalias)."

,volumefalloffcurve,if blank uses the linear curve which can not be changed. A string 'XXXX' corresponds to the curve defined by the file 'soundaliases/XXXX.vfcurve'

,startdelay,defaults to no delay. The value is the number of milliseconds to delay starting the sound by

,speakermap,if blank uses the default speakermappings which cannot be changed. A string 'XXXX' corresponds to the speakermap defined by the file 'soundaliases/XXXX.spkrmap'.

,reverb,"blank means the alias is affected normally by wet and dry levels, ""fulldrylevel"" forces the alias to use a full drylevel (ignoring the global drylevel), ""nowetlevel"" forces the alias to use no wetlevel (ignoring the global wetlevel)"

,lfe percentage,this determines what percentage of the highest calculated spatialized speaker volume should be passed to the LFE. blank means no LFE for the sound

,center percentage,this determines what percentage of the volume should be redirected to the center channel (equal percentage taken from all speakers).

,platform,"used by XMAUpdate to determine whether the alias should be processed for a particular platform. If blank, process for all platforms. Platforms are PC, XB, PS, WI. Multiple values should be separated by spaces. !PC will exclude alias from PC but include in all other platforms. PC will only include alias for PC. !PC XB is invalid."

,envelop_min,any sounds within this distance of the listener will use the full envelop percentage,,,,,,,,,,,,,,,,,,,,,,,,,,,

,envelop_max,sounds between enevlop_min and envelop_max use a fraction of the envelop percentage,,,,,,,,,,,,,,,,,,,,,,,,,,,

,envelop percentage,amount of omnidirectionality to apply,,,,,,,,,,,,,,,,,,,,,,,,,,,

 

name,sequence,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,

masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage,center percentage,platform,envelop_min,envelop_max,envelop percentage,conversion

 

rappel_liftrope_clipin_plr,,foley/scn_rappel_liftrope_clickin1.wav,0.92,0.97,na,1,1,50,5000,local,,,,,yourmapname,,,,,,,,,,,,,,

rappel_pushoff_initial_plr,1,foley/scn_rappel_pushoff1.wav,0.92,0.97,na,0.95,1.05,50,5000,local,,,,,yourmapname,,,,,,,,,,,,,,

rappel_pushoff_initial_plr,2,foley/scn_rappel_pushoff2.wav,0.92,0.97,na,0.95,1.05,50,5000,local,,,,,yourmapname,,,,,,,,,,,,,,

rappel_pushoff_repeat_plr,1,foley/scn_rappel_pushoff1.wav,0.92,0.97,na,0.95,1.05,50,5000,local,,,,,yourmapname,,,,,,,,,,,,,,

rappel_pushoff_repeat_plr,2,foley/scn_rappel_pushoff2.wav,0.92,0.97,na,0.95,1.05,50,5000,local,,,,,yourmapname,,,,,,,,,,,,,,

rappel_clipout_plr,,foley/scn_rappel_clipout1.wav,0.92,0.97,na,1,1,50,5000,local,,,,,yourmapname,,,,,,,,,,,,,,

#END OF FILE,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

#PLEASE ADD SFX REQUESTS HERE,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

 

Right we’re nearly done now. All that’s left is to add the necessary entries to the zone file.

For my basic map the zone file looks like this;

 

ignore,code_post_gfx

ignore,common

col_map_sp,maps/yourmapname.d3dbsp

rawfile,maps/yourmapname.gsc

localize,yourmapname

sound,common,yourmapname,!all_sp

sound,generic,yourmapname,!all_sp

sound,voiceovers,yourmapname,!all_sp

sound,requests,yourmapname,!all_sp

xmodel,viewmodel_base_character

xmodel,viewmodel_base_viewhands

weapon,sp/usp

xmodel,weapon_usp

xmodel,viewmodel_usp

weapon,sp/mp5

xmodel,weapon_mp5

xmodel,viewmodel_mp5

 

After adding the rappelling item to the map we need to add the following lines;

 

rawfile,maps/yourmapname_anim.gsc

rawfile,animtrees/script_model.atr

xanim,sniper_escape_player_rappel

xanim,blackout_rappel_start_rappelrope100

xanim,sniper_escape_player_start_rappelrope100

xanim,sniper_escape_rappel_idle_rappelrope100

xanim,sniper_escape_rappel_finish_rappelrope100

xanim,blackout_bh_evac_player

xmodel,viewhands_player_sas_woodland

xmodel,rappelrope100_le

xmodel,rope_coil_obj

xmodel,rope_coil

sound,rappel,yourmapname,!all_sp

sound,foley/scn_rappel_clipout1.wav

sound,foley/scn_rappel_liftrope_clickin1.wav

sound,foley/scn_rappel_pushoff1.wav

sound,foley/scn_rappel_pushoff2.wav

 

All that’s left to do is compile the map in the usual way and try it out. The modifications I made to sam_fisher3000’s code allow the player to rappel off the building then go back to the roof and rapell again as many times as you like. Also when the player gets to the ground I made it so that it looks like he pulls the rope down after him. I’ll be posting a video on Youtube showing the Radiant part of this tutorial. As soon as I’ve got it uploaded, I’ll post the URL at the foot of this tutorial as soon as I know what it is. The video also shows what the finished map looks like with the rappelling stuff added. I’ve also attached a rar file with my basic map, finished map, the gsc files, zone files, csv files and sound files to this tutorial.

I hope you find this tutorial useful and informative. Have fun, and good modding.

 

Here's a link to a rar file containing this tutorial as a PDF and word doc. It also contains my map files, gsc files, zone files and wav files;

http://www.mediafire.com/file/g68oqgmblsmwe31/myraptut.rar 

 

 

 

 

 

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»