Call of Duty 4: SP - Adding Dogs

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
How to get dogs working in the Single player Game.

By Techno2sl


You will need:

  1. A playable map in radiant (preferrably a closed skybox with no leaks and worldspawn settings).
  2. An "info_player_start" (right click the 2d grid and slect info>player_start, place this spawn point a few units off the ground and not touching/passing through anything)


Ok, so right click the 2d grid, select "actor>enemy>dog". Place the dog anywhere you want so long as its not touching/passing through anything. (place as many as you want theres probably a limit on how many can be alive at once but I havent found that yet (32?))

Place some path nodes down (right click the 2d grid and select "node>path_node"), space them out abit, you dont need to many in open areas but for doorways etc its best to place a node either side of the door and 1 inside the doorway (to help the dogs negotiate) make sure the nodes dont touch each other though).

//Spawner//Skip this bit if your dont want your dog to be a spawner

This is not nessaccary for a simple test, but if you want your dogs to spawn instead of being spawned as soon as the level starts: Make a trigger, using the trigger texture and make that trigger a trigger_multiple. Then select the trigger and make it a "trigger_spawner". (highlight the trigger and press "N") Select any dogs, and make them "spawners". (highlight 1 dog at a time and select spawner)

With 1 trigger selected, highlight a dog and press "W".

So the link is: |Trigger|>>|dog|

//// Spawners wont fucntion correctly sometimes//Always check the zone source and developer load your map and check the console ////


Now compile your level, and edit your zone_source ("Update Zone_source"). If you dont have one yet, click "build fast file" to create a defualt one.

Now in the zone file include this:

ignore,code_post_gfx
ignore,common
col_map_sp,maps/MAPNAME.d3dbsp
rawfile,maps/MAPNAME.gsc
localize,test3
sound,common,MAPNAME,!all_sp
sound,generic,MAPNAME,!all_sp
sound,voiceovers,MAPNAME,!all_sp
sound,requests,MAPNAME,!all_sp
rawfile,animscripts/dog_combat.gsc
rawfile,animscripts/dog_death.gsc
rawfile,animscripts/dog_init.gsc
rawfile,animscripts/dog_pain.gsc
rawfile,animscripts/dog_move.gsc
rawfile,animscripts/dog_scripted.gsc
rawfile,animscripts/dog_stop.gsc
rawfile,animscripts/dog_flashed.gsc
xanim,ai_attacked_german_shepherd_05_death_a
xanim,ai_attacked_german_shepherd_04_getup_a
xanim,ai_attacked_german_shepherd_04_middle_a
xanim,ai_attacked_german_shepherd_03_shoot_a
xanim,ai_attacked_german_shepherd_03_push_a
xanim,ai_attacked_german_shepherd_02_getup_a
xanim,ai_attacked_german_shepherd_02_idle_a
xanim,ai_attacked_german_shepherd_01_start_a
xanim,german_shepherd_player_neck_miss
xanim,german_shepherd_player_neck_snap
xanim,german_shepherd_walk
xanim,german_shepherd_traverse_up_80
xanim,german_shepherd_traverse_up_40
xanim,german_shepherd_traverse_down_40
xanim,german_shepherd_attack_player_miss_turnl
xanim,german_shepherd_attack_player_miss_turnr
xanim,german_shepherd_attack_ai_05_kill_a
xanim,german_shepherd_attack_ai_04_middle_a
xanim,german_shepherd_attack_ai_03_shot_a
xanim,german_shepherd_attack_ai_03_pushed_a
xanim,german_shepherd_attack_ai_02_idle_a
xanim,german_shepherd_attack_ai_01_start_a
xanim,german_shepherd_run_flashbang
xanim,german_shepherd_run_stop
xanim,german_shepherd_run_pain
xanim,german_shepherd_run_jump_window_40
xanim,german_shepherd_run_jump_40
xanim,german_shepherd_run_attack
xanim,german_shepherd_attack_player_miss
xanim,german_shepherd_run_lean_r
xanim,german_shepherd_run_lean_l
xanim,german_shepherd_run
xanim,german_shepherd_run_start
xanim,german_shepherd_attackidle_growl
xanim,german_shepherd_attackidle_bark
xanim,german_shepherd_attackidle
xanim,german_shepherd_idle
xanim,german_shepherd_death_front
xanim,german_shepherd_attack_player_late
xanim,german_shepherd_attack_player
xanim,german_shepherd_attack_look_up
xanim,german_shepherd_look_up
xanim,german_shepherd_attack_look_left
xanim,german_shepherd_look_left
xanim,german_shepherd_attack_look_right
xanim,german_shepherd_look_right
xanim,german_shepherd_attack_look_down
xanim,german_shepherd_look_down
xanim,void_loop
xanim,player_view_dog_knockdown_neck_miss
xanim,player_view_dog_knockdown_neck_snap
xanim,player_view_dog_knockdown_saved
xanim,player_view_dog_knockdown_late
xanim,player_view_dog_knockdown
weapon,sp/mp5
xmodel,weapon_mp5
xmodel,viewmodel_mp5
sound,ru_battlechatter,mapname,all_sp
sound,uk_battlechatter,mapname,all_sp
xmodel,viewmodel_base_character
xmodel,viewmodel_base_viewhands
fx,impacts/deathfx_dogbite
fx,impacts/deathfx_bloodpool_view
material,hud_dog_melee
xmodel,viewhands_player_sas_woodland 

(rename the "MAPNAME" to your maps name)

As you can see the zone file is loading an mp5 (weapon,sp/mp5) as its the default weapon when you dont have a weapons loadout. Its loading the animations for the dogs, and its loading the death/melee attack stuff (fx,impacts/deathfx_dogbite fx,impacts/deathfx_bloodpool_view) which is very important otherwise when the dog bites you and trys to throw you on the ground the game will freeze.

You need a basic script file: (located in the "maps" folder this should be called: MAPNAME.gsc)

#include maps_utility;
#include maps_anim;
#include common_scriptsutility;
#using_animtree( "generic_human" );

main()
{
  maps\_load::main();
  maps\_load::set_player_viewhand_model("viewhands_player_sas_woodland");
}


Just one last step, if you havent done so before you need to add some SP scripts to your "raw" folder wich were left out by the devs:

http://www.novemberdobby.com/files/rips/4rip.zip

(Thanks to NovemberDobby)


Install by unzipping the SP scripts (all of them) into your "raw" folder. Build the fast file for your map again and then Click run map.

Make sure to check the 'animscripts' folder is successfully inside the faw folder, as animscripts contains the dog scripts.

Errors// Run the map normally without developer and without any custom command lines added when first testing.

error// Script compile error #? utility? IF you get a compile error stating the utility script has a missing "#"

Go to your raw/maps folder and locate the _colors.gsc

Change the begining line from "include maps_utility;" to "#include maps_utility;"


Sources: Modsonline.com