[Prefab] Find, Filter, and Delete tf_weapon_spellbook

[Prefab] Find, Filter, and Delete tf_weapon_spellbook V2

Yaki

aa
Sep 3, 2018
416
254
THIS PREFAB HAS BEEN UPDATED NOV 1st, 2022. See Overview for most recent info!



[Prefab] Delete [spellbooks] per Player - Spell-casting for Pyro only? Sure!

See this post first for a Disclaimer on using this logic.

This prefab is able to delete all spellbook weapons from players that aren't Pyro.

Theoretically, it can be used for any weapon and/or any player. However this prefab teaches only how to delete spellbooks on classes that aren't Pyro.

This prefab is fully commented. Follow the lines (called landmarks in Visgroups) and comment nodes. Everything is Visgroup'd, as well! Play around with it and you'll see.

You can boot it up immediately and compile it to play. Works like advertised.

Features
  • #1) Deletes spellbooks consistently on all classes except Pyro.
    1. Works by parenting the spellbook weapon to a trigger_multiple,
    2. trigger_multiple then spawns at spellbook origin, which is the same as the player's,
    3. Player touches trigger, trigger sends TestActivator to a filter,
    4. Filter filters Not Pyros: OnPass, deletes the trigger. OnFail, parents the trigger to the player and changes the targetname to a new so it won't be communicated to again.
  • #2) Supports a resupply locker.
    • The resupply locker's animations actually trigger the master relay.
  • #3) The "master relay" description:
    1. This is a logic_relay that fires the beginning of the "funnel system",
    2. This funnel system targets all spellbooks in the map, one-by-one, by using an Addoutput to StartTouch trigger_multiple filtered to weapons only. This works because of OnStartTouchAll only selecting one !activator for each queue,
    3. There are 33 logic_branch entities. Each one is assigns a unique name for each spellbook, makes the spellbook invisible, spawns the trigger_multiple to be parent the spellbook to it.
    4. Does the rest as in bullet point #1.

Known Issues
  • Issue #1: "trigger_spellbook_parent", a trigger_multiple (original name: weapon_strip_spellbook . It's renamed via addoutput from filter_spellbook_pyro)
    • This entity will spawn again if a Pyro touches the resupply locker and lets the animation of the locker play out. This can happen any number of times. These ever-spawn entities are parented to the Pyro.
    • This is a serious issue. Not cleaning up the entities can easily cause lag.
  • Issue #2:The spellbook can accidently parent to the wrong person.
    • If a Pyro is close enough to the locker and another class is inside the Pyro's collisions, the trigger might touch the Pyro and the other class will keep their spellbook. Thankfully, it's stripped away on respawn.
  • Issue #3:Pyro may lose their spellbook on touching the resupply.
    • Unknown.
 
Last edited:

Yaki

aa
Sep 3, 2018
416
254
Bug fix update
  • Fixed first time spawning as Pyro would delete the spellbook (now doesn't)
  • Fixed changing class not deleting spellbook (now does)
  • Made respawn teleport triggers bigger (due to being able to back out of them on respawn)

  • Added instances to easily place in your map.
  • STILL REQUIRES tf_logic_holiday to be placed in your map. Otherwise nobody will get spellbooks!

Read the rest of this update entry...
 

Yaki

aa
Sep 3, 2018
416
254
Version 4 update.

This update further tightens the loose ends and make the logic more consistent.

Some changes include:
  1. Implemented a check to see if the funnel system is already running.
  2. Implemented another safety check if the funnel system needs to rerun a second time for any reason (i.e. a spellbook isn't cleared after touching a resupply the second time).
  3. Fixed a bug where name "spellbook_12" would be used multiple times.
  4. Fixed Pyros losing spellbooks if their queue wasn't already over.
  5. Adjusted how the funnel system is initiated (still through same relay "relay_name_spellbook"
  6. Adjusted some other not-helpful I/O's.
  7. Updated func_instances to reflect changes.
These further tighten the loose ends and make the logic more consistent.

Known issue:
  • Pyro will lose their spellbook upon touching the resupply. Still unsure why this happens.

Read the rest of this update entry...
 

Yaki

aa
Sep 3, 2018
416
254
I have to say this: This more of a proof-of-concept rather than something you could put in your map.

I have tested this with real players in real time. And it is buggy.

  1. The resupply logic just doesn't really work as intended. Pyros still lose their spellbook at random points, and it can be frustrating for players.
  2. What the logic does is recalculates all players in the map to see if it needs to remove the spellbook or not. Sometimes, Pyro is in that pool of removal.
  3. This might work better as an arena logic. The resupply is just wayyyy too buggy.
 

Yaki

aa
Sep 3, 2018
416
254