is there a way to disable all other commands?

adammadam
I currently have my game set up with lots of hyperlinks for the players convenience like this

{command: take x}
{command: go to x}


there are some points where I'd like them to be forced to make a choice out of some hyperlinks like this and be unable to do anything else until they have done this.. I know there's a "get input" feature but I dont think that will work out so well (not sure?!) because if they type in something which doesnt make sense as their input it wont work

adammadam
actually never mind, im just going to learn how to use a menu and convert it into that I think that will work

adammadam
well with menus it's working fine.. if anyone knows a simple thing you can do to force one of these hyperlinks to be clicked instead of a menu that'd be good just because the menu is a bit invasive, but it's no big deal if it's something really complicated to do.

TinFoilMkIV
Basically what you want is a get input, then have it repeat the same code if you enter an invalid option.

The method I'm currently using for this involves using a 'get input' with a 'switch' inside of it. Then for the default response you set an action that will repeat the whole thing if they didn't make an acceptable choice.

There are a few ways to create the loop, but basically you need the menu/question/whatever to be stored as a separate block of code somewhere to call it easily. Probably the most immediately obvious way is to create a Function that has your code, however I don't prefer this method unless its something you plan to reuse often, as having a lot of these can end up as clutter in the editor. Another way I have used is to have a room, and set the description to a script instead of text, then having the script call the function 'ShowRoomDescription()' to repeat itself. Probably the most flexible method is to store the actual script as an object attribute then call it from there, although it's a bit more complicated I think it's probably the best method I know of.

EDIT: also a helpful trick if you aren't already using this, in any text you can use {command:input:text} to create a link that will show as the "text" part in the display and will act as though the player typed "input" in the command prompt. It doesn't have to be a valid input of any type, but will act as though the player typed whatever you put in the "input" section.

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

Support

Forums