Skip to content
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

Delay and Cooldown Decorators #276

Merged
merged 20 commits into from
Jan 6, 2024

Conversation

RedstoneParadox
Copy link
Contributor

@RedstoneParadox RedstoneParadox commented Dec 23, 2023

Description

Adds a new delay decorator, which allows nodes to be executed after a predetermined delay, which was discussed in #242. Something also discussed was some way of implementing cooldowns for certain actions (i.e. a boss does an action but can't do it again for 10 seconds). My first thought was to add a mode to the delay decorator where it returns FAILURE instead of running while the timer is running, but I wanted to see if it would be preferable to make a separate node. Edit: Decided to implement it as a separate node.

Addressed issues

Addresses #242

@RedstoneParadox RedstoneParadox changed the title Delay decorator Delay and Cooldown Decorators Dec 29, 2023
@RedstoneParadox RedstoneParadox marked this pull request as ready for review January 2, 2024 20:27
@RedstoneParadox
Copy link
Contributor Author

RedstoneParadox commented Jan 3, 2024

So it would seem that test_return_success_after_delay doesn't always succeed; not entirely sure why that is. Edit: It's possibly a timing issue related to the use of the physics engine delta time, which I did to try and ensure that the next tick after the runner simulation would always be the first tick where the timer was 0.

Edit 2: I Rewrote the test and now it passes consistently; the test was badly written originally.

@Emma-Black
Copy link

This is amazing, thank you!

@bitbrain
Copy link
Owner

bitbrain commented Jan 4, 2024

@RedstoneParadox can you please also add docs to the wiki about these new nodes?

@RedstoneParadox
Copy link
Contributor Author

Docs added.

Copy link
Owner

@bitbrain bitbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work, thank you!

@bitbrain bitbrain merged commit 32d456a into bitbrain:godot-4.x Jan 6, 2024
4 checks passed
@RedstoneParadox RedstoneParadox deleted the delay-decorator branch January 9, 2024 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants