[MIRROR] Refactors Object Possession into a Component (moar modular, less /mob
vars)
#1056
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mirrored on Skyrat: Skyrat-SS13/Skyrat-tg#25534
Original PR: tgstation/tgstation#80160
About The Pull Request
We have two verbs that allow any given mob to take control of an object and move it ephemerally,
/proc/possess()
and/proc/release()
. These ones leveraged two vars present on every/mob
:name_archive
andcontrol_object
. I don't like having vars clog up my VV and this just injected snowflake behavior in a lot of spots - let's just make it a component that'll clean everything else up.This also opens up the ability to have more objects be under mob control without giving someone verbs that spit out to the blackbox as an admin verb + logs + message admins but that's a later thing. This just subs in the behavior in a nice way.
Also, since it's a component, I added a small QoL that we can support now: A screen alert that allows you to get out of the possession early without navigating the stat panel for the specific verb. I think it's neat. You can also trigger the aghost keybind if that's something you want as well.
Also also, nothing actually ever cleaned up
control_object
by setting it to null. This means that in the old framework, if a mob got qdelled during a possession, that would have triggered a hung ref harddel. That won't happen anymore.Why It's Good For The Game
Two less variables taking up crud space in the VSC debugger + view variables panel. Better behavior injection that is far more reusable. Component handling this behavior allows for better extensibility of this function in the future.
Changelog
🆑 san7890
admin: Object Possession has been reworked, please report any potential bugs.
qol: Object Possession should now throw a screen alert for you to unpossess the object instead of you having to search the stat-panel for the "release obj" verb. You can still use the verb but it's a lot nicer now. Aghosting will also work now.
/:cl: