O, so I have prepared a draught of a tutorial I wish to submit, here it is, please tell me what you think via email or whatever =)
[u]Stripping and Equipping Weapons in Counter-Strike[/u]
[u]Resources Required[/u]
Up to date
fgd, found
hereIntroductionThe premise is simple: to choose which weapons the player(s) start(s) off with,
and to make sure they can only use those weapons.
Actually putting this concept into a playable level involves some minor entity work,
so if you are unfamiliar with the
multi_manager, game_playerequip, player_weaponstrip,
and the
info_map_parameters, then read the brief description's below:
[note]Tutorials/Full Descriptions of all these entities can be found on this site, and require
virtually no hunting, and limited knowledge of HL to understand their principles and properties]
multi_manager: A device that allows you to trigger multiple events/entities after a single
previous event has taken place.
eg: The door opens, triggers the multi_manager, the multi_manager triggers an alarm
(ambient_generic), and a flashing light, then after 10 seconds it turns everything off.
game_playerequip: The entity used to
equip the player with the weapons you require.
eg: The player runs through a trigger, which runs the [i]game_playerequip[/i] which "gives" the player
ammo, kevlar, grenades or a gun.
player_weaponstrip: The player runs through a trigger, which runs the
player_weaponstrip, removing
all weapons/items currently in the player's possession.
eg: Pretty self-explanatory
info_map_parameters: An entity which allows you to set certain parameters within the map, such as weapon buying,
and bomb blast radius etc. Quite a limited entity and only mentioned here as an example of different methods
of achieving the same goal.
[u]Getting it all to work[/u]
First things first, make your map, I imagine it will probably be similar to the fy_iceworld map, if this is the case,
think long and hard about whether you want to release your map, as most mapping forums tend to frown upon iceworld clones,
as they've seen a thousand before yours, and I can guarantee you won't be met with the compliments your friends/clan gave you.
It's a tough world
However, just because you want to give players certain weapons doesn't mean the map must be of the fy_ strain, you could be
making an escape style map, where the CT's start in a jail, and are only equipped with a knife and glock (or whatever takes your
fancy). Perhaps a scout map set in a "forest", with two bases, seperated by a canyon.
The possibilities are endless, and I only mention those ideas because I would like to stress how important it is that you be
creative when you design your map, this tutorial will (hopefully) show you that almost all of your ideas can be realised with a
little hard work, and some thinking outside the square.
1. Insert 3 point-based entities (if this means nothing to you, start reading the beginner tutorials), you will need to
create:
1x multi_manager
1x player_weaponstrip - name it [b]strip[/b]
1x game_playerequip - name it [b]equip[/b]
2. Arrange them neatly in a high corner of your map, I suggest aligning the centres of all three on a single x/y axis.
Not only will it look like something that resembles proffessionalism, it will be easier to edit them
when you make a mistake.
3a. Preventing Teams from buying: Create 2 brush based entities (I suggest a 16x16 unit shape, as this is easy to manage,
and fits in with the size of the point entities you already created, a uniformed approach to mapping is a good way to keep things neat and edit-able),
create:
2x func_buyzone
Now set their properties (Highlight the entity, and press Alt+Enter, alternatively right click, and select
properties) like so:
Team: Counter-Terrorist only
Team: Terrorist only
Now you have two buyzones in an unreachable place, set to each team, making it impossible for them to buy weapons.
3b. The second way to prevent teams from buying, is by using the
info_map_parameters entity. If you have no idea what this does,
or how it effects the game, think of scoutzknivez, this uses an info_map_parameters, which gives you that
Ct's/T's arent' allowed to buy in this map message. But what if you want a buyzone, just not at the start of the map? This is where the
info_map_parameter will let you down.
Setting the entity up is very simple, just open it's properties and set Buying to 'Neither team can buy'.
4. Now to set up your point based entities (you created them first so that you could arrange them neatly =P ). There may be several different
ideas running through your puny mortal brain of how you could implement the techniques we discussed earlier. There is no set way to achieve all the
desired results, for a different map set-up, you will need to change the way the entities are themselves set-up. I will firstly go through a simple
m3 and
deagle map.
[b][u]multi_manager[/b][/u]
Name: game_playerspawn [this means that the multi_manager is triggered when a player spawns, and eliminates any need for brush based triggers]
Now turn Off
Smart Edit (by clicking it once, if the button is depressed it is Off), and click
add and enter the following:
Key: strip
Value: 0.1 - this triggers the player_weaponstrip after 0.1 seconds, this is virtually instantaneous.
Key: equip
Value: 0.2 - this triggers the game_playerequip after 0.2 seconds. you must trigger the equip
after the strip, other wise you will give
player a load of guns, and then take them away instantly. A most undesired effect.
You can use multiple
game_playerequip's, but you only need one to make the m3/deagle map.
Open the
game_playerequip's properties and select the following:
[Mandatory]
Give Knife : Yes
Give m3 : Yes
[Optional]
Give Kevlar and Helmet : Yes
Give HE Grenade : Yes (always a fun one)
Now for the "tricky" part:
Turn Off
Smart Edit, and enter these:
Key: weapon_deagle
Value: 1
Key: ammo_50ae
Value: 6
Key: ammo_12guage
Value: 4
Congratulations, you now have a working m3/deagle map.
Remember the name in the multi manager's
key field
must match teh name given to your
strip/equip entities. try not to use wild names, as strip/equip will do just fine, but these
don't have to be the names, just an example of what I use to keep things in order and easily
remembered.
Now what if you didn't want to strip everything and have everyone with the same primary and secondary weapons?
Well, the first (and easiest) thing I would suggest is the
armoury[/] entity. It can be found at the top
of your fgd list, and contains a list of many of the guns availiable, it is very easy to use, if you follow
some basic guidelines:
a) Select a weapon using the 'item' line, select how much ammo you want to give using the 'count' line.
note count is actually how many guns will be spawned, as the entity doesn't support ammo (yet),
but it works to equip you with a fair amount of ammo, if you wanted to go nuts, you could place triggers for
the player to fall through which would trigger game_playerequips which would give ammo, but this will cause
you more problems than it solves. I would reccommend simply adjusting the 'count' field in teh armoury_entity,
it is alot safer and bug-free.
b) You cannot select certain guns, such as the UMP, or pistols. if you wish to equip pistols, you will need
to use the previously mentioned method, via a multi_manager/player_weaponstrip/game_playerequip. This is where
teh armoury_entity meets it's pitfalls. Like I said; different entity for a different job.
c) Don't place the armoury_entity "inside" the info_playerspawn, set it either a few units above, or a few units below.
Make sure you don't set it in the ground if you are placing it below the player.
That's about it for armoury_entity's, they are very basic and the only error's you can get will be placement related
(ie: inside the ground/player). It has a limited use and I would reccommend thinking carefully about what kind of theme
would be best suited to such an entity. An Armoury is an idea that springs to mind. Perhaps the back of a SWAT van
filled with shotguns and mp5's.
[b][u]Other Uses[/u]
There are several things that you can do to make this entity set-up more interesting, you could make a Quake-like
level using a func_rotating in conjunction with some home-made textures (a picture of a CS gun of your choice on a
{blue background for instance), and use env_renders and multi_managers to trigger the disappearence of the func_rotating
and to equip the player with the gun on the picture.
You could have a metal detector ala security scanner device type thingy that when walked through sets off an alarm and
strips teh player of all their weapons. however, avoid leaving a player with no weapons, as this makes for a pretty
tedious game of CS.