Disable or change undo command

Can you disable or change the undo command? Ideally, I'd like it to be possible only once at a time, instead of anytime you want, and then you'd spend another one or two turns before you can use it again. But disabling it altogether is fine too.


K.V.

WARNING:

People don't like it when they can't UNDO.


You have been warned.


Changing it to skip two turns

Something that happens during an UNDO keeps this from taking effect for 1 turn the first time, but then it won't let you UNDO for 2 turns.

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Fun with Undo">
    <gameid>5e03e35f-46d9-41d9-84cc-330b7d435c17</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
  </game>
  <command name="undo">
    <pattern type="string">^undo$</pattern>
    <isundo />
    <script>
      set (undo, "parent", player)
      SetTurnTimeout (3) {
        set (undo, "parent", null)
      }
      undo
    </script>
    <disabled type="string"></disabled>
  </command>
  <object name="room">
    <inherit name="editor_room" />
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>
  <walkthrough name="kv" />
</asl>

Completely disabling UNDO (Just make a command with the patternundo.)

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Fun with Undo">
    <gameid>5e03e35f-46d9-41d9-84cc-330b7d435c17</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>
  <command name="no_undo">
    <pattern>undo</pattern>
    <script>
      msg ("I don't understand your command.")
    </script>
  </command>
  <walkthrough name="kv" />
</asl>

Room with no UNDO

NOTE: I am trying to find a way to check for an UNDO. If the last command was an undo, I could make it so the room threw you back outside. (In the event that you left the room during battle, then entered UNDO, you would get kicked back out to the last room.)

<!--Saved by Quest 5.7.6404.15496-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="Fun with Undo">
    <gameid>5e03e35f-46d9-41d9-84cc-330b7d435c17</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
    <exit alias="in" to="battle room">
      <inherit name="indirection" />
    </exit>
  </object>
  <object name="battle room">
    <inherit name="editor_room" />
    <description>This is the battle room, where UNDO will NOT work!</description>
    <beforeenter type="script"><![CDATA[
      set (undo, "script_backup", undo.script)
      noUndo => {
        msg ("You can't UNDO here.")
      }
      set (undo, "script", noUndo)
    ]]></beforeenter>
    <onexit type="script">
      set (undo, "script", undo.script_backup)
    </onexit>
    <exit alias="out" to="room">
      <inherit name="outdirection" />
    </exit>
  </object>
  <walkthrough name="kv" />
</asl>

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

Support

Forums