src.SP=5
for(SP;SP>1;SP--)//SP being Stat Points.
switch(input(src,"Which statistic would you like to train? [src.sp] Stat Point(s) remain.",\
"Distribution")in list("Accuracy - [src.acc]","Constitution \
- [src.con]","Defense - [src.def]","Dexterity - [src.dex]",\
"Intelligience - [src.int]","Strength - [src.str]"))
if("Accuracy - [src.acc]")//Error: expected a constant expression</b>
src.acc+=1
/*else if("Constitution - [src.con]"); src.con+=1
else if("Defense - [src.def]"); src.def+=1
else if("Dexterity - [src.dex]"); src.dex+=1
else if("Intelligience - [src.int]"); src.int+=1
else if("Strength - [src.str]"); src.str+=1*/
Problem description: What I'm trying to do here is get the player to distribute their five SP/Stat Points to their Stats through a switch(input()). I want the player to be aware of their current stat point. Unfortunately, I'm getting an error: expected a constant expression.
I didn't think this was the right way to do it... but I was clueless so I just went with it.
Thanks!
I'm not sure how helpful I can be with this, but an if statement usually has to have something to evaluate and compare an answer to.
I believe the reason why your getting a "expected a constant expression" error is because your if statement isn't really comparing the evaluated answer to anything.
I'm not overly confident on how to fix the problem your having, or recommend an alternative (due to my own inexperience), but hopefully someone else with more experience comes along, or you could try moving this topic to Developer Help, you may get a better response there.