Undo Glitch

playinful
25 Jun 2016, 07:17
Um, I seem to have found a bit of a glitch in the Quest Editor that deals with turn scripts and the "undo" function. If you type a command not recognized by Quest (such as just typing gibberish), it will still consider that a "turn," and so turn scripts will still function. However, "undo" ignores these types of commands, so that can result in the "undo" command taking the player back more turns than intended.

I doubt this can be fixed using the Quest Editor, but I feel the issue should be brought up nonetheless.

The Pixie
25 Jun 2016, 07:41
What you really want is to stop the turnscripts getting done in those cases, and you can do that in the editor. On the game object, create a script attribute called "unresolvedcommandhandler". This will get called for those non-turns. Have it set a flag on the game object. Then in your turnscripts, have them only do anything if the flag is not set. Finally, in your last turnscript, unset the flag. Personally I would have a single turnscript that does everything, so you know which is last.

Arguably this should be the default behaviour, and so should be built in to Quest, because, as you point out, it is a bug. You migt want to log it on the bug tracker; there is a link at the bottom of the front page of the forum.

HegemonKhan
25 Jun 2016, 07:57
any clicking on something and/or something typed in into the command bar at the bottom (type in something and then hitting the '[enter]' key on your keyboard) is an internal turn. As Pixie mentioned, you can restrict your scriptings from being activated upon an internal turn change/incrementing, via blocking that scripting/script(s) off using an 'if'/conditional scripting in the various places involved with internal turns (anything that is clickable with mouse and/or uses typed in input into the command box).

here's how Pixie is doing it for/with/through a Turnscript:

viewtopic.php?f=10&t=6269&p=42530&hilit=notarealturn#p42497

but you're not limited to doing it through a Turnscript, as I believe for example, if you can work with the internal code, you can alter the 'Command's handling scripting' to have that 'if boolean' Scripting to prevent Commands from activating your scriptings in them, upon an internal turn (change/incrementing).