Backpacks
Backpacks are features in most, if not all TF maps because they are the
primary method of giving players more health, ammo and grenades. To make
them you need to use an info_tfgoal. Create an info_tfgoal in the position
where you want the backpack. To make it appear as though it's resting on
the floor, you need to put the info_tfgoal half in and half out of the floor
brush, and orientate it in the direction you want the face of the backpack to
point. Now, set the following properties:
- Goal initial state: Inactive. When the player touches it, it will
become active, and they will be the activating player, or AP.
- Model path/name.mdl: Set this to 'models/backpack.mdl' (without the
quotes). This specifies how the backpack will look. Since we are
making a backpack, we are using the backpack model. You can use a pak
browser to look at the different models available when making maps.
- Model Skin: 1=red, 2=blue. For some reason, these values are the
other way round to what you would expect, but there you go.
- Sound path/name.wav: Use 'weapons/scock.wav'. This makes it play a
noise as the player picks it up.
- Goal Activation Bitfield: Set this to 1, which makes it activate when the
player touches it.
- Team: 1=blue, 2=red etc.
- Player Class: Should you wish to make it so only certain classes can pick
up the backpack, this is where you do it. 0=any, 1-9 represent the classes.
- goal_effects bitfield: set this to 1 to make it only effect the activating
player, you don't want to give the whole team health or ammo when this is
picked up, or do you.....
- wait: Set this to the number of seconds you want the backpack to wait
after it is picked up before it reappears.
- Armor Type: Use 0, for normal.
- Armor Value: The % of armor to give the player picking it up
- Armor class: 0 - normal
- add/subtract (shells/nails/rocket/cells/detpack/grenades#1/grenades#2/medkits):
how much of each item to give the player. Note that you can only carry
one detpack at once.
- Message to player: You may want to set this to 'Restocking Ammo' or
as in some levels, just use a message on backpacks which give you grenades,
and set it to 'Restocking Grenades' so they know which backpack gives them
the grenades.
And that's it! It may seem a lot, but you can just create one, and then
copy it as many times as you need. Just remember that if you copy it from
one team to another, to change the 'team' key.
Using Detpacks
Many maps have places where you need a demoman to place a detpack to blow up
an obstruction, allowing the rest of the team to pass through. This is
also done using an info_tfgoal. To use it, set the following properties:
- Goal initial state: inactive - this makes it wait for a detpack to go off.
- Goal activation bitfield: set this to 2-detpack, which makes it only
activate when a detpack goes off near it.
- Team: Use this to specify which team the demoman has to be on, generally
you should use 0, for any
- Target: Put the name of the obstruction in here. The obstruction
should be made into a func_wall_toggle or a func_door with it's toggle
property set, and it's name should be the same as the target property just
specified. This makes the info_goal target it when a detpack goes off,
making the wall appear/disappear, or the door to open/close. If you do
use a door, make sure you give it a quick speed, or players may see it
opening and closing. You can see the door effect in 'Well' with the
grates, and I think 'Rock2' uses a func_wall_toggle.
- Activation Message: Set this to a message which you want to be
displayed. It may be one such as 'Red Yard has a hole in it', like in
'Rock2'.
That's all you have to do for that. If you want to make it so that once
the blockade has been destroyed, you cannot get it back, such as in
'crossover2', you have to give the info_tfgoal a 'goal #' and put the same
number in the property 'remove goal #' which makes it remove itself when it is
fired, preventing it from being activated again. Remember, this has to be
a number, not a name.
Az.
Back to tutorials...
© 2000-2001 TFX-Soft, all rights reserved