[Prefab] Find, Filter, and Delete tf_weapon_spellbook V2
comes with advanced tricks, tips and notes
An easy-to-use, ready-out-of-the-box prefab using 10 entities to find and delete tf_weapon_spellbook, based on conditions set by the mapper.
In this prefab, only Pyro can hold a spellbook. All other classes have their spellbooks deleted!
Features
Notes
In this prefab, only Pyro can hold a spellbook. All other classes have their spellbooks deleted!
Features
- Filters the tf_weapon_spellbook entity using a math_counter, trigger_multiple, and env_entity_maker+point_template
- Uses a single "master relay" to easily execute the logic at any given moment
- Uses advanced tricks to get this done
Notes
- tf_weapon_spellbook, and all tf_weapon_*entities, are set at origin 0 0 0 of the player entity.
- tf_weapon_spellbook, if the classname is changed, will still retain it's functionality.
- This is notable because all other tf_weapon_* entities (with the exception of tf_weapon_builder for Engineer), will prevent switching to the weapon if it is already on their class loadout.
- math_counter can be used to add an OnUser1 output and execute FireUser1 in the same tick:
- This is done by sending Add 0 to the math_counter (Triggers it like a relay), which fires OutValue Addoutput OnUser1, which then fires GetValue !self, and then fires FireUser1.
- !Note: FireUser1 needs to have a value in the parameter or else it won't work in math_counter!
- StartTouch sent to a trigger_multiple when fired from an OnUser can used to get weapons, players, non-solid entities, etc, to touch triggers anywhere in the map:
- Not to be confused with OnStartTouch, StartTouch can be used to touch a trigger_multiple anywhere in the map.
- This can be done by sending AddOutput parameter OnUser1 named_trigger:StartTouch::0:-1 and firing OnUser1 to execute the OnUser.
- With the above known, using OnStartTouchAll will only let one entity touch the trigger at a time.
- Used for grabbing the !activator (one tf_weapon_spellbook), changing its name, then spawning an entity where the player is to filter them out.
- logic_relay, when set with a delay, will not be able to be fired twice if it is sent the Trigger input.
- This is especially crucial to know, because this prevents the logic from firing more than it needs to.
- Additionally, this feature can be disabled using spawnflags.
- This prevention feature can also be used on a "dummy" output with OnTrigger and a delay, without any entity/input/parameters (aka those are left completely blank)
- This is especially crucial to know, because this prevents the logic from firing more than it needs to.
- Uses env_entity_maker and point_template, with three small triggers, two of which have filters, to filter the player's class and delete the one tf_weapon_spellbook entity.