ID:177357
 
mob
Login()
switch(input("Which gender do you want?","Create Character") in list ("Male","Female"))
if("Male") icon = 'Human-Warrior.dmi'
if("Female") icon = 'Human-WarriorF.dmi'

this's so far okay... but the next one I seem to have problem.


switch(input("ETHNIC?","Create Character") in list ("1","2"))
if("1") var/obj/1/icon = new()
if("2") var/obj/2/icon = new()
src << sound('zekia.mid',1)
usr.loc = locate(25,25,1)
mob/Stat()
..()
statpanel("Status",icon)
stat("Strength: ",Str)
stat("Agility: ",Agi)
stat("Vitality: ",Vit)
stat("Intelligence: ",Int)
stat("Exp: ",Exp.)

What I'm tryin to do is, depending on what you choose, a different kind of icon shows up on the panel, but var/obj/1/icon seems to be "defined but not used"?? :(
i mean its there on the stat panel..why is this??!?!?
and yes obj 1 and 2 has an icon for each.

thx...
Your making a new var/obj/1/icon. And your not doing anything with it.
What should it be doing if("1")?
In response to Dog Man
Your making a new var/obj/1/icon. And your not doing anything with it.
What should it be doing if("1")?

Under that Stat(), I have "icon"...so i think its used but I might be misunderstanding.

var/obj/1/icon

with this above, am I making a variable called "ICON" with the graphic of obj/1??? Or not... i'm so confused.

by the way I'm tryin to make it so that when you choose ("1") the icon1's gonna show up on stat panel, and when ("2") is chosen icon2's gonna show up on stat panel..

thx.
In response to Sogabe
Sogabe wrote:
Your making a new var/obj/1/icon. And your not doing anything with it.
What should it be doing if("1")?

Inside a switch(), it will execute whatever follows your if() (until the next if() in the switch) as long as the var you're comparing is "1" (the text string, not the number).

Outside of a switch(), if("1") is always true, since "1" is a non-empty string, so the code will run no matter what.

Under that Stat(), I have "icon"...so i think its used but I might be misunderstanding.

var/obj/1/icon

with this above, am I making a variable called "ICON" with the graphic of obj/1??? Or not... i'm so confused.

You're making a var named icon, of the type /obj/1. Since I don't think 1 is a valid subtype, this will cause the compiler to choke. Before it gets a chance to choke, however, it notices that your mob already has a var named icon (all atoms do), and chokes on that instead.

Lummox JR