PuzzleScriptPlus icon indicating copy to clipboard operation
PuzzleScriptPlus copied to clipboard

Once keyword

Open Unexian opened this issue 2 years ago • 5 comments

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

  • [x] I have searched the tracker for similar issues (including closed ones)
  • [x] I have provided a detailed example for how this feature should work
  • [x] 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 avatar Jul 29 '23 16:07 Unexian

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

david-pfx avatar Jul 31 '23 10:07 david-pfx

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...

Unexian avatar Jul 31 '23 10:07 Unexian

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?

david-pfx avatar Jul 31 '23 12:07 david-pfx

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)

Unexian avatar Jul 31 '23 12:07 Unexian

This feature is now implemented in PS Next.

david-pfx avatar Jan 08 '24 11:01 david-pfx