-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lock system #33
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Lol, I JUST REALIZED I UNDERSTOOD Lock system wrong, resulting me working on another features, LOL. but now I understand your game LOCK System. still it will help. in my game the lock system was using one Variable called in_game, your idea is much better. Please add this system, as it will help a lot of games that will use this Template, plus, it may help turn this Template into a whole Demo, because it will make Menus work flawlessly with this template. |
I made this PlayerController Script : So you can add the system you meant here. |
Awesome! :) Thank you :) I have added the feature to PlayerGamePlayComponent in a local branch, but it's no trouble to throw it over :) I'm just trying to work out how best to get the locks connected to the player, but as an optional component. Initially it's as a preloaded .gd script, so I'm going to try and turn it into a proper node that can be there or not. :) It's strange migrating from Unity, where I'd do something like a null check or even trygetcomponent at launch. :) That said, I am really getting a kick out of the friendliness of GDScripts - is so simple with handling things like dictionaries! I am also looking to try and make it support signals, so that we could for example have debug UI. |
I've rewritten it in nodes, added a nullcheck etc, so hopefully it'll do the trick. :) Would I be okay to add a pause key (e.g. the 'p' key) to test the system works? :) It's doing absolutely nothing presently, which is exactly as intended - so I guess the next test is to add a lock, see what happens. |
Yes, no problem, actually you should consider adding a way so the users of the template know that this feature exists. for me the Pause Key "p" is good enough, and I may add a simple Pause screen for it in the future. |
That sounds perfect! :) I've added the 'p' key in for now, and hopefully I can add a small UI element to tell the user what's happening. :) I did notice an amusing side effect of my implementation - the player walks, or runs indefinitely whilst locked! I'll resolve that now, I think it might be that I need to switch the character to an idle state. :) I'm guessing physics might also be a consideration, but I won't get ahead of myself for now. Quite frankly, I'm astonished any of my GDScript is working on day 2, it is a nice feeling. |
I saw your scripts, and you are a good user of GD script. Keep going 👍 |
Thank you :) That's really encouraging to hear, it's a nice jump, and I'm having fun. I have a perpetual fear of wading into someone's project, and busting things through lack of knowledge. I've made a pull request now, and I can fix any issues, add anything, change things etc. :) |
For the company I work for, we make use of a lock system, to restrict player movement whilst using UI, or in a cutscene.
The way we found best, is a privately settable Dictionary of strings.
Locks.AddLock("TalkingToCompanionA")
Locks.RemoveLock("TalkingToCompanionA")
Input can then check locks.count/locks.length etc with a property or method, e.g.
The strings are set by developers, and help with debugging as we can print out what's going on.
The collection is important, as it means multiple things can manipulate the locks without unlocking things unintentionally
e.g. A player is on a pause menu, fast travels, then return to the pause menu without the fast travel's locks interfering with the pause menu still needing the player to be immobile after the animation.
This one is something I'd be happy to work on, but only if it's useful. :)
The text was updated successfully, but these errors were encountered: