-
Notifications
You must be signed in to change notification settings - Fork 470
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
Add "On Move" script to Triggers #910
base: develop
Are you sure you want to change the base?
Conversation
I think this is a good idea and it should be added unless it causes noticeable performance problems I used it for several unconventional reasons with my game, including making a waterfall that splashes water on the player’s head. The trigger detects where the player is and updates the position It also allows a trigger to be used for more than one trigger, by checking the location of the player when triggered by a move and acting based on that location. I used that because I ran out of triggers on my map and so several doors are actually one trigger |
Although I don't see any problem with adding this back to be honest. |
I'm making a script that hides sections of my player sprite when it's behind background objects and this would make it so much smoother than "On Update"! |
I ran into problems regarding the collisions and copy/pasting between tabs when testing. I had an actor with a 16x16 collision box and the grid mode set to 16px. For some reason, I had to move one block up for the trigger to start working correctly, and even then, I remember I ran into some strange issues. As for the tabs, I can't seem to copy entire scripts from On Move to On Enter. |
fecd795
to
fef94d6
Compare
fef94d6
to
c5e30c4
Compare
c5e30c4
to
d70b0f2
Compare
I really wish I could have a trigger activate each time the player takes a step. It would save me needing to use 4 variables and keeping track of player's current and new position to detect when they move. |
I would like it too. I use it pretty often in GBStudio 2 |
Please check the Other Information section below as I'm posting this more as an open discussion rather than something I think it should be merged.
New feature
Trigger scripts run when the player enters or leaves the trigger, once the player is moving inside the trigger no scripts are executed. In 2.0 (when there was only one
On Trigger
script) this wasn't the case, as theOn Trigger
script was running on each step of the player inside the trigger. This was used to add features like random encounters.Add a new
On Move
script to the Trigger that executes when the player moves around the trigger.No
I'm not 100% sure this is needed anymore. The "random encounter" use cases can be achieved with an
On Update
script in an invisible actor pinned to the screen. Not sure if there's other use cases that this script type can fulfill. Open to discussion, really.