Closed TheFunnyBrain closed 1 year ago
To stop the player running for eternity, I reset their movement in PlayerController.gd.
currently for this system, this is the right way! I think I should add a function in the system later for one_time_stop() / movement_reset()
signal Lock_Removed(lockName:String)
in the first place I made GameAttribute for stuff like health and stamina, your use of it is quite interesting,
do you think that it is worth it to have Pause Variable as a Player Attribute ?
or having it as a variable var is_locked : bool
in the LockSystem.gd will be enough ?
but also having it as a GameAttribute is quite inpsiring for Template users to use GameAttribute Creatively. so I am not sure what we should go with, what is your opinion on it ?
1-
To stop the player running for eternity, I reset their movement in PlayerController.gd.
currently for this system, this is the right way! I think I should add a function in the system later for one_time_stop() / movement_reset()
2- maybe add another signal :
signal Lock_Removed(lockName:String)
3- Using PausedAttribute.gd
in the first place I made GameAttribute for stuff like health and stamina, your use of it is quite interesting, do you think that it is worth it to have Pause Variable as a Player Attribute ? or having it as a variable
var is_locked : bool
in the LockSystem.gd will be enough ?but also having it as a GameAttribute is quite inpsiring for Template users to use GameAttribute Creatively. so I am not sure what we should go with, what is your opinion on it ?
Thanks :) That's great to know :) I considered adding a function, but didn't want to go too far out of scope for a first commit! :)
Thank you, I've added the signal for removing locks in, that was an oversight on my part. :)
At work, we just use NavigationManager.IsLocked and InteractionManager.IsLocked, so I feel it could be simplified without any real headaches. :)
It could be nice to have some lock states as player attributes (e.g. to track player abilities, status effects), however it is very likely overkill, not to mention, a true pause would be a more global game-level variable.
I'll demote the UI to read is_locked, as that's plenty for just manipulating player navigation.
One better, I'm using signals, as they are wonderful and much easier than making a node just to enable the label object! :)
Looks good, thanks for the very nice system. Also Thanks for fixing the Typos (References, mouse_sensitivity)
To add feature/issue #33 (locks) I've implemented a system we use at my workplace.
Presently it's a simple implementation, and I've tried to keep things very minimal.
It's possible to extend this by adding multiple lock components for various things (physics update, camera controls etc), but I'd like to make sure this works as designed, and follows the principles of existing code before overdoing it.
It uses the GameAttribute system to display a brief message explaining that the user needs to press p to restore movement.
To stop the player running for eternity, I reset their movement in PlayerController.gd. This might not be best practice, and thought it was worth drawing attention to in case it's a terrible way to solve the problem! :)
In terms of use cases, locks can be applied to practically any element of a game or character system