Undo (Doing More)

Heyo!

So obviously Quest has some Undo feature, but a couple of player's informed me that it doesn't undo everything made for that turn. For example; variables that were affected by items, turn-scripts perhaps and press to continue events. I was wondering if there was a way to program a better/stronger working Undo function that encompasses all of that; functions, turn-scripts etc. Here's the current one.

Under one transaction

Or am I supposed to be using

UndoTurn

Thanks for any help! Appreciated!

Anonynn.


Looking at a new game, the built-in undo command just has the one script that calls the built-in undo function, which doesn't even show up as something you can modify when you check "Show Library Elements" (guess they don't want us to mess with that one). So to undo something, you just pick the Undo script under Game State after clicking the usual Add new script button, or just type "undo" in code view. That's it as far as calling the undo function.

Yes, you bring up a good topic about using undo. This was the most cumbersome thing that I tried to get right in my game, not realizing all of the things that the undo command doesn't undo. Most attribute changes are properly undone, but any display changes in the user interface that occur in-game are NOT undone (map, pictures, game panes, background, etc.). Furthermore, your turn scripts (especially turn counters) will most likely redo changes that were undone, since they run after the undo command is executed. To remedy this, I turned on a flag when undo was successfully executed, then each of my turn scripts has an if/then script that says not to run the turn script if the undo flag is on, then I have a turn script at the very end that resets the undo flag. As for the UI display changes, I had to manually undo them by heavily modifying the undo command to handle that.

So to answer your question, unfortunately no, there is no better undo function -- you have to code the undo command to do that. Which also means a lot of playtesting, at least for my game. You can limit when/how often the player can use the undo command, which might lessen the workload. Sorry!


There are so many problems with undo that it is probably better to design games so that it isn't needed. It is very valuable, however, for anyone testing a game.


Thanks for the responses! It's just a bonus feature for mine xD Appreciate it guys!

Anonynn.


Furthermore, your turn scripts (especially turn counters) will most likely redo changes that were undone, since they run after the undo command is executed. To remedy this, I turned on a flag when undo was successfully executed, then each of my turn scripts has an if/then script that says not to run the turn script if the undo flag is on, then I have a turn script at the very end that resets the undo flag.

The next version of Quest will allow you to disable turn scripts for a turn, which will make that easier. Might be worthwhile adding it to the UNDO command for the next release too.

As for the UI display changes, I had to manually undo them by heavily modifying the undo command to handle that.

I had not thought about it, but UNDO is not going to touch the interface. I personally would have UNDO call functions that update the interface.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums