I’m attempting to set up a system where the player can distribute attribute points between three stats. Right now I’m doing this by giving the player 30 tokens and three boxes, each box representing either Strength, Agility, or Intelligence.
Everything works well until I try to actually count how many tokens are in each box. I’m clearly doing something terribly wrong, but I’m not sure what.
This is the relevant bit of code (Strength, Agility, and Intelligence are the names of the containers):
To check for completion:
Let S be a number equal to the number of attribute points in Strength;
Let A be a number equal to the number of attribute points in Agility;
Let I be a number equal to the number of attribute points in Intelligence;
Let T be a number equal to S plus A plus I;
If T equals 30:
Now the player's Standard Strength is S;
Now the player's Current Strength is S;
Now the player's Standard Agiliy is A;
Now the player's Current Agility is A;
Now the player's Standard Intelligence is I;
Now the player's Current Intelligence is I;
say "A great bell rings out overhead.";
Say "You haven't distributed all your ability points yet!".
I’ve also attempted to use ‘Let S be a number equal to the number of things in Strength’ and ‘Let S be a number equal to the number of things contained by Strength’, with the same results.
For all of my ‘Let’ attempts (except for Intelligence for some reason, Inform doesn’t seem to have a problem with that one), I get this:
[code]Problem. In the sentence ‘Let S be a number equal to the number of attribute points in Strength’ , I was expecting to read a value, but instead found some text that I couldn’t understand - ‘a number equal to the number of attribute points in Strength’.
I was trying to match one of these phrases:
-
let (s - a new name) be (a number equal to the number of attribute points in strength - description of relations of values to values)
-
let (s - a new name) be (a number equal to the number of attribute points in strength - name of kind)
-
let (s - a new name) be (a number equal to the number of attribute points in strength - value)
-
let (s - a temporary named value) be (a number equal to the number of attribute points in strength - value)
This was what I found out:
S = something unrecognised
a number equal to the number of attribute points in Strength = something unrecognised
[/code]
How do I get Inform count the number of things in a container and turn that number into something I can work with?
Also, I’m only really going with ‘distribute physical points to physical containers’ to represent stats because I don’t want to go with a straight up menu choice (“Do you want to play a fighter, rogue, or wizard?”) or make the player figure out points in their head. If anyone knows of a better way to do this I’m all ears.