I’ve solved most of the issues and got this to work the way I intended, though I don’t really like WHERE I put the code.
In order to insert a check that would enable or disable UndoAction depending on certain circumstances, I had to go directly into action.t and mess with the action’s definition. Specifically, where it said:
Code:
/* perform the undo */
performUndo(true);
Now it says:
Code:
/* perform the undo */
if (certainActor.location == gPlayerChar.location)
{
"Command disabled. ";
}
else
performUndo(true);
The actual check is a lot more complicated, but this is just to illustrate. Is there some way to do this from the outside, so as not to mess with the basic libraries?
RealNC wrote:
I forgot to mention that randomness is still random even with UNDO. If you roll the dice, then UNDO (or SAVE/RESTORE) and roll again, the results will be different.
That's precisely the reason I wanted to disable the action. There are plenty of other situations in my game were users may want to undo their actions and I have no problem with that. The issue here is that there are situations where there'll be a quick succession of random rolls that I want to force players to deal with no matter how they come up, rather than allowing them to comfortably reroll each one until they get the results they prefer. I'm fine with them starting over from the beginning of the event (It’s not long) and if they want to use more tedious forms of cheesing, I won't stop them. I just don't want to end up in a situation where the most efficient method of playing is rerolling each roll until they get the result the want, because at that point the random element becomes only a timewaster and I might as well jus scrap it and give them the best result automatically.