Removing and/or Updating Weapons

Discussion in 'Mapping Questions & Discussion' started by Pants, Dec 30, 2015.

  1. Pants

    Pants L1: Registered

    Messages:
    5
    Positive Ratings:
    5
    Like some other people here I have been tinkering with the new 'trigger_add_or_remove_tf_player_attributes', in particular for a jump map. However this trigger does not instantly apply to equipped weapons if you modify something, say the maximum amount of stickies you can place at a time. I did notice that if you either equip and requipped a weapon it would then apply

    OR, using a trigger kill the weapon entity (via trigger_multiple targeting the desired weapon e.g. tf_weapon_pipebomblauncher) followed by a func_regen which could then re-equip the weapon, resulting in the desired modified weapon.

    The issue is that this destroys ALL weapons of that type serverwide, which isn't practicable on a jump map where someone could be mid-level and suddenly wind up with no weapon to use for a second or two.




    The big question
    : Is it possible to specifically target a weapon entity held by the player who enters the trigger brush? (I've tried unsuccessfully to use a trigger to first rename the desired weapon of an !activator but to no avail.)

    Alternatively, is there any other way to force a re-equip of a weapon(s) in a trigger zone?
     
  2. Pants

    Pants L1: Registered

    Messages:
    5
    Positive Ratings:
    5
    Well after some more stabbing in the dark I've come across two other possible solutions, however both are non-ideal. First way is to use the player_weaponstrip entity, calling up a strip command with a trigger_multiple (or by using a strip override as an output command). Again however, this removed the weapons of all the players in the server (although it seemed to not affect a soldier when I was a demoman). I also tried and failed to get the trigger_weaponstrip and _weapondissolve triggers to do anything in TF2.

    Second was to use a clientcommand attached to a trigger multiple forcing the client to load an itempreset and then switch back to the first item preset slot. However, this only works if another preset has a different weapon in that slot and in addition the server gets a bit antsy if you try to force a switch too quickly.

    It would seem that the only safe way is to individually name the target weapon entity that a player is carrying to something individual to an area on the map (and then probably rename it after so that it isn't removed again). To which end I still am at a loss if its even possible to do so.