Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

What am I doing wrong?

5 years ago

I typed this into the Global Page script:

$PAGETEXT := $PAGETEXT + "<br><br>"
$PAGETEXT := $PAGETEXT + "<b>Hit Points:</b> "+%PLYRHP+" / "+%PLYRMAXHP + "<br><br>"
$PAGETEXT := $PAGETEXT + "<b>Experience Points:</b> "+%EXP+" / "+%MAXEXP + "<br><br>"
$PAGETEXT := $PAGETEXT + "<b>Coins in Wallet:</b> "+%COINS+" / 500
IF $ITEMSTATE05 = 1 THEN
BEGIN
$PAGETEXT := $PAGETEXT + "<br><b>Arrows in Quiver:</b> "+%ARROWS+" / "+%MAXARROWS
END

EDIT: I forgot to mention, it says this when I click validate:  Did not expect '<'. Line=7 Col=27 

What am I doing wrong?

5 years ago
You can't do random divisions like that in page text.

What am I doing wrong?

5 years ago

Random divisions? What do you mean?

What am I doing wrong?

5 years ago

You're just missing double quotes after the 500.

$PAGETEXT := $PAGETEXT + "<br><br>"
$PAGETEXT := $PAGETEXT + "<b>Hit Points:</b> "+%PLYRHP+" / "+%PLYRMAXHP + "<br><br>"
$PAGETEXT := $PAGETEXT + "<b>Experience Points:</b> "+%EXP+" / "+%MAXEXP + "<br><br>"
$PAGETEXT := $PAGETEXT + "<b>Coins in Wallet:</b> "+%COINS+" / 500"
IF $ITEMSTATE05 = 1 THEN
BEGIN
$PAGETEXT := $PAGETEXT + "<br><b>Arrows in Quiver:</b> "+%ARROWS+" / "+%MAXARROWS
END

What am I doing wrong?

5 years ago
On line 7, column 27 you mean?

What am I doing wrong?

5 years ago

The problem begins with the unclosed string on line 4. The subsequent lines are thus also interpreted as a valid part of the string until finally closed by the instance of double quotes on line 7. Now outside of the string, an error is thrown because a < is only valid as part of a conditional.

What am I doing wrong?

5 years ago
That was me doing a sarcastic 'amazing, the error is found where the red text says the error is' bit, you didn't have to get all technical gosh.

What am I doing wrong?

5 years ago

Understandable. Wasn't sure; erred.

What am I doing wrong?

5 years ago

Thank you everybody! I just checked, the only thing I need to change is another <br> to seperate the coins from the arrows to match the rest. Or maybe they can be all just one line below the other, rather then a blank in between. At any rate, your answers helped!