exits names how to git rid of the "You can go" text before it {solved}

MajorPink
07 Feb 2023, 00:38I'm trying to make a simple multi choice text adventure no items or anything but i use the exits as a choice to make it the the next part of the chapter but the names don't fit when it has "you can go are you male?"
GeminiNeule
07 Feb 2023, 06:46You have several options:
Assuming you are in the text adventure mode, on the "exits" tab at the top there is a textbox with the text that shall be placed before the listing of exits.
No matter which mode you are in, you can also use a menu and move the player according to his response.
msg ("Your page text here")
options = NewStringList()
list add (options, "Female")
list add (options, "Male")
list add (options, "Something else")
ShowMenu ("What is your gender?", options, false) {
msg("You are " + result)
switch (result) {
case ("Female") {
MoveObject (player, next_female_section)
}
case ("Male") {
MoveObject (player, next_male_section)
}
case ("Something else") {
MoveObject (player, next_nonbinary_section)
}
}
}
The selected answer is stored in the result variable. Printing out the answer given is a good practice, since both menu and answer will disappear as soon as an option is selected.
If you are only offering two options you can also rephrase the question and use "Ask" instead, which will give you "true" or "false" as result.
If you are in gamebook mode - and so far it sounds like that is the mode that is more appropriate to what you are trying to do, since you don't want to use typical text adventure features and only choices - you can also place page links into the text using the text processor features.
Which gender are you? Are you {page:female_page:female}, {page:male_page:male} or {page:nonbinary_page:something else}?
mrangel
07 Feb 2023, 17:08Assuming you are in the text adventure mode, on the "exits" tab at the top there is a textbox with the text that shall be placed before the listing of exits.
If you don't want to manually change it on every page, you could set a script to change this string for all pages on startup.
In your start script, you could do something like:
foreach (room, AllObjects()) {
room.exitslistprefix = ""
}
which quickly goes through every room and removes the "You can go" string from all of them.
(It will also remove the string from objects that aren't rooms… but this is unlikely to make any difference unless the player somehow ends up inside them)