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

Once keyword #116

Open
3 tasks done
Unexian opened this issue Jul 29, 2023 · 5 comments
Open
3 tasks done

Once keyword #116

Unexian opened this issue Jul 29, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@Unexian
Copy link

Unexian commented Jul 29, 2023

Check ([ ] -> [x]) all that apply, then describe the issue below:

  • I have searched the tracker for similar issues (including closed ones)
  • I have provided a detailed example for how this feature should work
  • I have provided a use case for this feature, e.g. short description/share link of a game you're making and how you'd use the feature in that game, other things you've tried, edge cases, etc. (if applicable)

My idea is simple: a keyword that restricts a rule to one application per turn. I have a game that has something that moves objects up, but I only want it to move once per turn. Another way you could do it is with 'setting objects' (transparent objects that get deleted post-turn), but I think it would be nice if there was a way to do it with just a keyword.

@Unexian Unexian added the enhancement New feature or request label Jul 29, 2023
@david-pfx
Copy link

I support this. I call it the once prefix. It's on my list for PS Next.

@Unexian
Copy link
Author

Unexian commented Jul 31, 2023

I support this. I call it the once prefix. It's on my list for PS Next.

I don't think it would work very well as a prefix because you might have multiple different objects that are trying to run the rule...

@david-pfx
Copy link

Sorry, don't understand. Objects don't run rules.

With a once rule prefix, instead of

  • "Each rule gets applied in turn as often as it can be before the interpreter moves on to the next one"
    you get
  • "A once rule gets applied once before the interpreter moves on to the next one"

What did you have in mind?

@Unexian
Copy link
Author

Unexian commented Jul 31, 2023

Sorry, don't understand. Objects don't run rules.

With a once rule prefix, instead of

  • "Each rule gets applied in turn as often as it can be before the interpreter moves on to the next one"
    you get
  • "A once rule gets applied once before the interpreter moves on to the next one"

What did you have in mind?

That is what I had in mind, but I meant there might be multiple objects trying to be changed by the rule (like 2 objects trying to fall at the same time)

@david-pfx
Copy link

This feature is now implemented in PS Next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants