Open ClementSparrow opened 3 years ago
Yeah it's pretty janky. Puzzlescript naively just splits them up, but an error/warning would not be amiss :)
yeah, actually I think the best way to do it would be to deal with late like we already do with random: only allow the keyword on the first rule of the group and consider then that it applies to the whole group.
That's however something you probably shouldn't do with PuzzleScript because it could break old games, but I don't have this concern with Pattern:Script :-) (yet)
If you want to play old PS games, play them on PS. Splitting a group in two (early and late) is never going to be what was intended. I go for late as a group modifier, like rule directions and random.
I just had a long debugging session caused by a rule group where I put the late
on the first rule but forgot to add it after the +
in the second rule. And I was like "why is this rule not applied?", and the reason was that it was attempted before the movement phase at a time it could not apply. So I would definitely recommend that the late
keyword applies to the whole group.
I would even argue that the late
keyword should not exist as a rule keyword but should be a section keyword. Yes, I also had a bug because of that.
PS has this warning, which might have helped:
logWarning('Oh gosh you can mix late and non-late rules in a rule-group if you really want to, but gosh why would you want to do that? What do you expect to accomplish?', lineNumber);
And yes, internally late is a section, and there are arguments in favour of that.
Something like this…:
…doesn't make sense?