Possible to edit the basic default scripts?

Was curious if it was possible to edit the basic default script commands. My idea was this, adjusting the "Finish" command to always have a question before it, (Do you want to go back and try again) and the yes option having an undo)

I know i can do this manually by finding every ending, and maybe a mass find and replace would work too(if i put alot of spaces behind finish) but was thinking if I could do it globally instead.


If you are using the desktop version, then you can override most of the functions, but there are some you cannot (the documentation for the specific function will state if you cannot) and none of the script commands, such as finish.

The best way is to create your own Finish function, and ensure that is used every time, and have that call finishif required. However, doing a restart is going to be very difficult.


Recent finish script, unfinished.

options = Split("End the game;Go back to the first room;Go to Sloth Hypocrite Bar;Go to Lusty Prostitute bar", ";")
ShowMenu ("Shop", options, true) {
  switch (result) {
    case ("End the game") {
      msg ("Game finished.")
      EnableTimer (End game)
    }
    case ("Go back to the first room") {
      msg ("You were sent back to the first room.")
    }
    case ("Go to Sloth Hypocrite bar") {
      msg ("You were sent to the Sloth Hypocrite Bar.")
    }
    case ("Go to Lusty Prostitute bar") {
      msg ("You were sent to the Lusty Prostitute Bar.")
    }
  }
}

just an example of Pixie's post (using Objects and Script Attributes instead of custom Functions):

<game name="example_game">
  <attr name="start" type="script">
    ask ("Automatically end the game?") {
      if (result) {
        do (finish_object, "finish_script_attribute")
      } else {
        msg ("Type in 'finish' to end the game manually")
      }
    }
  </attr>
</game>

<object name="finish_object">
  <attr name="finish_script_attribute" type="script">
    msg ("GAME OVER")
    finish
  </attr>
</object>

<command name="finish_command">
  <pattern>finish</pattern>
  <script>
    do (finish_object, "finish_script_attribute")
  </script>
</command>

Sorry, I forgot the End game timer!

Interval seconds, seconds to end: 6

finish

And that's all. But it's important!


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

Support

Forums