Here is my Login code, what would it do so that if some one chose male samurai the get a male icon and if Someone chose Female they got female.
mob
Login()
var/char_type = input("What are you?",) in list("Samurai","Minion")
switch(char_type)
if("Samurai")
Samurai()
if("Minion")
Minion()
mob/proc/Samurai() // this will be called if they choose Samurai
var/item_choice = input("Which are you?",) in list("Male","Female")
mob/proc/Minion() // this will be called if they choose Minion
var/item_choice = input("What colour Minion are you?",) in list("Red","Blue")
src << "You are a [item_choice] Minion!"
ID:261329
Dec 23 2001, 8:40 am
|
|
In response to Exadv1
|
|
No thats not what i ment; what i meant was showing me how to indent it with "if" correctly.
|
Super saiyan3 wrote:
Here is my Login code, what would it do so that if some one chose male samurai the get a male icon and if Someone chose Female they got female.<font color=red>switch(item_choice) if("Male") icon = 'Male.dmi' if("Female") icon = 'Female.dmi' else src << "No neuters allowed!!"</font> mob/proc/Minion() // this will be called if they choose Minion |
In response to Bingis
|
|
Thanks Bingis but i still get these errors.
implementation.dm:11:error:list:bad proc implementation.dm:12:error::invalid expression implementation.dm:11:item_choice :warning: variable defined but not used from this code. mob Login() var/char_type = input("What are you?",) in list("Samurai","Minion") switch(char_type) if("Samurai") Samurai() if("Minion") Minion() mob/proc/Samurai() // this will be called if they choose Samurai var/item_choice = input("Which are you?",) in list ("Male","Female") switch(item_choice) if("Male") icon = 'Male.dmi' if("Female") icon = 'Female.dmi' else src << "No neuters allowed!!" mob/proc/Minion() // this will be called if they choose Minion var/item_choice = input("What colour Minion are you?",) in list("Red","Blue") src << "You are a [item_choice] Minion!" |
In response to Super saiyan3
|
|
Super saiyan3 wrote:
Thanks Bingis but i still get these errors. All the ","s in red don't need to be there. |
In response to Nadrew
|
|
Like this?
mob Login() var/char_type = input("What are you?",) switch(char_type) if("Samurai") Samurai() if("Minion") Minion() mob/proc/Samurai() // this will be called if they choose Samurai var/item_choice = input("Which are you?",) switch(item_choice) if("Male") icon = 'Male.dmi' if("Female") icon = 'Female.dmi' else src << "No neuters allowed!!" mob/proc/Minion() // this will be called if they choose Minion var/item_choice = input("What colour Minion are you?",) src << "You are a [item_choice] Minion!" I still get; implementation.dm:11:error:input:bad proc implementation.dm:12:error::invalid expression implementation.dm:11:item_choice :warning: variable defined but not used |
In response to Super saiyan3
|
|
Super saiyan3 wrote:
Like this? Your tabs are wrong... mob/proc/Samurai() // this will be called if they choose Samurai Try that code. It should work. I can't try it as I don't have Dream Maker installed on this computer. |
In response to Super saiyan3
|
|
You didn't even do what I said!
input("Blah blah")//NO , AT THE END!! |
icon = ...