Hey, I am using Deadron's save file demo here.. I tried modifying it, but in-game both menu's I have made pop-up one after another for some reason..
var/list/gender = list("Male","Female")
help_text = "What is your gender?"
default_value = "Male"
var/char_gen = input(src, help_text, prompt_title, default_value) in gender
var/list/classes = list("Warrior","Mage","Monk","Thief","Paladin")
help_text = "Which class would you like to be?"
default_value = "Warrior"
var/char_class = input(src, help_text, prompt_title, default_value) in classes
var/list/fclasses = list("Mage","Warrior","Monk","Cleric","Thief")
help_text = "Which class would you like to be?"
default_value = "Mage"
var/char_fclass = input(src, help_text, prompt_title, default_value) in fclasses
var/mob/new_mob
switch(char_gen)
if("Male")
switch(char_class)
if ("Warrior")
new_mob = new /mob/warrior()
usr.str=16
usr.con=15
usr.wis=9
usr.int=10
usr.dex=11
if ("Mage")
new_mob = new /mob/mage()
usr.str=8
usr.con=11
usr.wis=14
usr.int=15
usr.dex=13
if ("Monk")
new_mob = new /mob/monk()
usr.str=14
usr.con=14
usr.wis=10
usr.int=11
usr.dex=8
if ("Thief")
new_mob = new /mob/thief()
usr.str=9
usr.con=12
usr.wis=11
usr.int=10
usr.dex=15
if ("Paladin")
new_mob = new /mob/paladin()
usr.str=14
usr.con=13
usr.wis=12
usr.int=12
usr.dex=10
new_mob.name = char_name
if("Female")
switch(char_fclass)
if ("Assassin")
new_mob = new /mob/fwarrior()
usr.str=15
usr.con=16
usr.wis=10
usr.int=11
usr.dex=13
if ("Monk")
new_mob = new /mob/fmonk()
usr.str=13
usr.con=14
usr.wis=11
usr.int=12
usr.dex=8
if ("Thief")
new_mob = new /mob/fthief()
usr.str=8
usr.con=12
usr.wis=11
usr.int=10
usr.dex=16
if ("Cleric")
new_mob = new /mob/cleric()
usr.str=7
usr.con=9
usr.wis=13
usr.int=15
usr.dex=12
new_mob.name = char_name
Then after u choose from both(the class list, so you could choose Monk.. then the same menu pops-up again so you could choose another class like Monk again, or Warrior for some reason), I think it's showing male(the one I choose), then showing females list after picking a class.
Also the player is created good except the stats still show 0?
Thanx for any help.
ID:150534
Sep 2 2001, 2:40 pm
|
|
In response to Deadron
|
|
That's because in the code you have one after the other with no conditions, as shown below. What are you trying to do?I tried moving a few things around.. but still the same, I did this last: var/list/gender = list("Male","Female") help_text = "What is your gender?" default_value = "Male" var/char_gen = input(src, help_text, prompt_title, default_value) in gender var/list/classes = list("Warrior","Mage","Monk","Thief","Paladin") help_text = "Which class would you like to be?" default_value = "Warrior" var/char_class = input(src, help_text, prompt_title, default_value) in classes var/mob/new_mob switch(char_gen) if("Male") switch(char_class) if ("Warrior") new_mob = new /mob/warrior() if ("Mage") new_mob = new /mob/mage() if ("Monk") new_mob = new /mob/monk() if ("Thief") new_mob = new /mob/thief() if ("Paladin") new_mob = new /mob/paladin() new_mob.name = char_name var/list/fclasses = list("Mage","Warrior","Monk","Cleric","Thief") help_text = "Which class would you like to be?" default_value = "Mage" var/char_fclass = input(src, help_text, prompt_title, default_value) in fclasses switch(char_gen) if("Female") switch(char_fclass) if ("Warrior") new_mob = new /mob/fwarrior() if ("Monk") new_mob = new /mob/fmonk() if ("Thief") new_mob = new /mob/fthief() if ("Cleric") new_mob = new /mob/cleric() new_mob.name = char_name Also the player is created good except the stats still show 0? I fixed this, just moved the stats under /mob/warrior etc. Thanx :) |
In response to Oblivian
|
|
Oblivian wrote:
I tried moving a few things around.. but still the same, I did this last: I'm not clear on what the problem is or on what it is you want to have happen. |
In response to Deadron
|
|
I want to be able to choose my class after logging in, then just let my char pop-up.. The problem is whenever I login, choose create a new char, and select my name.. Then when I choose a class between Warrior, Monk, etc. The menu pops-up again asking what class. The second menu that pops-up is the female class list. Which should only pop-up when I choose "Female".
|
In response to Oblivian
|
|
Oblivian wrote:
The second menu that pops-up is the female class list. Which should only pop-up when I choose "Female". And what are you doing in the code that tells BYOND "only pop up this menu if they chose Female"? |
In response to Deadron
|
|
Deadron wrote:
Oblivian wrote: if("Female") switch(char_fclass) if ("Warrior") new_mob = new /mob/fwarrior() if ("Monk") new_mob = new /mob/fmonk() if ("Thief") new_mob = new /mob/fthief() if ("Cleric") new_mob = new /mob/cleric() new_mob.name = char_name |
In response to Oblivian
|
|
Oblivian wrote:
And what are you doing in the code that tells BYOND "only pop up this menu if they chose Female"? Ah, so you are saying "If the text female, do this." What does that mean, do you suppose? Did you maybe mean to say if something EQUALS female? |
In response to Deadron
|
|
Ok, I get what you are saying.. but what is a constant expression? :{
|
In response to Oblivian
|
|
Oblivian wrote:
Ok, I get what you are saying.. but what is a constant expression? :{ It's a value that can't change...but not sure where it comes into this. |
In response to Deadron
|
|
Well, "Female" is a constant expression.
If he's doing something weird with his code, he could be having the compiler say it expected a constant expression. Not sure where or why, based on his previous postings, though. -AbyssDragon |
That's because in the code you have one after the other with no conditions, as shown below. What are you trying to do?
Probably because you are setting the usr's stats and not the new mob's stats.