Dark Zer0s Call of Duty 2 Mapping Tuts
Adding models to Call of Duty 2 MP
or SP.
1.
Open up your Call of Duty 2/main folder.
2. Find the iw_13.iwd file in your main folder.
3. Open iw_13.iwd with Pakscape/ Winrar and extract the xmodel folder to your Call
of Duty 2/main folder.
4. The path of your xmodel folder should now be...Call of Duty 2/main/xmodel.
5. Open up radiant.
6. In the 2d view right click and Select misc>model. A browse to file menu
should open. Select the model you wish and click ok.
7. The model should now appear in radiant, and when you compile your map your
model should work.
Making
an MP loading screen
What you need;
CoD2 Modding Tools
DDS Plugin for Photoshop, can be found here.
Step 1
Create an images
folder in your Call of Duty 2 directory, NOT YOUR MAIN directory. It is very
important that is it all lower case, you should end up with this if you
installed in the default path. C:\Program Files\Activision\Call of Duty
2\images
Step 2
Take your picture or screenshot that you wish to make into your loading screen,
resize it to 1024x1024 and resolution must be set to 72.
Once that is set, save your file as loadingscreen_ (name of map here).dss. For
example, my map is "mp_nzo" so I had to save my file as
loadingscreen_mp_nzo.dss
Save as *DSS file, DXT5 ARGB
2D Texture NO MIPMAPS.
Place that file in your C:\Program Files\Activision\Call of Duty 2\images
folder you created in step 1.
Step 3
Open up your asset_manager.exe
which should be in your bin folder where the codradiant.exe is located.
1) Click on new entry
2) under name, name it the same as you named your *dds file. Without the extension. So in
my case, loadingscreen_mp_nzo
3) in the scroll menu under the buttons "new entry" etc.. locate and select materials
4)Material Type MUST be set to 2D, sort set to default, surface type set to
<none> and usage set to <not in editor>. blendfunc must be replace,
cullface must be to back, polygonoffset set to none, alphatest set to always,
depth test set to lessequal and finally depthwrite set to <auto>
Color map; here you click on the browse button and
select your *dds file from the images folder you created. Set the tile option
to NO TILE, then <auto filter> and IT MUST be set to DXT5. make sure nopicmip is unchecked.
lost? heres
a screenshot.. simply mimic the options you see just
replace the name of the file so it fits into your map.
5) Now its time to save your work, File-> Save As. save it the same as
everything else, loadscreen_mp_nzo.gdt . or whatever your map name is.
6) The conversion. Now that everything is saved and ready to go, Select the PC Convert menu and click Convert Asset
Only, or simply hit F10.
The Final Step
Everything has been converted. You will find your new
*iwi file (image file) in your call of duty 2\main\images and the materials
file you will need in the call of duty 2\main\materials .
The last file you will need is a *csv file. simply
make a text file and name it the same as your map. In this case, it has to be
named mp_nzo.txt. Include this code.
levelBriefing,loadscreen_mp_nzo
Save it and change the name to mp_nzo.csv and place it in your main\maps\mp
folder. where your *bsp and
*gsc file is located.
Change the name to fit the name of your map, and you're done. All you have to
do next is just include all these files with their proper folder in your *iwd
file.
Adding SP battle chatter
to AI
1) Make a brush
2) Right Click> Trigger> Multiple
3) Textures> Usuage> Tools
4) Apply BCS texture
5) Open Entity Window (N Key)
6) Key/Values are
Code:
For the script_location, I've been digging around looking for the ENTIRE list
of locations, so I asked [IW] if they could tell us where the full list was, or
if anyone here knows, please let us all know where we can find it.
But some examples are "church" "secondfloor"
"firstfloor". You can find more on the prefabs that use BCS textures.
Making AI use a MG42
Ok
gonna talk through setting up ai
to use an mg42. This tutorial is aimed at sp begginers
and is very easy to do.
Ok so lets make a start... Right click and do misc
--> turret. Then have a key of model with the value of xmodel/weapon_mg42.
Then insert weaponinfo as the key and the value as
mg42_bipod_stand. The on the entity window u will see some more options like
arcs which is how far the mg42 can be turned in that direction. use wot u like and then place the
gun on wotever u want.
Now make a pathnode, the pink 1s. put
this about 8 units behind the gun.
Now make an actor
**** THIS PART FOR SPAWNING THE ACTOR ONLY *****
Tick spawner and forcespawn
and then make a trigger were u want it, make it into a trigger mulltiple and then add the spawn AI trigger to it.
*******************************************
Now connect IN THIS ORDER the trigger (if u have 1) to
the actor, then the actor to the pathnode and finally
the pathnode to the mg42.
**ADDITION** If you would like a situation of once the gunner dies some1 else
spawns to use the gun then follow this next bit.
On the trigger enter key targetname and a value of flood and secure. then on the actor and a count of hw ever many ai u want to ever spawn from this actor, for example 3.
**********************
You can also use other features like :
key = script_additive_delay // Additive delay is the
# of seconds extra a flood_spawner will wait for each
additional spawning. Defaults to 1 second.
script_killspawner // When you go through a trigger
with this on it, any spawners that have the same #
will be deleted.
Making Interactable
Objects
This
tutorial covers _interactable_objects.gsc.It also assumes you have extracted
the xmodels folder from iw_13.iwd to your Main directory/folder.
What are interactable objects? They are things like the exploding barrels, wine
bottles, vases, crates, plates ,helmets ,and tincans.
So on with the tutorial.
Object: Exploding Barrels
Method 1: Load the prefab
Rightclick in the 2D view and select misc>prefab.
The open dialogue box opens,then select
prefabs/interactable_objects/benzin.map
Prefabs choices are,
benzin.map
benzin_snow.map
prop_barrel_benzin.map
prop_barrel_benzin_snow.map
Method 2:Create a script_model
Rightclick in the 2D view and select script>model.
The open dialogue box opens,then select the xmodel.
Script model choices are,
xmodel/prop_barrel_benzin
xmodel/prop_barrel_benzin_snow
Next give the script_model a targetname
or a script_noteworthy
of explodable_barrel.
You can also set the radius for the damage.
Key:radius Value:350 (if this key is not set the
default is 250)
Object: Tin Can
Theres no prefab for this one.
So rightclick in the 2D view and select script>model.
The open dialogue box opens,then select the
xmodel/prop_tincan.
Give the script_model a targetname
of tincan.
Object: Helmet
Theres no prefab for this one.
But there are two types,of interactions.One is the helmet pop,which
when shot makes the helmet jump.The other is shutter,which when shot makes the helmet wobble.
Method: Helmet Pop
Rightclick in the 2D view and select script>model.
The open dialogue box opens,then select the
xmodel/prop_helmet_german_normandy.
Give the script_model a targetname
of helmet_pop.
Method: Shuttering
Rightclick in the 2D view and select script>model.
The open dialogue box opens,then select the
xmodel/prop_helmet_german_normandy.
Give the script_model a targetname
of shuddering_entity.
Object: Breakable Boxs
Method 1: Load the prefab
Rightclick in the 2D view and select misc>prefab.
The open dialogue box opens,then select
prefabs/interactable_objects/prop_crate_dak1.map
Prefabs choices are,
prop_crate_dak1.map
prop_crate_dak2.map
prop_crate_dak3.map
prop_crate_dak4.map
prop_crate_dak5.map
prop_crate_dak6.map
prop_crate_dak7.map
prop_crate_dak8.map
prop_crate_dak9.map
Method 2: Create a script_model
Rightclick in the 2D view and select script>model.
The open dialogue box opens,then select the xmodel.
Script model choices are,
xmodel/prop_crate_dak1
xmodel/prop_crate_dak2
xmodel/prop_crate_dak3
xmodel/prop_crate_dak4
xmodel/prop_crate_dak5
xmodel/prop_crate_dak6
xmodel/prop_crate_dak7
xmodel/prop_crate_dak8
xmodel/prop_crate_dak9
Next give the script_model a targetname
or a script_noteworthy
of breakable box.
Object: Wine Bottle
Theres no prefab for this one.
So rightclick in the 2D view and select script>model.
The open dialogue box opens,then select the
xmodel/prop_winebottle_breakable.
Give the script_model a targetname
of breakable.
Object: Vase
Method 1: Load the prefab
Rightclick in the 2D view and select misc>prefab.
The open dialogue box opens,then select
prefabs/interactable_objects/egypt_prop_vase1.map
This is the only prefab,the other xmodels can be done
with script models.
Method 2: Create a script_model
Rightclick in the 2D view and select script>model.
The open dialogue box opens,then select the xmodel.
Script model choices are,
xmodel/egypt_prop_vase1
xmodel/egypt_prop_vase3
xmodel/egypt_prop_vase4
These are given a type of orange vase
xmodel/egypt_prop_vase2
xmodel/egypt_prop_vase5
xmodel/egypt_prop_vase6
These are given a type of green vase
The type is done by _interactable_objects.gsc and
just loads different effects for the xmodels.You
don't give the script_models a type the script does
that for you.
You just give the script_model a targetname
of breakable_vase.
Object: Plates
Theres no prefabs for these ones.
Method: Create a script_model
Rightclick in the 2D view and select script>model.
The open dialogue box opens,then select the xmodel.
Script model choices are,
xmodel/prop_diningplate_roundfloral
xmodel/prop_diningplate_roundplain
xmodel/prop_diningplate_roundstack
xmodel/prop_diningplate_ovalfloral
xmodel/prop_diningplate_ovalplain
xmodel/prop_diningplate_ovalstack
Give the script_model a targetname
of breakable.
Thats it for the mapping
part.
Now the scripting part.
To get the interactable objects to work you need a GSC file for your SP map.The GSC goes in the maps directory/folder with your
d3dbsp file.The GSC has the same name as your map,
mymapname.d3dbsp and mymapname.gsc.
So what does the script look like,well maps\_load::main(); automaticly loads _interactable_objects::main(); for you.So
as long as you have that line, maps\_load::main();
,in your GSC it will work.
Example:
main()
{
maps\_load::main();
}
Making SP Fire and Smoke
effects
This
is in respect to Single Player... I'm not sure how it's done in Multiplayer but
I'm sure it's not too different.
*******************************************
What is Loopfx:
Loops an effect with a waittime.
What are the Parameters: loopfx( effectname, (x y z), delay_between_shots);
*******************************************
MAPNAME.GSC
Code:
MAPNAME_FX.GSC
Code:
List of level._effect["___?____"] = loadfx
("fx/fire/____?____.efx");
values you can use for fire:
armoredcar_fire_turret_large
building_fire_distant
building_fire_large
building_fire_med
building_fire_small
cargoship_fire
character_arm_fire
character_torso_fire
crusader_fire_turret_large
fire_airplane_emitter
fire_airplane_trail
fire_smoke_trail
fireheavysmoke
flame_small_em
ground_fire_med
ground_fire_med_nosmoke
ground_fire_small_oneshot
halftrack_fire
higgens_fire
med_oil_fire
meteor_shower
meteor_trail
nebelwerfer_trail
panzer2_fire_turret_small
rocket_launch
sherman_fire_turret_large
tank_fire_engine
tank_fire_libya_distant
tank_fire_night_distant
tank_fire_turret_large
tank_fire_turret_small
thermite_grenade
tiger_fire_turret_large
List of level._effect["____?____"] = loadfx
("fx/smoke/____?____.efx);
values you can use for smoke:
battlefield_smokebank_S
black_smoke_ball
credits_smoke_shield
damaged_vehicle_smoke
dark_smoke_trail
drifting
emitter_panzerfaust
emitter_panzerschreck
flare
green_smoke_40sec_duhoc
grenade_smoke
grenade_smoke_night
large_smoke_plume
orange_smoke_20sec
orange_smoke_40sec
orange_smoke_grenade
smoke_grenade_duhoc_40sec
smoke_panzerfaust
smoke_panzerscrheck
smoke_panzerscrheck_view
smoke_plumeBG
smoke_plumeBG_toujane
smoke_trail_mortar
thin_black_smoke_M
thin_black_smoke_M_duhoc
thin_black_smoke_S
thin_light_smoke_L
thin_light_smoke_L_duhoc
thin_light_smoke_M
thin_light_smoke_M_duhoc
thin_light_smoke_S
vehicle_steam
Adding rain to SP map
Simplified the
rain code so all you have to do is just change the RainLevel
value between integers 0-10 with 10 being hard rain.
MAPNAME.GSC
Code:
#include maps\_utility;
#include maps\_anim;
#using_animtree("generic_human");
main()
{
maps\_load::main();
maps\MAPNAME_fx::main();
}
MAPNAME_fx.GSC
Code:
#include maps\_utility;
main()
{
// Rain
level._effect["rain_heavy_cloudtype"] =
loadfx ("fx/misc/rain_heavy_cloudtype.efx");
level._effect["rain_10"] = loadfx
("fx/misc/rain_heavy.efx");
level._effect["rain_9"] = loadfx ("fx/misc/rain_9.efx");
level._effect["rain_8"] = loadfx ("fx/misc/rain_8.efx");
level._effect["rain_7"] = loadfx ("fx/misc/rain_7.efx");
level._effect["rain_6"] = loadfx ("fx/misc/rain_6.efx");
level._effect["rain_5"] = loadfx ("fx/misc/rain_5.efx");
level._effect["rain_4"] = loadfx ("fx/misc/rain_4.efx");
level._effect["rain_3"] = loadfx ("fx/misc/rain_3.efx");
level._effect["rain_2"] = loadfx ("fx/misc/rain_2.efx");
level._effect["rain_1"] = loadfx ("fx/misc/rain_1.efx");
level._effect["rain_0"] = loadfx ("fx/misc/rain_0.efx");
thread rainControl(); // level specific rain settings.
thread playerWeather(); // make the actual rain effect generate
around the player
}
rainControl()
{
level.rainLevel
= 10; // rain level
level._effect["rain_drops"] = level._effect["rain_"
+ level.rainLevel];
}
playerWeather()
{
player
= getent("player","classname");
for
(;;)
{
playfx ( level._effect["rain_drops"], player.origin
+ (0,0,650), player.origin + (0,0,680) );
if (level.rainLevel >= 8)
playfx ( level._effect["rain_heavy_cloudtype"], player.origin
+ (0,0,650));
wait (0.3);
}
}
Making exploadable barrels
First off, let
me thank all the folks here at modsonline.com that helped develop this script,
especially sentchy. you're
help was really appreciated.
secondly, I absolutly have
no clue how this has been done in the past, nor how IW did it for SP. this idea
spawned from my balding head.
actually that's not totally true ... IW probably used
exploders, which don't requires scripting. my way does
need scripting but since I give you that and the prefab it should real easy. here we go.
HOW DOES IT WORK ?
when a player "injures" the barrel, it
accumulates the damage taken. if the damage is higher
than 80, the barrel catch fire and start to injure itself. when
the damage reaches 200, either by itself, more shooting by players or by other
barrels exploding near it, it'll first make a sound signaling
imminent explosion, and then explode injuring every player, and other barrels,
near it. after a waiting period of 2 minutes, the
barrel will respawn.
if any of this doesn't exactly suits your need, feel
free to modify the code.
RADIANT WORK
(here's the LINK for the barrel prefab if you don't feel
like making your own)
- start a new .map, this will become the barrel prefab, so save accordingly in
the map_source/prefabs folder.
- make a script_model with the xmodel of any barrel you wish to use. do not give it a targetname.
- make a trigger_damage that surrounds the barrel
closely. tick the box "MELEE_NO" so it
doesn't work by bashing the barrel (obviously). enter
the following value :
"targetname" "barrel_trig"
- select the trigger first then the barrel. press 'w'
(to merge entities). if you've done it correctly, the
barrel will have "auto1" has a targetname and the trigger will have
"auto1" has a target. you will also see a
red line in 3d window indicating that the targetting
works correctly.
- make a script_brushmodel out of a clip brush that
surrounds the barrel (same size of the trigger) and an origin brush that has
its origin coincide with the origin of the script_model (the blue box at the bottow). this is to prevent player to walk thought the barrel. similarly to the trigger, enter the following value :
"targetname" "barrel_clip"
- exactly like the trigger select the brushmodel
first (alt+shift) and then the barrel. press 'w'. the brushmodel
now targets the barrel just like the trigger does.
- save that .map. whenever
you want a barrel in your map, insert this prefab in. (r-click 2d window -
misc/prefab)
and that's it for radiant. copy as many barrel prefabs
as you wish. try putting them close to each other for
cool effects.
OTHER NOTES
script_model creation :
right-click 2d window. script/model, enter the xmodel
wanted and locate it where wanted
trigger_damage creation :
right-click 2d window. trigger/damage and give it the
dimensions wanted (like any normal brush) and locate it where wanted
script_brushmodel creation :
create the brushes you want for this entity. every script_brushmodel needs an origin brush, find that texture
in the tools submenu. selection all brushes, including
the origin one. right-click 2d window. script/brushmodel. locate it where wanted. shift+alt+left-click to selection the whole entity. shift+left-click to selection only
one brush of the entity.
adding values to entities:
simply press 'n' when you have the entity selected.
SCRIPTING
I've made it easy for you guys.
create a new text folder called barrels.gsc
and put it in maps/mp. put the following code in it :
barrelInit()
{
level._effect["barrel_fire"]
= loadfx ("fx/fire/tank_fire_engine.efx");
level._effect["barrel_explosion"]
= loadfx("fx/explosions/ammo_supply_exp.efx");
precacheModel("xmodel/prop_barrel_black");
barrel_trig = getentarray("barrel_trig", "targetname");
barrel_clip = getentarray("barrel_clip", "targetname");
//grab corresponding entities
for( k = 0 ; k < barrel_trig.size
; k++ ) {
barrel1 = getent(barrel_trig[k].target, "targetname");
barrel1.trig = barrel_trig[k];
level.barrels[k] = barrel1;
}
for( k = 0 ; k < barrel_clip.size
; k++ ) {
barrel2 = getent(barrel_clip[k].target, "targetname");
barrel2.clip = barrel_clip[k];
}
//records the name and state, then launch
a thread for each barrel
for( k = 0 ; k < level.barrels.size
; k++ ) {
level.barrels[k].name = "barrel ^" + k + "#"
+ k;
level.barrels[k].exploded = false;
level.barrels[k].soundOrigin = spawn("script_origin", level.barrels[k].origin);
level.barrels[k] thread barrelThink();
}
}
barrelThink()
{
if (self.exploded
== true)
wait(120);
self entityOn();
self.trig entityOn();
self.clip entityOn();
self.accDamage = 0;
self.onfire = false;
self.exploded = false;
while(isdefined
(self))
{
self.trig waittill("damage",
amount);
self.accDamage = self.accDamage +
amount;
//iprintlnbold(self.name + " 's damage = " + self.accDamage);
if (self.exploded
!= true)
{
if (self.accDamage
> 80 && self.onfire != true) //catch fire
{
self.onfire = true;
self thread barrelFire();
//fire start
self thread barrelFireDamage();
//self injury start
}
if (self.accDamage
> 80 && self.onfire == true)
{
//nothing
}
if (self.accDamage
> 200) //explosion
{
self.onfire = false;
self.exploded = true;
self.soundOrigin playsound("barrel_explosion_imminent");
wait(4); //lenght
of sound file
self thread barrelExplode();
self.trig entityOff();
self.clip entityOff();
self entityOff();
self barrelThink();
break;
}
} else //(self.exploded
== true)
break;
}
}
//injures itself until exploded. only one
thread per barrel
barrelFireDamage()
{
while (self.exploded
!= true)
{
self.trig notify ("damage", 10);
wait(randomint(2)+1);
}
}
//play the fx.
only one thread of it should exist per barrel
barrelFire()
{
while(self.exploded
!= true) //keeps playing the effect until exploded
{
self.soundOrigin playsound("barrel_fire");
playfx(level._effect["barrel_fire"], self.origin +
(0,0,32));
radiusDamage(self.origin + (0,0,12),
75, 10, 0);
wait(2);
}
}
barrelExplode()
{
//inflict damage to adjacent barrels,
linearly wrt distance
for (k = 0; k < level.barrels.size;
k++)
{
if ( level.barrels[k].exploded
!= true && level.barrels[k] != self)
{
dist = distance(level.barrels[k].origin,
self.origin);
if (dist < 100 && dist != 0)
level.barrels[k].trig notify("damage",
((1-(dist/100))*100)+100); // between 100 and 200 of damage
}
}
self.soundOrigin playsound("barrel_explosion");
playfx(level._effect["barrel_explosion"], self.origin);
//give lots of damage around self
radiusDamage(self.origin + (0,0,12),
400, 200, 30);
//self.trig
notify ("damage", 5); //final blow
}
//barrel spawning functions. it just moves them away and back.
entityOff()
{
if (!isdefined (self.realOrigin))
self.realOrigin = self.origin;
if (self.origin
== self.realorigin)
self.origin += (0, 0, -10000);
}
entityOn()
{
if (isDefined (self.realOrigin) )
self.origin = self.realOrigin;
}
now you need to kick this thread off by adding the following line to
your mp_mapname.gsc :
maps\mp\barrels::barrelInit();
at the location specified below :
main()
{
maps\mp\mp_mapname_fx::main();
//if you have one
maps\mp\barrels::barrelInit();
maps\mp\_load::main();
//...
}
finally you
need to add the lines to the soundaliases files in
order for the sound to work :
barrel_explosion,,explosions/exp_armoredcar.wav,0.8,1,,,,50,1000,local,streamed,,,,mp_mapname,,,,,,,,
barrel_explosion_imminent,,misc/metal_stress01.wav,0.6,1,,,,50,500,local,streamed,,,,mp_mapname,,,,,,,,
barrel_fire,,fire/Fire_Sm_loop01.wav,0.01,1,,,,50,400,auto,streamed,,,,mp_mapname,,,,,,,,
and that's it !! enjoy. feel
free to ask me any questions you might have in the forums. also
go in the forums to know how to change specific stuff, like respawing
time.
Making realistic mortar holes
Ok
so first off we need to create the land and mortar whole in radiant
So step 1: create a brush thats 500 x 500 units wide
Step2: we now need to turn the brush into terrain, so select the brush and go
to Patch/Simple Terrain Patch. And give it a density of 10 x 10, then give it a
texture, i used grass
Step3: Now we need to make the terrain a whole, so start of by setting up the
terrain editor, Press Y and give it the options on the picture below
Ok now u need to hover ur mouse over the terrain,
hold alt and right click on ur terrain, with the
buttons heald down move ur
mouse a but to make the terrain go down. u dont need the terrain to go down to far because we make the
whole deeper on the next setting.
Now u have done that, give
This is how my whole turned out, it did'nt look as
good as i wanted it to, but if u play around with the
settings u can make it look really nice.
Step 5: Ok now we have our whole we need to add a realistic looking decal. So
start off by copying and pasting
Then once its done u need to add a decal texture, i
use:
- Textures/Surface Ttype/Dirt/egypt_roughdirt_crater_night
Now once ur texture is applyed
u need to fit it, so press S to bring up the Surface Inspector and press Fit.
It should look somthing like this
Step 6: Now we need to turn the crater into a brushmodel,
So press escape to de select any peices of terrain u
got selected and then select the craters both peices
of terrain.
Now right click and go script/brushmodel
Then all u gotta do now is give them a targetname of botlayer
Step 6: Ok now create some terrain around the outside of ur
mortar hole
Step 7: Now u need to cover up the motar hole, so
create a peice of terrain and place it over the
whole. Then make it a brush model, right click/brushmodel
Now all u gotta do is give it a targetname of toplayer
Step 8: Right click and go Script/ Script origin, then place the origin in the center of ur mortar hole, and
give it a targetname of action
Step 9: Now for the trigger, start of by creating a big brush around the
outside of ur hole and giving it the trigger texture
which is located in textures/tools
Once thats done, with the trigger selected right
click and go to Trigger/Once
Then give the trigger a targetname of morttrig
Ok thats it for the mapping, just make sure u have
the standard things to run a map: skybox, dm spawn, global intermission
Save ur map and now onto the scripting.
Ok So first off u need a mapname.gsc
to call on the script
Place this file in
Put this code in into
main()
{
maps\mp\ground_mortars::main();
maps\mp\_load::main();
setExpFog(0.0009, 0.30, 0.31, 0.34, 0);
game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";
setCvar("r_glowbloomintensity0",
".25");
setCvar("r_glowbloomintensity1",
".25");
setcvar("r_glowskybleedintensity0","3");
}
Now create a file called ground_mortars.gsc and place
it into
Put this code in the ground_mortars.gsc
main()
{
level._effect["mortexplosion"]
= loadfx("fx/explosions/artilleryExp_dirt_brown.efx");
thread mortar1();
}
mortar1()
{
action = getent ("action","targetname");
botground = getent ("botlayer","targetname");
topground = getent ("toplayer","targetname");
trigger = getent ("morttrig","targetname");
botground hide();
trigger waittill ("trigger");
origin = action getorigin();
action playsound("incoming_mortar");
wait (1);
action playsound("explosion_ground");
playfx(level._effect["mortexplosion"], origin);
botground show();
topground delete();
}
Now all u gotta do is add a mapname.csv file
Place this file into
Heres the code to place in
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 #ambients,,,,,,,,,,,,,,,
incoming_mortar,,Explosions/artillery_incoming01.wav,1,1,,1,1,5000,6000,auto,streamed,,,,mp_mortar_map,,,,
explosion_ground,,Explosions/Mortar_dirt01.wav,1,1,,1,1,5000,6000,auto,streamed,,,,mp_mortar_map,,,,
Make a SP AI jump out of a trench
We will do this with inserting a prefab.
This prefab you can find in this directory:
C:\Program Files\Activision\Call of Duty 2\map_source\prefabs\traverse.
It is called trench_jumpout.map
This prefab includes:
node_negotiation_begin
script_origin
node_negotiation_end
Create your trench in Radient.
There are tutorials about that.
Make sure to give it 52 units in height.
In your 2d view window right click and browse to the directory i have mentioned above
and insert the trench_jumpout.map
In your side view you will see the prefab and your trench.
Notice the hight of your trench and of your prefab
are lining up.
So both 52 units.
In the top view you will see the
node_negotiation_begin:
script_origin:
node_negotiation_end:
this is from left to right.
Your animscript trench_jump_out
is already included in this prefab.
Leave the prefab as it is.
You dont have to give it any values.
The only thing for you is to insert an actor:
Give this actor these parameters:
Key:target
Value:alliedend
This actor we are going to connect with a node.
For this tutorial i will give this actor a node_cover_crouch
Key:targetname
Value:alliedend
Notice the target of your actor is alliedend so it
will be connected to this node_cover_crouch
So to finish things dont forget your info player_start.
And add some regular pathnodes between your node_negotiation_end
this is where your actor is out of the trench and the node_cover_crouch
See this screenshot below how this is done.
Adding a patroller with animations to your SP
map
Laydown your pathnodes, connect them all
using (W).
Make your AI target one.
The node targeted to the one your AI is targeted to,
Check off the "Not Chain" box.
For your AI, give him key/value of:
"script_patroller" "#"
# = Integer value between 0 and 2
0 = Bouncing walk
1 = Tired walk
2 = Swagger walk
Patrol animation (Optional)
To any node, give it a key/value of:
"script_animation" "#"
# = Integer value between 0 and 2
0 = Twitch
1 = Look around
2 = Idle (Scratch chin)
When an AI gets to a node with an animation,
He stops to play animation, and continues on patrol.
In the map source, the raised pathnodes are the ones
with animation. One has the "Not Chain" checked.
Make sure to use +set g_connectpaths 1 on your
shortcut.
Make a SP mortar team
Welcome to the
on how to add a german mortar team to your map
tutorial.
Its very simple, the most part is done in radiant and
it evolves very little scripting. Just follow the steps bellow and you should
be fine.
Step 1. Creating a trigger brush
First step will be to create a trigger brush that will spawn the mortar team when the player
crosses it.
Simply draw out a trigger brush and make it a trigger multiple.
Now give the trigger these values.
key: targetname
Value: mortar_team
Step 2. Creating AI actors
Now we are going to create the mortar team itself
Simply insert any Axis AI actor that you want and make him a Spawner.
Once you have created the actor connect the trigger to the actor (NOT the actor
to the trigger or it won't work).
Step 3. Setting the destination of the team using a pathnode
Place a pathnode on the map where you want your team
to go to once they are spawnd. Once your team reaches
this node they will set up their mortar and start doing their thing.
once you've placed the node connect the actor to the
node (NOT the node to the actor).
Step 4. Placing script origins where you want your mortars
to land
Next step will be to place script origins on your map where you want the
mortars to land (the mortars will randomly land on one of these origins).
Simply place the script origins and then connect the pathnode
to the origins.
And thats it for radiant.
Step 5. Scripting
Its very simple, all you have to do is add the following line to the main
section of your yourmapname.gsc file
maps\_mortarteam::main();
So it looks something like this
main()
{
maps\_load::main();
maps\_mortarteam::main();
level.player takeallweapons();
level.player giveWeapon
("m1garand");
level.player giveWeapon
("colt");
level.player giveWeapon
("fraggrenade");
level.player switchToWeapon
("m1garand");
}
Making cold conditions like snow and make the
animations also
MAPNAME.GSC
Code:
MAPNAME_fx.GSC
Code:
Clipping out windows and doors MP and SP
First, we start
with our house, without any windows or anything. Two stories.
Select one of the walls by holding shift and leftclicking
in the 3d window
Next, press "X" and select two points on the line along which you
want to cut your brush.
One side will now disappear.
If you press "Enter" it will stay that way. If you want to keep both
sides, press "Shift-Enter".
Now do the same on the other side of where you want to have your door
Next, deselect everything by pressing Esc. and onlly select the small brush
we just cut out
and cut that horizontally at the height where you want your door to be. You can
always raise or lower it
later if you want to. Pressing enter should now leave you with a nice door in
your wall
Now we do the same for the window.
Except, where we pressed "enter" for the door, we now press "Shift+enter" to keep both sides of the cut brush
We want to make a lower portion of the window frame
too.
So select the lower part and cut it horizontally once more
Now, as you can see in the shot above, the wrong part
of the bursh is cut.
So we now press "Ctrl-Enter" to make the other part stay.
Texture and you've got yourself a nice house
So remember
select the brush
Press "X"
click two points on the line you want to cut along
"Enter" keeps the current brush part
"Ctrl-Enter" turns the remaining and clipped of part around
"Shift-Enter" keeps both parts.
These are just the basics of the clipper tool, because you can actually cut in
three dimensions.
But that's for another tutorial.