Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Variable Text

18 years ago

      I was thinking... it would be cool if the editor had the option of saying the variable on the page or letting you type in a message on top of the page.

EXAMPLE

HUNGER is 20%

or

   You should eat something soon...

    Like, if HUNGER is between 10 and 40 print "You should eat something soon..." Know what I mean?

Variable Text

18 years ago

it is already there, here is how you do it:

HUNGER is the variable name, lets the value of hunger is 20, and you want that as a percent, on the pages description, type:

% %%HUNGER%%, now this is confusing but the first "%" is the "% 20", the "%%HUNGER%% is how you display the variable, so if you were to just say %%HUNGER%%, it would display 20, but because the extra % is there, it displays % 20. Now if you wanted to have, if hunger is below 40, you should eat something soon, this is it:

%%HUNGER%<%40%You Should eat something soon%%

Note that hunger is the variable and it appears first, the operator, <, means less than, and its less than 40, the text afterwards is what is displayed.

There is?

18 years ago
   Cool! If only it wasn't so confusing.

There is?

18 years ago
its not once u get used to it.

There is?

18 years ago
But where do I type the text..... thingy?

There is?

18 years ago
Well, Alex says he's going to make the scripting for this better.

There is?

18 years ago
Chekc N&U.

There is?

18 years ago
Huh?

There is?

18 years ago

News&Updates.

Is Huh ur favorite word?

There is?

18 years ago
Yep.

There is?

18 years ago

Just for clarifications -- Scripting (definition: modifying gamestate with Script Code instead of using editor) will not help with this. 

This will involve Conditional Text. Here is what Conditional Text might look like:

Blah blah blah, text on a page.

[DISPLAYIF %SCORE=10 AND %HEALTH=20] You are healthy and have a good score[/DISPLAYIF]

[DISPLAYIF %HEALTH < 10] You are not so healthy[/DISPLAYIF]

Your health is [DISPLAY %HEALTH]

Does that make sense to everyone?

There is?

18 years ago
Makes sence i just need individual codes.

There is?

18 years ago
thats much easier, but make sure that when this is released, to change all the stuff in the articles that relate to this material, or is the old syntax (seems like the word of the day) goign to remain (%%VAR%<%10%fndkf%%)

There is?

18 years ago

Old syntax will have to stay due to it being used. Butyeah w'ell have to update articles

There is?

18 years ago
no it's too hard

There is?

18 years ago
[DISPLAYIF
   This part starts the display if part.

%SCORE=10 AND %HEALTH=20
    This part is the conditional.  This has to be true.

]
    Ends the Conditional.

You are healthy and have a good score
   This is the text to be displayed.

[/DISPLAYIF]
    This is how you end all BB Code.  This is like BB code.



[DISPLAY %HEALTH]
    This is how you display a single variable.

I would like it to be something like this:  [DISPLAYIF %VAR=1 && %VAR2=1 || %VAR3=1
&& means AND
|| means OR.

There is?

18 years ago
I get a lot of this scripting stuff, I just don't know where to put it. Where do you put it?