[Suggestion] noTouch

80 views
Skip to first unread message

ncr...@gmail.com

unread,
May 16, 2016, 12:08:35 PM5/16/16
to PuzzleScript
Let's say we want an animated wall in our game, going through 5 frames then returning to frame 1. Should be easy, right?

[Wall1] -> [Wall2]
[Wall2] -> [Wall3]
[Wall3] -> [Wall4]
[Wall4] -> [Wall5]
[Wall5] -> [Wall1]

However, when we run the code (and move around a bit if it's not in real time), nothing happens. That's because the parser, naturally, doesn't care about whether or not the wall objects were already there, or were just transformed into them. We could try turning them into unrelated objects and back to avert this:

[Wall1] -> [Temp2]
[Wall2] -> [Temp3]
[Wall3] -> [Temp4]
[Wall4] -> [Temp5]
[Wall5] -> [Temp1]
[Temp1] -> [Wall1]
[Temp2] -> [Wall2]
[Temp3] -> [Wall3]
[Temp4] -> [Wall4]
[Temp5] -> [Wall5]

But that can cram up the Rules and Objects list quickly if we have more frames, or if there's multiple animated objects. So what if we could just prevent an object from changing into another for an entire turn, with a simple command? It could be inserted before the object, like directions are:

[Wall1] -> [nochange Wall2]
[Wall2] -> [nochange Wall3]
[Wall3] -> [nochange Wall4]
[Wall4] -> [nochange Wall5]
[Wall5] -> [nochange Wall1]

And simply negate any rules where said object is replaced by any another object, including a blank space. For more specific cases, there could also be noMove (do not let this object move for this turn), noTouch (do not let this object move or change for this turn), and maybe even yesChange/yesMove/yesTouch (to, well, negate the negation). And it doesn't have to be used for just animations, either. This repetitive mess of code ( http://www.puzzlescript.net/play.html?p=8a4d08484adeb28ddede1510a80e12d3 ):

late [PlayerB PortalB] [PortalO] -> [PortalB] [PortalO TeleTokenB]
late [PlayerO PortalB] [PortalO] -> [PortalB] [PortalO TeleTokenO]
late [PlayerG PortalB] [PortalO] -> [PortalB] [PortalO TeleTokenG]
late [PlayerB PortalO] [PortalG] -> [PortalO] [PortalG TeleTokenB]
late [PlayerO PortalO] [PortalG] -> [PortalO] [PortalG TeleTokenO]
late [PlayerG PortalO] [PortalG] -> [PortalO] [PortalG TeleTokenG]
late [PlayerB PortalG] [PortalB] -> [PortalG] [PortalB TeleTokenB]
late [PlayerO PortalG] [PortalB] -> [PortalG] [PortalB TeleTokenO]
late [PlayerG PortalG] [PortalB] -> [PortalG] [PortalB TeleTokenG]
late [TeleTokenB] -> [PlayerB]
late [TeleTokenO] -> [PlayerO]
late [TeleTokenG] -> [PlayerG]

can be miraculously changed to:

late [Player PortalB] [PortalO] -> [PortalB] [PortalO nochange Player]
late [Player PortalO] [PortalG] -> [PortalO] [PortalG nochange Player]
late [Player PortalG] [PortalB] -> [PortalG] [PortalB nochange Player]

Stephen Lavelle

unread,
May 17, 2016, 8:40:50 AM5/17/16
to Nate Charles, PuzzleScript
a command seems like overkill. you can have an object, called temp say, and do this -

[Wall1 no temp] -> [Wall2 temp]
[Wall2 no temp] -> [Wall3 temp]
[Wall3 no temp] -> [Wall4 temp]
[Wall4 no temp] -> [Wall5 temp]
[Wall5 no temp] -> [Wall1 temp]
[temp]->[]


--
You received this message because you are subscribed to the Google Groups "PuzzleScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puzzlescript...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Pickel

unread,
May 17, 2016, 9:19:03 AM5/17/16
to Stephen Lavelle, Nate Charles, PuzzleScript
I've used "action" for this too.

[Wall] -> [action Wall]
[action Wall1] -> [Wall2]

agas...@gmail.com

unread,
May 23, 2016, 12:08:20 AM5/23/16
to PuzzleScript, ncr...@gmail.com
Another suggestion: Order the rules backwards (also needs an extra object and rule or else Wall1 will disappear, though it saves from adding an extra layer).

[Wall5] -> [WallWrap]
[Wall4] -> [Wall5]
[Wall3] -> [Wall4]
[Wall2] -> [Wall3]
[Wall1] -> [Wall2]
[WallWrap] -> [Wall1]

http://www.puzzlescript.net/editor.html?hack=7eb86113625dc5e8261fb54f7d52ddc0
Reply all
Reply to author
Forward
0 new messages