ID:159161
 
I want to make it so when you click the new button a list comes up and you can pick choices, Heres what i have so far (Dont know how to make code thing)



mob/proc/LoginThing()
world<<"[usr] Has logged in."
alert("Welcome to our game")
usr.loc=locate(5,5,1)



mob/Login()
usr.LoginThing()
icon = 'player.dmi'

turf/Title
icon='Title.png'

turf/New/Click()
usr<<"You clicked the new button"
usr.loc=locate(47,7,1)
The input() function is what you are after, and you will have to use a list object (probably via list() function) in combination with it.

The reference there gives an example of how to do exactly what you are looking for, so I will stop there.
There are a couple of mistakes in your code. But basically (assuming by button you mean one on the HUD, i.e. a screen object) it does involve overriding Click() to do the job. Now, you could use quite a lot of different methods (some implementing on your own, of course) to gather player input, but it's most easily and commonly done by using the input() proc. Look it up in the DM Reference (F1 in Dream Maker, and it's also on this site) for info about it.

IDWMno wrote:
(Dont know how to make code thing)

Well, this might strike you as odd, but have you considered starting to learn how to make code before trying to? If you mean to be making code, or programming, it would surely benefit you. If you so wish, start learning here.
In response to Kaioken
Kaioken wrote:
There are a couple of mistakes in your code. But basically (assuming by button you mean one on the HUD, i.e. a screen object)...

He has a turf type that he is apparently using as the button. And, since he is locating the player to 5,5,1 when logged in, I would think it is relatively safe to assume that the bottom-left corner of z=1 has the turf/title_screen on it with the turf/new used as a button in the middle of it.

Pretty much none of what he is doing now is how I would do it personally, but then, what I used to do years ago isn't like what I would do now either. I might be jumping to conclusions here, but it appears that he is at least getting a firm enough grasp on some things to be able to do what non-trivial things he needs with what he knows. That is a critical stage in programming development.

Then again, I find it odd that someone would be doing the things he is and not be comfortable with input(). Several things come to mind, but I won't go there. (No negativism intended with that last comment, just an observation.)