Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

$PAGETEXT

11 years ago

Hello- I'm new to this forums.

Question maybe is a bit stupid, but i been trying figure it out on my own for whole day and... with no luck.

I read: Basic scripting& Advanced scripting and all the other articles, but i guess I'm just stupid... 

$PAGETEXT := "This text is added before the original page description. " + $PAGETEXT

This code, as far as i understood, i need so beginning of one page changes depending on choice that the player made. And rest of the page is the original text that doesn't changes. 

Where should i put this code? When i copy it in Edit Link Script next to link- nothing happens to the page when i preview it.  

Sorry if i have missed something obvious. 

 

$PAGETEXT

11 years ago

$PAGETEXT has to go in the Page Script (the := on the upper left of the page, when you have the right level of scripting enabled).

BTW you can also use %%VARIABLE%% directly on a page to show its value and even conditionally, shuch as:

%%VARIABLE%<%500%YOUR TEXT HERE...%%

The above showing 'your text' if the %VARIABLE is less than 500.

$PAGETEXT

11 years ago

 (the := on the upper left of the page, when you have the right level of scripting enabled).

I tried but all i got is " Did not expect '(EOF)'. Col=10"

$PAGETEXT

11 years ago

Is that everything in the page script?

$PAGETEXT

11 years ago

Yes... When i copy $PAGETEXT and click save script widow pops up saying couldn't save script due to error and then then there is thet red text under the widow to the right where i coped $PAGETEXT

$PAGETEXT

11 years ago

I'm really confused by what you mean here. Copy everything in the script and paste it here, if you haven't already done so.

$PAGETEXT

11 years ago

in there, that is it... i'm a noooooooob, sorry. 

$PAGETEXT

11 years ago

What Killa is asking, is that you show us exactly (word for word) what you pasted into the script box that caused the error message.

Just post it here in this thread and he or someone else can tell you if there was a syntax error or something.  :)

$PAGETEXT

11 years ago

$PAGETEXT

$PAGETEXT

11 years ago

.......................

I'm not even sure what this is supposed to mean lol. Go to page script, copy everything inside of it, paste it here.

If that's all you have on the page script then of course you're getting an error, because $PAGETEXT alone isn't a script.

$PAGETEXT

11 years ago

A use for $PAGETEXT would be to add a conditional bit of text to a page. If you are not trying to do that or if the %%VARIABLE%% thing is working for you, then you don't even need to use $PAGETEXT.

For example: (on a page with the word "Bacon"

IF %BACON = 1 THEN $PAGETEXT := "Sizzling" + $PAGETEXT
IF %BACON = 0 THEN $PAGETEXT := "No" + $PAGETEXT

Will show "Sizzling Bacon" (OR) "No Bacon", depending on the %BACON Variable.

But you could also just type "%%BACON%=%0%No%%%%BACON%=%Sizzling%% Bacon" right onto the page for the same thing.

You only really need the $PAGETEXT thing for complex conditions that you can't do with the %%VARIABLE%% functionality - such as:

IF %BACON = 1 AND %PAN = 1 THEN $PAGETEXT := "Sizzling" + $PAGETEXT
IF %BACON = !1 OR %PAN = !1 THEN $PAGETEXT := "No" + $PAGETEXT

$PAGETEXT

11 years ago

bacon

$PAGETEXT

11 years ago

BTW using %%VARIABLE%<%500%YOUR TEXT HERE...%%

What you have to do so the background isn't little bit pinkish 

$PAGETEXT

11 years ago

Not sure, as I don't see that when i use it. But it could be something in the editor that lets you know it is code rather than plain text.

Check the actual page in the story reader to make sure (it should not show there I presume)...

$PAGETEXT

11 years ago

Okay, thank you were much! You helped me a lot.