ID:267667
 
Alright, I got a problem. I was told it probably can't be answered by Camaro, but I can't understand what the problem is, so I'll post it here anyway.

I'm trying to make it so that when you open up, it asks you for your name and job class. Here's the code:

..()
usr.name = input("What is your name?","Name Your Character")

var/icon = input("Which Job Class will you choose?","Choose Your Job Class")in list("Black Mage","Fighter","Monk")
switch(icon)

if("Black Mage")
usr.icon = 'blackmage.dmi'
if("Fighter")
usr.icon = 'fighter.dmi'
if("Monk")
usr.icon = 'monk.dmi'


(I tried to make the indents good, they get screwed up when I paste the code in)

Now, the problem is.. Well, it just doesn't do what you choose. If you choose Black Mage, it'll be a Fighter, if I choose the Fighter, it'll be invisible, and if I choose Monk it'll be fighter. It's just all screwed up. And yeah, I have all the dmi name states and all that stuff right. Is there something wrong with the code? Help wou;d be appreciated.. Thanks.
Don't use the icon var for the input() proc; it makes absolutely no sense. Use "class" or something instead:

var/class = input(blah)
switch(class)
In response to Crispy
I appreciate your answer, even though that didn't do anything.

:'(
In response to Crispy
I originally told him to make it switch(iconage), but I guess he changed it.

Don't you just love that word?

-Camaro-
What they mean is you have the temporary variable the same name as a pre-defined one.

var/icon = input("Which Job Class will you choose?","Choose Your Job Class")in list("Black Mage","Fighter","Monk")
switch(icon)

if("Black Mage")
usr.icon = 'blackmage.dmi'
if("Fighter")
usr.icon = 'fighter.dmi'
if("Monk")
usr.icon = 'monk.dmi'

Why dont you change the .dmi file to match the character class names and do something like this

var/class = input("Which Job Class will youchoose?","Choose Your Job Class")in list("Black Mage","Fighter","Monk")
switch(class)
usr.icon = '[class].dmi'

Try that.

James
In response to SSJ2GohanDBGT
SSJ2GohanDBGT wrote:
switch(class)
usr.icon = '[class].dmi'

This won't work, and is rather misleading. NOTHING in the switch() needs to be changed apart from changing "switch(icon)" to "switch(class)".
In response to Rockin' Eli
Is that code inside a procedure(proc)? If so, you have usr all over the place.
In response to Jon88
No.. That didn't do anything either.. I was wondering if maybe I could send somebody the whole .dme file for them to look through and maybe see if I have any conflicting code anywhere.. Because, as it stands, I, or noone else can see what this problem is, especially from what I've given..
In response to Rockin' Eli
i dont mind if u send it to me, i usually fix all my friends coding probs (most of them neway) and i'll be glad to help you here if you send it to me.

P.S i wont steal the game, as i am already working on 3 games already + i have school work to do, so just fixing the game would be my priority