Stat help


#1

ok so not sure how to do something in choicescript.
the problem that im having is i can’t get the stats to show the name im not sure how to do it, i have read the wiki but i still have no clue. i keep getting told line 2: Non-existent variable ‘name’ when i click on the stat button
this is what i have in my stat txt file:
*stat_chart
text name


#2

now you go to mygame.js inside the my game folder and add the stat under the stat chart there


#3

almost at the end there is this thing it goes like this :


// Specify the default starting stats here

stats = {
   name: "unkown"
   ,sex: "unkown"
   ,swordfighting: 0
   ,archery: 0
   ,strength: 0
   ,intelligence: 0
   ,sky: 0
   ,sea: 0
   ,earth: 0
   ,weapons: "none"
   ,other: "none" 
};

// Specify the stats to use in debug mode

these are my stats for the game so u just have to put name and if ur going to let the player choose the name then do name: “unkown”

do u get wat iam saying ???


#4

yep thank you thats really helped me


#5

no prob and you might also want to do this otherwise the stats will show twice
after the stats there r debug stats

instead of keeping it like this:


// Specify the stats to use in debug mode

// debugStats = {
            name: "none"
   
};

// or just use defaults
// debugStats = stats

change it to:


// Specify the stats to use in debug mode

debugStats = {
        name: "none"
};

// or just use defaults
// debugStats = stats


#6

ok i will do that and again thank you


#7

no prob :stuck_out_tongue:


#8

wat is ur games name?


#9

not got one yet, im mostly trying to learn choicescript for a news years resolutions which is to learn a skill of some kind (i know that its a bit early but i wanted to get the basics done first)


#10

lol don’t rush i started making my game the first day i sign up i learned the basics in about 2 hours and then i just rushed and made a demo and it was horrible i had to restart it twice all ready


#11

ok if u need anymore help ask me :wink: