Hey, I wanna make it so that when the character chooses their race at login
Login()
usr.icon_state=input("What race?") in list ("human", "elf", "dwarf", "halfling")
usr.race = usr.icon_state
it assigns different attributes depending on the characters race. I'm trying to do this with an if statement such as this:
if (usr.race = "human)
str = 15
etc. However, I keep getting errors with the if statement. How do I check a string in an if statement like this?
ID:261478
Apr 26 2002, 7:04 pm
|
|
In response to Vortezz
|
|
Here's my code:
mob icon = 'person.dmi' var race str = 0 Login() usr.icon_state=input("What race?") in list ("human", "elf", "dwarf", "halfling") if (usr.race == "human") str = 15 usr.race = usr.icon_state verb create_character() usr.name = input("Choose a name for your character.", "Your Name", usr.name) world << "Your race is [usr.race]" I'm getting two errors: Game1.dm:11:error:list:undefined proc on my create_character() line, and the other error is Game1.dm:12:error::invalid expression on my usr.name = input("Choose a name for your character.", "Your Name", usr.name) line. What is wrong with this? |
In response to Guardian Angel
|
|
Do you have AIM?
|
There should be a == instead of a =
= is for variable assignments
== is for comparisions in if() statements
Oh, and you're forgetting a quote on the end of human. It should be "human"