Jump to content

Mp - Giving Players Weapons


Recommended Posts

Is there any way in multiplayer to give a player a specific weapon when they trip a trigger? For example, the player presses a button on the wall, and they are immediately given a blaster rifle.

 

I have tried using a target_give, but it doesn't seem to do anything at all. I have also tried using the script commands "set_item" and "set_weapon," but haven't gotten them to work, either.

 

All ideas welcome!

Link to comment

Trigger multiple -> target_give -> weapon entity you want to give

Have you used this successfully in MP? Because that's exactly the setup I tried, and when I touched the trigger in-game, nothing happened at all. Maybe I'm missing something, but I'm not sure what it would be.

Link to comment

I noticed that target_give is mentioned in the Radiant documentation, as a way to give players certain items when they spawn. I wonder if, for some reason, it only works when the player spawns, and not when they just walk into the trigger, or use it with the "use" button. The latter case is what I'm looking for, but that entity setup doesn't seem to do anything.

 

Way back in 2003, it looks like Darth Arth had the same problem, but it appears that no solution was found:

https://forums.massassi.net/vb3/showthread.php?22333-target_give-in-MP

 

For now, setting a trigger_multiple to target a weapon pickup directly seems to be a decent (but messy) workaround. It leaves a weapon pickup behind after it's used, but at least it gives the weapon to the player, even if they aren't standing where the pickup spawns. I'll try to make do with this method until a better way is found.

Link to comment

I don't see how or why it wouldn't work with Target give. I suppose the changes with weapons in jk2/jka might be an issue (where they spawn with hologram, and still typically show when picked up)

 

Is any weapon disabled on the server? g_weaponDisable? This disables them from spawning like this as well.

 

Update: Found the reason it can't work in JKA.

 

in Touch_Item function there exists:

	if (ent->s.eFlags & EF_NODRAW)
	{
		return;
	}
Which targetname'd items set to true on spawn since they would not be visible. Quake3 does not do this check against it.
z3filus likes this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...