ID:162284
 
Can someone give me the code for them to choose thier characters? the two characters Im doing is Gryfandoor, and Slytherin
THIS IS NOT COMPLETE CODE
It pops up a little window and lets you pick.
switch(input("Choose your house.","House selection") from list("Gryfandoor","Slytherin")
if("Gryfandoor")
//Whatever you want to do for those in Gryfandoor...
if("Slytherin")
//Whatever you want to do for those in Slytherin...
else //just in case something goes wrong
usr << "You picked something that's not on the list."
In response to Jholder84
How would you create these lists
In response to Jamora1124
Let me elaborate a bit...

switch(input("Choose your house.","House selection") from list("Gryfandoor","Slytherin")


This line has the list written in to it. The only things in the list are Gryfandoor and Slytherin.
This line is a combination that can be split up like this:

new/list/houses = list("Gryfandoor","Slytherin")
var/input=input("Choose your house.","House selection") from houses
switch(input)


We used a switch so now we need to test it.

if("Gryfandoor")
//Whatever you want to do for those in Gryfandoor...
if("Slytherin")
//Whatever you want to do for those in Slytherin...
else //just in case something goes wrong
usr << "You picked something that's not on the list."


We know what the possible choices are cause we made the list earlier and that's all we have to test.
In response to Jholder84
Thanks!
In response to Jholder84
Opps, what I meant to say was, how do you create second list? Like for Names? Also, how do you make it so that after you're done answering the questions of the lists, the operator will compile the info into a List of Info on one of the tabs on the side.
In response to Jamora1124
Let me first say that you DEFINITELY need to read the DM reference guide (http://www.byond.com/docs/ref/). It will really help you. But the basics of it are
new/list <-makes a list
new/list/name <-makes a list called name
list() <-lets you set the things in the list

so

new/list/numbers
numbers = list(1,2,3,4,5)

numbers now contains 1,2,3,4,5

Get it?

But again, read the guide.
In response to Jholder84
Thank you, I'm reading and downloading alot. I don't have much time to d much for my game because my brothers are so mean to me when it comes to this computer.
In response to Jamora1124
Haha. I know how you feel. I don't get near enough time to write my game either. Just stick with it and use the guide as much as possible.