ID:261419
 
Im not sure how to do it some im asking for help. I what it so that when a player logs in that is alredy in the savefile it does not ask you the gender.Please help.

    Login()
usr.icon_state = input("Choose a gender?") in list ("Male","Female")
switch(icon_state)
if("Male")
..()
usr.loc = locate(19,7,1)
if("Female")
icon = 'Fpeasant.dmi'
..()
usr.loc = locate(19,7,1)
usr << "<b><h1>Welcome to Kingdom of Treasure(KoT)</b></h1><br>World of Kingdom of Treasure made by: Little Sally/Kento<br>All icons made by Little Sally/Kento.<br><b>Note:</b> This game is very much under construction.<br>_________________________________________________________<br> <b> **Updates**</b><br>1. Added Bartenders<br>2. Set a time on corn picking.<br>3. Added a few more graphics.<br><b> **Coming Soon**</b><br>1. New quest<br>2. Church being added<br>3. Female Peasant icon<br>_________________________________________________________<br><b>Have fun."
usr << "<font color =green>From Maker: Feel free to look around and please shout any bugs or suggestions that you find I will check them when I get back. I am afk at the moment. Also if you really want to and think that the time put into this game so far deserves a donation please do donate.;P </font>"
usr << "<b>Music:</b> The music right now is from the game Crono Trigger because I hate games without music. It's only temp and soon you'll be able to turn it on and off."
world << "<b><font color=blue>[usr] has just entered the world.</font>"
Try this:
mob
Login()
..()
usr.icon_state = input("Choose a gender?") in list ("Male","Female")
switch(icon_state)
if("Male")
..()
usr.loc = locate(19,7,1)
if("Female")
icon ='Fpeasand.dmi'
..()
usr.loc = locate(19,7,1)
usr << "<b><h1>Welcome to Kingdom of Treasure(KoT)</b></h1><br>World of Kingdom of Treasure made by: Little Sally/Kento<br>All icons made by Little Sally/Kento.<br><b>Note:</b> This game is very much under construction.<br>_________________________________________________________<br> <b> **Updates**</b><br>1. Added Bartenders<br>2. Set a time on corn picking.<br>3. Added a few more graphics.<br><b> **Coming Soon**</b><br>1. New quest<br>2. Church being added<br>3. Female Peasant icon<br>_________________________________________________________<br><b>Have fun."
usr << "<font color =green>From Maker: Feel free to look around and please shout any bugs or suggestions that you find I will check them when I get back. I am afk at the moment. Also if you really want to and think that the time put into this game so far deserves a donation please do donate.;P </font>"
usr << "<b>Music:</b> The music right now is from the game Crono Trigger because I hate games without music"
In response to Non-PC
What did you change?
In response to Little Sally
i put
mob
Login()
..()

Thats the change.Don't continue you with another code that says mob.Just put ..() and the 2 Login codes will work.

-Non-PC
Just a tip, it never hurts to shrink down text strings that aren't a part of the actual code. It makes it more readable for the rest of us.

I don't know how you're doing your save-loading stuff, but I assume it comes around Login() time. So, what you might try is setting the new mob's gender to null at New() for your player's mob type, then after the savefiles load (which I assume will change the gender), check to see if the gender is null, and if it is, ask what gender they want.

Hope that helps.

PS, ignore Non-PC from now on. :oP



    Login()
usr.icon_state = input("Choose a gender?") in list ("Male","Female")
switch(icon_state)
if("Male")
..()
usr.loc = locate(19,7,1)
if("Female")
icon = 'Fpeasant.dmi'
..()
usr.loc = locate(19,7,1)
usr << "Welcome to Kingdom of Treasure(KoT)"
usr << "Blah blah"
usr << "Music:"
world << "Character just entered"
In response to Non-PC
It didn't work i cont tons of dup def errors
In response to Foomer
Foomer wrote:
Just a tip, it never hurts to shrink down text strings that aren't a part of the actual code. It makes it more readable for the rest of us.

I don't know how you're doing your save-loading stuff, but I assume it comes around Login() time. So, what you might try is setting the new mob's gender to null at New() for your player's mob type, then after the savefiles load (which I assume will change the gender), check to see if the gender is null, and if it is, ask what gender they want.

Hope that helps.

PS, ignore Non-PC from now on. :oP


Oh,ignore me,TONS OF DUPLICATE ERRORS.I tested mine and it worked.
In response to Foomer
Ok I think I got it figured out. It wasn't that hard. Thank you so much.(I will cut down the text strings from now on, sorry about that)