I’m having trouble with allowing the player to boost some stats at the start of the game
The error I’m getting is twofold- it is possible to input More AP than you have. For example, you have 6 ap points to play with, you can add 4 to luck and have 2 left BUT still add 4 to skill
and the option to reset doesn’t reset, I have used *set command to return the values to the original state but this doesn’t work
*label init
*temp ap 6
*temp skill_limit 4
*temp stamina_limit 6
*temp luck_limit 4
*label choose_stats
You have ${ap} AP left to spend to increase your stats. Which stat do you want to increase
*choice
#Skill
How many AP will you spend to increase skill? (1 - ${skill_limit})
*input_number stat1 1 skill_limit
*set skill +stat1
*goto adjust_ap
#Stamina
How many AP will you spend to increase stamina? (1 - ${stamina_limit})
*input_number stat1 1 stamina_limit
*set stamina +stat1
*goto adjust_ap
#luck
How many AP will you spend to increase luck? (1 - ${luck_limit})
*input_number stat1 1 luck_limit
*set luck +stat1
*goto adjust_ap
#I'm finished spending AP
*goto done
#Reset stats and AP
*set skill 8
*set stamina 17
*set luck 8
*goto init
*label adjust_ap
*set ap -stat1
*if ap < 1
*goto done
*if skill_limit > ap
*set skill_limit ap
*if stamina_limit > ap
*set stamina_limit ap
*if luck_limit > ap
*set luck_limit ap
*goto choose_stats
*label done
*goto_scene club
Don’t know tbh. I couldn’t see anything glaringly wrong so I copied it into CS and ran it, worked fine for me. I was unable to allocate more points than the limit. Might be worth putting some lines of code in there to print the values as you’re allocating them, just so you can see what’s happening at each choice.
Just in case: Where are you running this? Is it in startup.txt or did you put it into choicescript_stats? If it’s in choicescript_stats, all variables reset when you exit back to the game.
Didn’t you already create a topic for this problem? Wasn’t it fixed then?
Edit: I tried to look through your game files, and there are a lot of files with choosing stats sequences similar to this. Are you sure the file you are using for the game currently has the version you show here?
I’m stumped, but there have been times where I have been completely baffled by an error only to realize that I spelled something differently in startup or whatever. Maybe try triple and quadruple checking the spacing and spelling on all your variables?
Thank you indeed, I have changed the file to choosestats. (code below)
I am afraid you can still add eg 4 to luck (leaving 2 ap) and then 4 to skill
Reset doesn’t reset
*label init
*temp ap 6
*temp skill_limit 4
*temp stamina_limit 6
*temp luck_limit 4
*label choose_stats
You have ${ap} AP left to spend to increase your stats. Which stat do you want to increase
*choice
#Skill
How many AP will you spend to increase skill? (1 - ${skill_limit})
*input_number stat1 1 skill_limit
*set skill +stat1
*goto adjust_ap
#Stamina
How many AP will you spend to increase stamina? (1 - ${stamina_limit})
*input_number stat1 1 stamina_limit
*set stamina +stat1
*goto adjust_ap
#luck
How many AP will you spend to increase luck? (1 - ${luck_limit})
*input_number stat1 1 luck_limit
*set luck +stat1
*goto adjust_ap
#I'm finished spending AP
*goto done
#Reset stats and AP
*set skill 8
*set stamina 17
*set luck 8
*goto init
*label adjust_ap
*set ap -stat1
*if ap < 1
*goto done
*if skill_limit > ap
*set skill_limit ap
*if stamina_limit > ap
*set stamina_limit ap
*if luck_limit > ap
*set luck_limit ap
*goto choose_stats
*label done
*goto_scene club
I think you have probably found the answer, I haven’t been linking to the right code - apologies if this is the case
I am fixing this but now needing to find out why notepad++ is not saving as a text file (sigh!)
Ok-, I am sorry I was linking to the old stats file, that is terrible I’m sorry
Inputting now works perfectly! Yay- reset doesn’t work, I may remove that option as it seems very problematic for what it is
Thank you for all your help (again!) and I will think about reset this week
Reset is very easy, I just used *set for the original values