ID:2269890
 
(See the best response by Ter13.)
Hey guys, I'm making a text based game as a hobby for now, and I understand how alert("",x,y) works and input() works, but I was just wondering how I'd code a text box and possibly with a Next/Cancel button on it

A good example of what I mean is when you want to make an introduction message for new users... the easiest way is to do it like this:
mob
proc
WelcomeMessage(msg as message)

usr << "Thank you for playing Gangsters Ambition - Dope Wars... In this game you will start off as the underdog and slowly make your way up the ladder to that big guy everyone on your block wishes they could be... How do you get there?"
sleep(100)
usr << "The first thing you need to know is that on the streets, Drug Dealing with the right state of mind, can lead you all the way to success, or end you up in Jail. You need to know how to strategize to evade the law and make that paper you want so bad."
sleep (50)
usr << "Let's Begin, Welcome to Gangsters Amibition - Dope Wars."
world << "New User: [usr] Logged In"



What I'm wondering is how to get the dialogues that would usually be output in the browser under {usr} to show up as a textbox with dialogue, and if possable a next, cancel button.


Problem description:I'm not familiar with how to make basic text box dialogue in coding.

Best response
input(usr,"message","title",default) as message|null


the "as" type affects how the input() box shows up.

acceptable "as" types are:

text //single line text
message //multi-line text
num //single line number
password //single line password
command_text //raw text (verbs)

icon //graphics uploaded from the user's computer
sound //sound files uploaded from the user's computer
file //any file from the user's computer
key //a key from the user's keys list
color //an RGB color picker
null //an optional parameter (adds a cancel button to most inputs)

mob //a mob, when used with a list
obj //an obj when used with a list
turf //a turf when used with a list
area //an area when used with a list

anything //any object when used with a list


alert() is also a way to show dialogue using the built-in windows controls. Alert() is probably what you are looking for instead.

alert(usr,"message","title",Button1="next",Button2="cancel",Button3=null)

The alert box is limited to three buttons. It's probably better to implement your own controls with screen objects, or using the interface editor, or HTML via a browser, though.