Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Page Script Conditional Statement

7 years ago

Hi there. I'm having a problem getting the following script to work on page script.

IF %JOSEOPI<25 AND %DAVIDOPI<5 AND %ANNAOPI<25 THEN $PAGETEXT := "Unfortunately, it seemed that none of the villagers trusted Bob enough to ask him along for their daily activities."

I would like all three conditions to be met before the page text is replaced by that which is in quotations. When I play test this however, the text never appears no matter what I do. Are you not allowed to use AND in a page script? If so, how do I get the intended effect?

Any help would be appreciated!

Thanks.

Page Script Conditional Statement

7 years ago
I believe AND is broken for more than one operation (A N B), so (A N B N C N..) won't really work. You'll have to use if/then chains

Page Script Conditional Statement

7 years ago

Ah I see. Thanks so much. Managed to solve it by using this:

IF %JOSEOPI<25 THEN IF %DAVIDOPI<5 THEN IF %ANNAOPI<25 THEN $PAGETEXT := "Unfortunately, it seemed that none of the villagers trusted Bob enough to ask him along for their daily activities."

Oddly enough, I had to use Then-If chains for all the variables rather than just for the last one (even though it should work with 2 operations) as the below script did not work:

IF %JOSEOPI<25 AND %DAVIDOPI<5 THEN IF %ANNAOPI<25 THEN $PAGETEXT := "Unfortunately, it seemed that none of the villagers trusted Bob enough to ask him along for their daily activities."

Regardless, thanks for the help!

Page Script Conditional Statement

7 years ago
Yeah, AND's been wonky for a while now, good to hear you figured your way out