ID:179366
 
Hello all, this is my first post! and I already love this language.. Ive been coding many years in misc languages and kinda stumbled across this one!

My question.. I have multiple icons for male/female/neuter.. Im wondering how I set the right icon depending on the users sex.

Thanx and I hope for many years enjoying this language:)
oh.. and if this helps..

mob
icon = 'neuter.dmi'

male
icon = 'male.dmi'
female
icon = 'female.dmi'
neuter
icon = 'neuter.dmi'


Login()
icon = ????? //when a player logs in, make their icon's state
..() //the gender of their key. Then call the parent!
In response to Jerico2day
gender is a built in var of BYOND so you can do this:

mob/Login()
src.icon=src.gender
In response to Nadrew
thanx, but it doesnt work, or i get errors... u see my source... how would you rewrite it?
In response to Jerico2day
Try using one icon file called "mob.dmi' and using multiple icon_states; and when your login code should look like this:

mob/Login()
icon='mob.dmi'
icon_state=src.gender
..()
In response to Nadrew
alright:) i just realized i can have multiple videos to one icon file.. so thats a good plan:) thanx
In response to Jerico2day
whats up with the src thing? do I have/should use it
In response to Jerico2day
Jerico2day wrote:
whats up with the src thing? do I have/should use it

Here is the FAQ explanation of src:

http://www.deadron.com/Admin/BYOND_FAQ.html#N3530

While you are at it, you really should read the rest of the FAQ and do the steps listed in the "How to get started" section...
In response to Deadron
alrighty will do, thanx