As some have noticed over the years, target_give in Jedi Knight mutliplayer is broken.
The reason is a piece of code in Multiplayer that does not let you touch an item (which a target_give essentially does for you) if it has a so-called EF_NODRAW flag, which as the name suggests, makes the item not visible, usually after an item is picked up and waiting to respawn. This flag is also set specifically for items that are targets though, because you don't want them to appear for the player. So the very act of giving an item a targetname so that the target_give can find it, makes it impossible for the item to be picked up.
But it turns out there is a way to make it work anyway.
A target_give "touches" another item. A normal trigger "uses" another entity.
As fate and sheer luck would have it, items can also be "used". And "using" them actually makes them respawn. Which in turn removes the EF_NODRAW flag.
In addition to your trigger that activates the target_give pointing to the item in question, you need a trigger that simply points directly at the item itself. Once this trigger executes, it will force the item to respawn, which in turn will make the target_give work.
Here's an example of how to set this up so that you only need one trigger:
Just have the item with the targetname, and then a target_give as per usual, and additionally add a target_relay that has the same targetname as the target_give, which in turn also points at the item. Giving it the same name as the target_give means that any trigger executing the target_give will automatically also execute the target_relay, which will in turn "use" (respawn) the item.
Keep in mind though that the order here matters. Let's say you are using a trigger_multiple with the use_button spawnflag and you want the player to get an item when he presses a button. If the target_give is executed first (before the target_relay), then the first button press will fail because the EF_NODRAW flag is still set. The second press will work because right after the initial target_give was executed, the target_relay was executed as well and respawned the item, making it possible to be "touched" by the second button press. However if the target_relay is executed first, then the first button press will be successful. I'm not sure if you can greatly influence the order of execution but if you add the target_relay into the map before the target_give, that might work. Otherwise if that does not work and it is critical for it to work the first time around, maybe add a trigger_always pointing at the item itself which will make it come alive at the start of the level already.
Also keep in mind that due to this workaround and depending on the order of execution, you might end up with the item actually becoming visible. So consider putting it in some hidden place that isn't accessible.
Recommended Comments
There are no comments to display.
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