WatchNon-threaded

Forums » Advanced Editor Forum » Read Message

Talk about it. Ask for help on it. Compliment it.

Variable Display

19 days ago

So I know that if you want to show a variable on a page you put %%VARIABLE%%, but what if I want it to show the number of the variable, plus one?

I made it so that on a story, when you turn twelve months old(when variable MONTHS goes above 11), it will bring you to a page saying "You are _ years old!", but instead of a blank, it will say your age. When you click "Back to the Story", the variables update, and MONTHS will be reset to zero, and YEARS will have 1 added to it.

I can't put %%YEARS%% in the blank, because then it will say "0 years old" when you turn one year old.

Variable Display

19 days ago

Just do it in a page script.

$PAGETEXT := "<p>You are " + %YEARS + 1 + " years old.</p>"

Variable Display

19 days ago

Somehow this post caused the text below it to change...

Variable Display

19 days ago

Sheesh. One missed slash and this happens.

Variable Display

19 days ago

So I put that on the "You are one year older" page's script? And everything there, or do I get rid of something...?

Variable Display

19 days ago

Yeah. That should be it.

Variable Display

19 days ago

Thank you!

Variable Display

19 days ago

Um, now it's pretty much this: %%YEARS%%1

It's just putting one at the end of the number.

Variable Display

19 days ago

So it does. Guess I went a little too minimalist. All you need are some parentheses.

$PAGETEXT := "<p>You are " + (%YEARS + 1) + " years old.</p>"

Variable Display

19 days ago

Okay. I'll try that.

EDIT: Yep, that worked, thanks!