Tutorial written by Ace008. Mirrored here for archival purposes.
Door Kick Tutorial
Door Kick Tutorial by Ace008
Alright lets get started
Step 1: Create a node_scripted and give it a targetname:
Value:targetname
Key:door_node
Step 2: Create an actor of your choosing and give him a targetname:
Value:targetname
Key:doorkicker
Step 3: Create your door, which the actor will kick, and turn it into a script_brushmodel. To do this while the door is selected right click in your grid and look for something called script. Inside that you will see script_brushmodel, which you will click. The door will turn blue on the grid to let you know it is now a script_brushmodel.
** NOTE: When you make the first door, add a origin brush that has the same targetname with it. Without this the door moves way to quick and looks unrealistic.
Now give the door a targetname:
Value:targetname
Key:door
Also while the door is selected press N and put a check in the box that says DynamicPath.
Step 4: Create another door the same size as the first with the same texture of course and turn it into a script_brushmodel. This door is where the first door will swing to after the actor kicks it so place it where you want the door to end up.
Step 5: Now select the first door and then the second door and press W to connect them. You will see a blue line indicating they are connected.
Step 6: Draw out a brush and make it a trigger_once. To do this right click in your grid and under trigger there will be something called once. Now give it a targetname:
Value:targetname
Key:door_trig
Step 7: This is the last part for mapping! Place the scripted node about 10 units away from the door so it looks like the actor is actually kicking it. If it is any farther away it looks kinda odd. Also make sure the node is facing towards the door . To do this on top there is a button that has a Z with an arrow to N(The 8th button on the row) click that and an arrow will appear from the node. Make sure that arrow is pointing towards the door so the actor kicks in the correct direction.
////////////////////
Okay now the feared part, the part everyone hates...Scripting WUHAAAAA.
Step 1: Create a GSC file called mymapname.gsc and copy this code into it:
#include maps\_utility;
#include maps\_anim;
main()
{
maps\_load::main();
mapsmymapname_anim::main();
level.player takeallweapons();
level.player giveWeapon ("enfield");
level.player switchToWeapon ("enfield");
thread kick_door();
}
kick_door()
{
door_node = getnode ("door_node", "targetname");
doortrig = getent("door_trig","targetname");
doortrig waittill("trigger",other);
level.doorkicker = getent("doorkicker","targetname");
level.doorkicker.animname = "doorkicker";
level.doorkicker.anim_node = door_node;
level.doorkicker notify ("stop friendly think");
level.doorkicker thread magic_bullet_shield();
level.doorkicker.ignoreme = true;
level maps\_anim::anim_reach_solo (level.doorkicker, "kickdoor", undefined, door_node);
level.doorkicker pushPlayer (false);
door_node thread maps\_anim::anim_single_solo (level.doorkicker, "kickdoor");
level.doorkicker waittillmatch ("single anim", "soundfx = kickdoor");
door = getent ("door", "targetname");
door playsound ("kickdoor");
door rotateyaw(90,.5,.2,.2);
door connectpaths();
level.doorkicker notify ("stop magic bullet shield");
level.doorkicker.ignoreme = false;
}
Step 2: Now make another gsc fille and call it mymapname_anim.gsc and copy this code into it:
#using_animtree("generic_human");
main()
{
//animations
level.scr_anim["doorkicker"]["kickdoor"] = (%kickdoor_guy2);
}
Thats it for scripting, aren't you happy!
//////////////////////
Okay Now for the Sound in your COD2 main folder create a folder called Soundaliases. Inside that create
a new text document and place this code into it:
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
#door,,,,,,,,,,,,,,,,,,,,,,,
kickdoor,1,doors/door_wd_kick.wav,0.92,0.92,foley,0.9,0.9,350,2000,auto,,,,,mymapname,,,
*note: that first line of code is all one line.
Save this as mymapname.csv and you are all done.
Now go compile and admire your work!