Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Variable help needed!

9 years ago

Hi. I have an upcoming game that uses variables and I want to know two things.

1) How do I display the variable in the game text?

e.g. Your final score is 200

2) How do I change the game text based on the variable?

e.g. If score >100:

"You did very well."

if score <100:

"you did not do very well."

Variable help needed!

9 years ago
Hi,
1. Just put %%SCORE%% to show it in the page text. In the actual story viewer it will show up as a number, not the %%SCORE%% you typed in the page text.
2. Damn it's not displaying right. Look at BerkaZerka's on-page variable tricks to know how to do it.

Variable help needed!

9 years ago

To the left of your title, you will see something like this ":="

Click that. Once you click it, a page will pop up. Inside the page, type this 

If %SCORE > 100 THEN

BEGIN

$PAGETEXT := "You did very well."

END

 

IF %SCORE < 100 THEN

BEGIN

$PAGETEXT := "You did not do very well."

END

 

If you want to display the variable in the game text, then type this in your game text,

Your final score is %%SCORE%%

Variable help needed!

9 years ago
Um, no. much, much easier than that. Read this article

Thx!

9 years ago

I'll try that tomorrow. :)

Thx!

9 years ago
That only works if you have scripting enabled. My way is easier.

Thx!

9 years ago

I have scripting enabled for my game.

Thx!

9 years ago
Also, if you want that to be right in the middle of the page text, like the "You didn't do very well" thing or whatever, than your gonna have to use the article I linked to in an earlier poste because the script replaces the page text with that statement