Talk:Game player equip

From Valve Developer Community
Jump to: navigation, search

First of all: This entity doesn't work. I rigged it up with a lot of added keys, adding suit, battery power, weapons and ammo, and got nothing at all. Second of all: This entity was not used in HL2. Looking at the Valve maps, they used point_templates touching the player, linked to all the weapons needed. ...so what is this entity for, and does it even work? --Andreasen 10:33, 9 Apr 2006 (PDT)

Well it's a works for sure for Counter-Strike: Sourcets2do 10:43, 9 Apr 2006 (PDT)
Aha, then it should be mentioned that it's a CSS entity somewhere. I've been confused about this entity for months at least. --Andreasen 10:53, 9 Apr 2006 (PDT)
I have it in one of my HL2 maps and it works fine. Mine is set up with keyvalues spawnflags 1, weapon_357 1 and then it is triggered with a Use input, like the description says (and Hammer complains, like the description says, but it works in-game). Voila, one Magnum pistol is spawned when the trigger is fired. Like the item_dynamic_resupply it's certainly fiddly to get it to behave and appears to have hidden limitations, but it certainly will do some of the things it's meant to do. Giles 12:08, 9 Apr 2006 (PDT)
I should also note that when I say "spawned", I can't really remember whether it's spawned to the player (i.e. equipped) or spawned into the world, since my player is teleported to the location of the entity just before it's triggered and it's been a while since I was setting that sequence up. Giles 12:11, 9 Apr 2006 (PDT)
Try setting it up now, without using the use key. The article says that just placing it in a level will make it equip the player on map start, and this was what I tried and what didn't work. --Andreasen 20:10, 9 Apr 2006 (PDT)
That I belive may be wrong and the user may have to walk over it in HL2, i never got round to testing it though. Angry Beaver 22:20, 9 Apr 2006 (PDT)

Neither of those are correct...automatic equipping only works if the player ent is set up to stock weapons on spawn...and if you look in the HL2MP code, they make direct references to game_player_equip. the quick fix would be to use a logic_auto—ts2do 22:53, 9 Apr 2006 (PDT)

"Set up to stock weapons on spawn"? You mean multiplayer now, right? (I don't code.) This entity is triggerable (through the Use input) in HL2:SP though. I'll change the description accordingly. --Andreasen 23:00, 9 Apr 2006 (PDT)
Actually, what are you talking about here? "Setting the Use Only flag makes it equip the activator, or all players if no activator. Now set up a trigger_multiple to equip it." I read this as "You MUST have an activator (trigger_multiple), but if you DON'T have one, it will equip all the players anyway.", so I'll just write what I know, and GUESS the rest, and you can correct me when I'm done. --Andreasen 23:30, 9 Apr 2006 (PDT)

Using this in a Half-Life 2: Deathmatch map, I assigned every weapon to a keyvalue with a value of 1. Upon spawning, it gave me all the weapons I had asked for, with the exceptions of weapon_smg1, weapon_physcannon, and weapon_pistol, which were the ones I actually wanted. Anyone know the reason for this?--Icarus 09:42, 24 Feb 2008 (PST)

HL2, EP2 Logic Auto Bug?

I tried several times to get this to work with a logic_auto and the game crashed every single time. Is this even possible?

This was the setup I tried (smart edit off)

  • game_player_equip
Property Name Value
item_ammo_pistol 2
weapon_crowbar 1
weapon_physcannon 1
weapon_pistol 1
spawnflags 1
targetname player_equip


At first I tried a logic_auto with:

  My Output > Target Entity Target Input Parameter Delay Only Once
Io12.png OnNewGame player_equip use 0 0.00 No

The game crashed after loading the map. Then I tried with "OnMapSpawn" in place of "OnNewGame" and it crashed again. I also tried sending a "FireUser1" instead of "use" to trigger an "OnUser1" output inside the "game_player_equip" and it still crashed.

I'm using a trigger_once with a "OnStartTouch" to send the "use" input as a work around for the time being. If this is a known problem, it should be documented in the main article. --brandished 20:01, 8 Jan 2009 (PST)

I can confirm this is a bug in the HL2 source code. See my forum posting. --Ljbade 12:50, 12 June 2010 (UTC)