ID:148022
 
how do I make the game automatically choose the characters gender based off of his or her key
In response to Garthor
I cant find it anywhere, the page is so big!
In response to Vexonater
Click on the DM Reference link to the left, then on the left frame with all the links, browse down until you find "client" on the first row, then under client find "var", then under var find "gender". Then click on it.
In response to Foomer
Alternatively, you could just click my link.
In response to Garthor
I'm giving him the benefit of the doubt and assuming that for some weird reason it isn't working right.
In response to Garthor
:/ That didnt help
In response to Vexonater
Vexonater wrote:
:/ That didnt help

In DreamMaker hit F1. Type gender.
Simple, I dont know if you already got an answere but all you do is make an icon file called say, person, or character or whatever. Then make 3 icons, one female, one male, and one neuter. Now type the code :

Login()
icon_state = gender



//That should do it. If not tell me.
In response to Deadron
It the risk of sounding dumb, the help taht it gave did not help me out at all. This is the code part now and It is completely messed up, can you tell me what i need to change to make the gender based by key?



mob/create_character
var/mob/character
Login()
client.New()

character = new /mob/characters/Male
else
character = new /mob/characters/Female

mob/characters/Male
icon = 'characters.dmi'
icon_state = "boy"

mob/characters/Female
icon = 'characters.dmi'
icon_state = "girl"
In response to Vexonater
Vexonater wrote:
It the risk of sounding dumb, the help taht it gave did not help me out at all. This is the code part now and It is completely messed up, can you tell me what i need to change to make the gender based by key?



mob/create_character
var/mob/character
Login()
client.New()

character = new /mob/characters/Male
else
character = new /mob/characters/Female

Look at those lines that are bold, i can tell you a few things why your (Most definatly) getting an error, for one you have an else proc there without a if() statment you should do somthing like

if(src.icon_state="male")
character=new /mob/characters/Male
else
character = new/mob/characters/Female
In response to Vexonater
character = new /mob/characters/Male
else
character = new /mob/characters/Female

What are you doing here? There's no IF statement for the ELSE. You'd need something like
if(src.gender == "male")
character = new /mob/characters/Male
else
character = new /mob/characters/Female


As a side note, have you looked at the resources that were linked to for you? It should take you directly to the relevant information. If you're having trouble understanding the information, could you tell us what it is that doesn't make sense?
In response to The Conjuror
Its not helping
In response to sapphiremagus
I checked the information, but the whole thing was confusing me, okay, this is what im with now



mob/create_character
var/mob/character
Login()
client.New()

if(src.gender == "male")
character = new /mob/characters/Male
else
character = new /mob/characters/Female

mob/characters/Male
icon = 'characters.dmi'
icon_state = "boy"

mob/characters/Female
icon = 'characters.dmi'
icon_state = "girl"

And these are the error Im getting:

loggin_in.dm:6:error:src.gender:duplicate definition
loggin_in.dm:6:error:"male":duplicate definition
loggin_in.dm:6:error:== :instruction not allowed here
loggin_in.dm:6:error::empty type name (indentation error?)
loggin_in.dm:7:error:character:undefined var
loggin_in.dm:7:error::empty type name (indentation error?)
loggin_in.dm:9:error:character:undefined var

In response to Vexonater
Vexonater wrote:
mob/create_character
var/mob/character
Login()
client.New()

if(src.gender == "male")
character = new /mob/characters/Male
else
character = new /mob/characters/Female

mob/characters/Male
icon = 'characters.dmi'
icon_state = "boy"

mob/characters/Female
icon = 'characters.dmi'
icon_state = "girl"

And these are the error Im getting:

loggin_in.dm:6:error:src.gender:duplicate definition
loggin_in.dm:6:error:"male":duplicate definition
loggin_in.dm:6:error:== :instruction not allowed here
loggin_in.dm:6:error::empty type name (indentation error?)
loggin_in.dm:7:error:character:undefined var
loggin_in.dm:7:error::empty type name (indentation error?)
loggin_in.dm:9:error:character:undefined var

You have the if() and the else just lying around. Indented under nothing. Put them under the client/New() proc.
In response to Airjoe
mob/create_character
var/mob/character
Login()
client.New()
if(src.gender == "male")
character = new /mob/characters/Male
else
character = new /mob/characters/Female


now I have that and I still have these bugs :

loggin_in.dm:5:error:src.gender:duplicate definition
loggin_in.dm:5:error:"male":duplicate definition
loggin_in.dm:5:error:== :instruction not allowed here
loggin_in.dm:5:error::empty type name (indentation error?)
loggin_in.dm:6:error:character:undefined var
loggin_in.dm:6:error::empty type name (indentation error?)
loggin_in.dm:8:error:character:undefined var
In response to Vexonater
Once again:
Post [link]

Read that. It tells you exactly what to do.
In response to Foomer
mob/Login()
src.icon = 'players.dmi'
if(src.client.gender == "male")
src.icon_state = "male"
if(src.client.gender == "female")
src.icon_state = "female"
if(src.client.gender == "netuer")
src.icon_state = "robot"
src.loc = locate(1,1,1)


Something like that?

~Kros
In response to K'ros Trikare
well the code i use doesnt pick the gender based on the keys chosen gender but it seems simpler to me to use this i use it in my game because it is an RPG and some people like to roleplay a different gender for any amount of reasons just an alternative option i figured is add in here maybe it will help. :)



mob/Login()
var/choice = input("What is your prefered gender?") in list("Male","Female","Load")
if(choice == "Load")
else
if(choice == "Male")
usr.icon = 'Player.dmi'
icon_state = "Male"
usr.loc = locate(1,1,1)
else
if(choice == "Female")
usr.icon = 'Player.dmi'
icon_state = "Female"
usr.loc = locate(1,1,1)
return