ID:148022
![]() Aug 5 2003, 12:32 pm
|
|
how do I make the game automatically choose the characters gender based off of his or her key
|
![]() Aug 5 2003, 12:51 pm
|
|
http://www.byond.com/docs/ref/info.html#/client/var/gender
|
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.
|
I'm giving him the benefit of the doubt and assuming that for some weird reason it isn't working right.
|
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. |
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" |
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? 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 What are you doing here? There's no IF statement for the ELSE. You'd need something like if(src.gender == "male") 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? |
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 |
Vexonater wrote:
mob/create_character You have the if() and the else just lying around. Indented under nothing. Put them under the client/New() proc. |
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 |
mob/Login() Something like that? ~Kros |
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 |