Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Erroneous script

8 years ago

Somehow, the script I need to use is not working.

This is what I have on the script of the link leading to the page where text has to change.

 

IF %MALEELF = 1 THEN
BEGIN
IF %MANNERS >= 5 THEN
BEGIN
%GREETING := 1
END
ELSE
BEGIN
%GREETING := 2
END
END

IF %ELF = 0 THEN
BEGIN
IF %MANNERS >= 5 THEN
BEGIN
%GREETING := 3
END
ELSE
BEGIN
%GREETING := 2
END
END

 

And this is what should be changing. Somehow, I always get the second greeting, no matter my character's stats.

 

%%GREETING%=%1%you bow before the elf king, and acknowledge him with the tittle of "your majesty"%%%%GREETING%=%2%you extend your hand to shake the king's. He lifts a brow%%%%GREETING%=%3%you curtsey before the elf king, and acknowledge him with the tittle of "your majesty"%%%%

 

The idea here, is males and females greeting the proper way formally. A bow for males, a curtsey for females. That is, if they got enough enough manners up to that point. Else, they will be inadvertently rude to the king.

Erroneous script

8 years ago
The ELSE statement is a little buggy. Which is why I never use it.

Erroneous script

8 years ago
"No matter what"

Well the script looks fine. Are you sure that %MANNERS actually is equal to or above 5?

Erroneous script

8 years ago

Yes, it is.

Erroneous script

8 years ago
So what is its value when it runs?

Erroneous script

8 years ago
Give us the values of %MALEELF,%ELF, and %MANNERS when it runs.

Erroneous script

8 years ago

Uhm, sorry. I accidentally deleted part of the variable when I copied it to the forum thread. There is no %elf variable, just %maleelf

maleelf is 1, and manners is 5

Erroneous script

8 years ago
Try this:

IF %MALEELF = 1 THEN
BEGIN
IF %MANNERS >= 5 THEN
BEGIN
%GREETING := 1
END
IF %MANNERS < 5 THEN
BEGIN
%GREETING := 2
END
END

Erroneous script

8 years ago

It is good, but I need three greetings. One for well mannered males, one for well mannered females, and a generic one for rude elves.

Erroneous script

8 years ago
Try this: IF %MALEELF = 1 THEN BEGIN IF %MANNERS >= 5 THEN BEGIN %GREETING := 1 END IF %MANNERS < 5 THEN BEGIN %GREETING := 2 END END IF %MALEELF = 0 THEN BEGIN IF %MANNERS >= 5 THEN BEGIN %GREETING := 3 END IF %MANNERS < 5 THEN BEGIN %GREETING := 2 END END

Erroneous script

8 years ago

I validate the script before closing and saving, and it accepts it. When I follow the story and reach the script page, it shows this:

you nervously walk until you are a few steps away from the throne, and %%. (only two %% where the greeting should be)

Erroneous script

8 years ago
%%GREETING%=%1%you bow before the elf king, and acknowledge him with the tittle of "your majesty"%%%%GREETING%=%2%you extend your hand to shake the king's. He lifts a brow%%%%GREETING%=%3%you curtsey before the elf king, and acknowledge him with the tittle of "your majesty"%%%%

You have too many %% symbols. It's this:

%%GREETING%=%1%you bow before the elf king, and acknowledge him with the tittle of "your majesty"%%%%GREETING%=%2%you extend your hand to shake the king's. He lifts a brow%%%%GREETING%=%3%you curtsey before the elf king, and acknowledge him with the tittle of "your majesty"%%

Erroneous script

8 years ago

Greetings turned invisible when I play the story. I will instead separate the greetings into several pages and work with just variables. I do not have enough hair left for another try.

Erroneous script

8 years ago
If it turns invisible then none of the conditions are being met properly.

You're probably doing something like running your Greeting script in the page script, rather than the link script on the page before like I told you in our PMs.

The script itself is fine, you're just using it wrong.

Erroneous script

8 years ago
Killa is right. If you put them on the page script, it doesn't run until the next page. If you want them to run right after you click the link, you have to put them in the link script.