I’m having problems with choicescript(as you probably guessed) and here is my code:
*create pgsfnd 0
*create pgsfndttl pgsfnd + “/20”
Look, I’m trying to get it so that if ‘pgsfnd = 1’ then pgsfndttl is ‘1/20’. But whenever I start up my story it says: 'line 25: Invalid create instruction, value must be a a number, true/false, or a quoted string: pgsfndttl pgsfnd + “/20” ’
If you were looking for a numeric variable, e.g. pgsfnd 16/20 = .75, then you want
*create pgsfnd 0
*create pgsfndttl pgsfnd/20
If you wanted a string using the two, which I finally understand is what you’re going at, use an ampersand, not an addition symbol, when joining string variables. As such…
*create pgsfnd 0
*create pgsfndttl pgsfnd&"/20"
I hope I clarified that for you!
EDIT: If you ever want to just check/test small bits of code without having to play through your story, use CJW’s Online CS Tester. It’s kinda invaluable.
@MetaKraid
You can’t reference another variable when using *create. You’ll have to either create pgsfndttl with a value of 0 and *set it on the next line, or… actually I’m not sure what you’re trying to do with that “/20”. Is that supposed to stay a string of text or did you want to divide something by 20?
If you wanted to put it in a *stat_chart, here’s what I might do…
choicescript_stats.txt
*temp pgsfndttl pgsfnd&"/20"
*stat_chart
blahotherstatsblah
text pgsfndttl Pages Found
That way you don’t have that extra pgsfndttl all the time and it automatically sets up each time they check their stats. All you ever have to *set is the pgsfnd, when a page is found.
Edit: I’m just assuming pgsfnd means you’ve… found a… page.