ID:178934
 
How would I go about doing a Gender section for my character creation as I am after a Gender setting where once the player has picked their gender it will do the following:

If the players chooses the gender of "Male" a list of male characters comes up to choose from and if that player chooses "Female" for the gender a list of female characters will come up to choose from. I dont know how to go about this because I have never really used Gender before plus I dont really know how to go about that of what I just stated :-\

If anyone can help I will gladly be glad to recieve it because I really would like to have it setup like that of which I stated. The helper/helpers will be put on the credits section if you so wish to and I am willing to pay 5/10 Dimes to the person who helps me.

Lee
Why don't you svae money and look up the gender var for atoms:0
In response to Super16
Super16 wrote:
Why don't you svae money and look up the gender var for atoms:0

Its not just the Gender I am after...Its that I dont know how to set this up properly..You know, the setting of Gender for a list of certain Characters.
I think this does what you want...if not, you'll just have to be more specific!

var/list/MaleChars = list("Supperman","Baitman","Amazing Hulk")
var/list/FemaleChars = list("Supperwoman","Baitwoman","Alice in Wunderland")
var/list/NeuterChars = list("The Blob","The Clown","Fried Chicken")

mob/proc/PickGender()
var/chosen_gender
switch(alert("Decide your gender!") in list("Male","Female","None"))
if("Male") chosen_gender = MaleChars
if("Female") chosen_gender = FemaleChars
if("None") chosen_gender = NeuterChars
var/character = input("Choose your character!") in chosen_gender
usr << "You are [character]"


Then just add a switch based on their character variable's string, and go from there.
In response to Foomer
Ok, I will try this, thanks Foomer

Lee
Hmm...I aint really good at making my own login's but the errors are as follow:

loading mygame.dme
mygame.dm:40:error:switch :invalid expression
mygame.dm:41:error::expected a constant expression
mygame.dm:43:error::expected a constant expression
mygame.dm:45:error::expected a constant expression

mygame.dmb - 4 errors, 0 warnings (double-click on an error to jump to it)



The login is as follows:

#include <deadron/characterhandling>
client
script = "<STYLE>BODY {background: teal; color: silver}</STYLE>"
base_num_characters_allowed = 3

world
mob = /mob/players
name = "No name right now so :P"
view = 6

#define BASE_MENU_CREATE_CHARACTER "Create New Character"
#define BASE_MENU_DELETE_CHARACTER "Delete Character"
#define BASE_MENU_CANCEL "Cancel"
#define BASE_MENU_QUIT "Quit"
mob
Login()
src.PickGender()

var/list/MaleChars = list("Guy","Guy1","Guy2")
var/list/FemaleChars = list("Lady","Lady1","Lady2")
var/list/NeuterChars = list("Who","Who1","Who2")

mob/proc/PickGender()
var/chosen_gender
switch(alert("Decide your gender!") in list("Male","Female","None"))
if("Male") chosen_gender = MaleChars
if("Female") chosen_gender = FemaleChars
if("None") chosen_gender = NeuterChars
var/character = input("Choose your character!") in chosen_gender
switch()//Error here
if(chosen_gender == "Male")//Error here
alert("Chose your male character")
if(chosen_gender == "Female")//Error here
alert("Chose your female character")
if(chosen_gender == "None")//Error here
alert("Chose your none genderised character")
usr << "You are [character]"

mob
players
MaleChars
Guy
icon = 'characters.dmi'
icon_state = "3"
race = "Human"
Guy1
icon = 'characters.dmi'
icon_state = "5"
race = "Human"
Guy2
icon = 'characters2.dmi'
icon_state = "2"
race = "Human"
FemaleChars
Lady
icon = 'characters2.dmi'
icon_state = "10"
race = "Human"
Lady1
icon = 'characters2.dmi'
icon_state = "19"
race = "Human"
Lady2
icon = 'characters2.dmi'
icon_state = "20"
race = "Human"
NeuterChars
Who
icon = 'characters2.dmi'
icon_state = "3"
race = "Something"
Who1
icon = 'characters2.dmi'
icon_state = "9"
race = "Something"
Who2
icon = 'characters2.dmi'
icon_state = "7"
race = "Something"

mob
var
race = ""
gender = ""



Can anyone help me out here please?

Lee
In response to Mellifluous
The empty swtich() is giving you problems because in the particular code you're using it, you've got this:
switch()
if(thevar == "value 1") ...
else if(thevar == "value 2") ...
...

With those ifs, the switch is useless. But I believe what you really want is this:
switch(thevar)
if("value 1") ...
if("value 2") ...
...

Basically, the error is caused by the empty switch(). It's expecting switch(var).

Lummox JR
In response to Lummox JR
Lummox JR wrote:
The empty swtich() is giving you problems because in the particular code you're using it, you've got this:
switch()
> if(thevar == "value 1") ...
> else if(thevar == "value 2") ...
> ...

With those ifs, the switch is useless. But I believe what you really want is this:
switch(thevar)
> if("value 1") ...
> if("value 2") ...
> ...

Basically, the error is caused by the empty switch(). It's expecting switch(var).

Lummox JR

Ok, thanks Lummox, I will try this :)

Lee
In response to Mellifluous
Well, I am back again hehe. This time Lummox, I have changed my Character Creation as the switches where alittle too hard to grapple with...So I changed them to input. The problem now is that the character is logged in the game now but he/she gets now icon nor icon_state. None the less, the Create Character comes up but the Choose Gender and what not does not come up anymore.

Here is the code:

#include <deadron/characterhandling>
client
script = "<STYLE>BODY {background: teal; color: silver}</STYLE>"
base_num_characters_allowed = 3

world
mob = /mob/players
name = "No name right now so :P"
view = 6

#define BASE_MENU_CREATE_CHARACTER "Create New Character"
#define BASE_MENU_DELETE_CHARACTER "Delete Character"
#define BASE_MENU_CANCEL "Cancel"
#define BASE_MENU_QUIT "Quit"
mob/player
Login()
src.PickGender()
usr.loc = locate(1,1,1)


mob/proc/PickGender()
var/char_name = key
var/mob/new_mob
var/gender = input("Decide your gender!") in list ("Male","Female","None")
if(gender == "Male")
var/maleguy = input("Choose your male character please.") in list ("Guy","Guy1","Guy2")
if(maleguy == "Guy")
new_mob = new /mob/players/MaleChars/Guy
if(maleguy == "Guy1")
new_mob = new /mob/players/MaleChars/Guy1
if(maleguy == "Guy2")
new_mob = new /mob/players/MaleChars/Guy2
if(gender == "Female")
var/female = input("Choose your femanine character please.") in list ("Lady","Lady1","Lady2")
if(female == "Lady")
new_mob = new /mob/players/FemaleChars/Lady
if(female == "Lady1")
new_mob = new /mob/players/FemaleChars/Lady1
if(female == "Lady2")
new_mob = new /mob/players/FemaleChars/Lady2
if(gender == "None")
var/none = input("Choose your neuter character please.") in list ("Who","Who1","Who2")
if(none == "Who")
new_mob = new /mob/players/NeuterChars/Who
if(none == "Who1")
new_mob = new /mob/players/NeuterChars/Who1
if(none == "Who2")
new_mob = new /mob/players/NeuterChars/Who2
new_mob.name = char_name
src.client.mob = new_mob
del(src)

mob
players
MaleChars
Guy
icon = 'characters.dmi'
icon_state = "3"
race = "Human"
Guy1
icon = 'characters.dmi'
icon_state = "5"
race = "Human"
Guy2
icon = 'characters2.dmi'
icon_state = "2"
race = "Human"
FemaleChars
Lady
icon = 'characters2.dmi'
icon_state = "10"
race = "Human"
Lady1
icon = 'characters2.dmi'
icon_state = "19"
race = "Human"
Lady2
icon = 'characters2.dmi'
icon_state = "20"
race = "Human"
NeuterChars
Who
icon = 'characters2.dmi'
icon_state = "3"
race = "Something"
Who1
icon = 'characters2.dmi'
icon_state = "9"
race = "Something"
Who2
icon = 'characters2.dmi'
icon_state = "7"
race = "Something"

mob
var
race = ""


Lee
In response to Mellifluous
Thanks to Cinnom my Character Creation works now.

I would like to thank all who participated in helping me and I am sorry I didnt click on sooner.

Lee