Jedi_Mediator Posted July 21, 2017 Posted July 21, 2017 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!
Ramikad Posted July 21, 2017 Posted July 21, 2017 Not sure if it would work, but you could try to put a func_usable or trigger_multiple and link it to a weapon spawn. It seems to work with health and shield power-ups, so it might not work for weapons, but it's worth a try.
ensiform Posted July 22, 2017 Posted July 22, 2017 Trigger multiple -> target_give -> weapon entity you want to give Langerd likes this
Jedi_Mediator Posted July 22, 2017 Author Posted July 22, 2017 Trigger multiple -> target_give -> weapon entity you want to giveHave 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.
ensiform Posted July 22, 2017 Posted July 22, 2017 It works all the time in Quake3. Same thing should apply.
Jedi_Mediator Posted July 24, 2017 Author Posted July 24, 2017 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.
ensiform Posted July 24, 2017 Posted July 24, 2017 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now