Bodger2 walks you through adding a flakpanzer and crew or a Flak88 and crew to your SP map
Adding a flakpanzer is very easy to do,no complicated scripting for this
one.
Tutorial written by Bodger2
SPECIAL THANKS TO BDBODGER, WHO
FIGURED OUT HOW TO DO THIS
All credit goes to him!!!!
Step
1:Create a SCRIPT MODEL
--------------------------------------
Right click
in the 2d view and select script->model
Use these KEY &
VALUES
KEY:classname VALUE:script_model
KEY:model
VALUE:xmodel/vehicle_tank_flakpanzer
KEY:script_turret VALUE:1
UPDATED: April 11/2004 (Thanks SewerDroid for the info)
=========================================These
KEYS & VALUES ARE OPTIONIAL
KEY:script_offtime VALUE:.1 (the amount of
time before getting off)
Default if this key is not present offtime = 20000
(time in millsec,or 20 sec)
KEY:script_offradius VALUE:2000 (distance in
units,when the player comes within that distance they get off)
Default if
this key is not present offradius = 350
You don't need both of these
KEYS,one will do.(time or distance)
=========================================Step
2:Create the ACTORS
-------------------------------
Right click in the 2d
view and select actor->any german model
Give him a targetname if you
want.(auto generated names work fine)
Check the checkboxs SPAWNER &
FORCESPAWNER.
This will give him a KEY:spawnflags VALUE:3
Now clone
him two more times.The flakpanzer takes 3 guys to man.
Step 3:Connect the
FLAKPANZER to the
ACTORS
--------------------------------------------------------
Select the
flakpanzer then select one of the actors and hit CTRL+K to connect
them.
Continue this for the other two guys.
Step 4:Create a
TRIGGER
------------------------------
Create a brush and give it the
trigger texture.
Now right click in the 2d view and select
trigger->multiple
It must be a trigger multiple,trigger once doesn't
work.
Step 5:Connect the FLAKPANZER to the
TRIGGER
---------------------------------------------------------
Select
the flakpanzer then select the trigger multiple and hit CTRL+K to connect
them.
This will give the trigger the same targetname as the guys.
Step
6:Create a CLIP BRUSH
----------------------------------
Since script
models aren't solid in the map,you will need a clip brush to stop the AI"s and
PLAYER from passing threw it.So just put some brushs around the flakpanzer,and
texture them with the clip nosight metal.
UPDATED: April 11/2004 (Thanks SewerDroid for the info)
=========================================Step
7:Create a Trigger (for notifying AI's to stop there
animations)
-------------------------------
Create a brush and give it the
trigger texture.
Now right click in the 2d view and select trigger->once
or multiple
Step 8:Connect the FIRST TRIGGER to the SECOND
TRIGGER
-----------------------------------------------------------------------
Select
the first trigger(step 4) then select the second trigger(step 7) and hit CTRL+K
to connect
=========================================THATS IT
FOR THE MAPPING PART
-----------------------------------------
Now
for the scripting parts
Theres only one line you need in your maps
GSC.
So heres what the script looks like:
main()
{
maps\_load::main();//loads all global scripts
maps\_panzer::main();
//GIVE PLAYER
WEAPONS
level.player takeallweapons();
level.player
giveWeapon("m1carbine");
level.player giveWeapon("thompson");
level.player
giveWeapon("colt");
level.player giveWeapon("fraggrenade");
level.player
switchToWeapon("thompson");
} The _panzer.gsc handles everything for you,inclueding the trigger.So you will
not need to script the trigger.
Simple right?But we are not done yet!
The sounds for the FLAKPANZER are map specific.
So you will need to create
your own .CSV for your map.Name it the same name as your
map.(yourmapname.csv)
Save it in the soundaliases folder in your
pk3.
So heres what it looks like:
name,sequence,file,vol_min,vol_max,pitch_min,pitch_max,dist_min,dist_max,channel
,type,probability,loop,masterslave,loadspec,subtitle
null,,null.wav,,,,,,,,,,,,,
#Flakpanzer,,,,,,,,,,,,,,
flakpanzer_loop,,weapons/flak/Flakpanzer_loop.wav,1.5,1.5,1,1,1550,5000,weapon,,,looping,master,yourmapname
flakpanzer_loop_fast,,weapons/flak/Flakpanzer_loop_fast.wav,1.5,1.5,1,1,1550,5000,weapon,,,looping,master,yourmapname
flakpanzer_loop_null,,weapons/flak/Flakpanzer_loop.wav,0,0,1,1,1550,5000,weapon,,,looping,master,yourmapname
flakpanzer_loop_fast_null,,weapons/flak/Flakpanzer_loop_fast.wav,0,0,1,1,1550,5000,weapon,,,looping,master,yourmapname
flakpanzer_cooldown,,weapons/flak/Flak_single.wav,1.25,1.25,0.9,1.1,1250,5000,weapon,,,,master,yourmapname
flak_singleshot,,weapons/flak/Flak_single.wav,1.5,1.5,0.85,1.1,1200,4000,weapon,,,,master,yourmapname Well thats it we are done,now that wasn't hard was it?
The above tutorial also works for the FLAK88,with a few
differences.
First it uses a different script,so instead of using the
panzer script you would use the flak script.
maps\_flak::main();
Second,it uses a different
model.
KEY:model
VALUE:xmodel/turret_flak88
There are several flak88 models,but they
are static ones and will not work.
Third,the flak88 has two different
flak types.(flakair and flakairlow)
So you
will have to give the gun a script_flaktype.Pick one.
KEY:script_flaktype VALUE:flakair
KEY:script_flaktype VALUE:flakairlow
The
difference between the two is the angle of the barrel of the gun.
flakair is
straight up,flakairlow is well low.
Fourth,and this should be obvious by
now,it has different
sounds.
name,sequence,file,vol_min,vol_max,pitch_min,pitch_max,dist_min,dist_max,channel
,type,probability,loop,masterslave,loadspec,subtitle
null,,null.wav,,,,,,,,,,,,,
#Flak
88,,,,,,,,,,,,,,
Flak88_fire,1,weapons/flak/flak88_fire.wav,1.5,1.5,0.9,1.1,800,6500,weapon,,,,,!yourmapname
Flak88_fire,2,weapons/flak/flak88_fire02.wav,1.5,1.5,0.9,1.1,800,6500,weapon,,,,,!yourmapname
Flak88_fire,3,weapons/flak/flak88_fire03.wav,1.5,1.5,0.9,1.1,800,6500,weapon,,,,,!yourmapname
flak_reload,,weapons/flak/flak_reload.wav,1.5,1.5,0.9,1.1,120,500,,,,,,yourmapname
UPDATED: April 11/2004 (Thanks SewerDroid for the info
)
=========================================
Fifth,the
flak88 can have 4 AI's.(passer,loader,ejecter,leader)
Those are the only
differences from the flakpanzer.