Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Variable Restrictions >/< and OR/NOT

7 years ago

Working with a variable called %ZX I have a series of links on the same page each adding 1 to the variable with a link script. The page to which they lead ultimately leads back to the prior page, the page in question.

There are two links on that page with variable restrictions tied to %ZX. These restrictions are as follows:

link one): ZX > 0 OR
link two): ZX > 1 OR

In both cases, even when %ZX = 0 both links are available to the reader. I designated ZX to be visible on every page so I could better isolate the issue. I am sure that the problem lies in the restriction. I also tried the following:

ZX >= 1 OR
ZX >= 2 OR

ZX < 0 OR
ZX < 1 OR

In each of these cases the links are allowable even when %ZX = 0.

Could anyone tell me what might be the problem? I'm not sure where my input is going wrong here. Earlier in the story I used a restriction using = NOT and it went off without a hitch. Is the issue here with my misunderstanding of OR?

Variable Restrictions >/< and OR/NOT

7 years ago

You need one fewer OR than the number of conditions you're testing for. So since you've only got one condition per link, you don't need the OR at all.

Variable Restrictions >/< and OR/NOT

7 years ago

Yes! I just discovered that. Thank you kindly, now I can rest assured.

Using:

ZX < 0 NOT
ZX < 1 NOT

Seems to produce the desired result, but I didn't understand why the OR restriction did not function as I intended.  "the link will not be restricted if the condition is met or if all other conditions are met"

It's the "If all other conditions are met" clause that's catching me here. Since all other conditions are met, in this case being zero other conditions, the links are permissible. I've simply been misinterpreting the prompt.

Variable Restrictions >/< and OR/NOT

7 years ago

I'm not even sure how you were using OR that way to being with. You only can make one check per variable via link restrictions so far as I'm aware.

Unless you were doing ZX > 0 then just checking the OR box beside it, in which case the result was probably always resulting in true, since the OR didn't have a second variable to check. That would explain why even at ZX = 0 both would appear.

I do find it funny your solution involves doing a double negative to get the same result though lol.

Variable Restrictions >/< and OR/NOT

7 years ago

I had been doing as you were describing, checking only OR. I realize now why that did not work.

Is there another way that you would suggest setting the link restriction?

Variable Restrictions >/< and OR/NOT

7 years ago
The checkboxes are optional. If you say XR > 1 then the link will only be active if XR is greater than 1.

If you start adding multiple conditions, then all the conditions must be true for the link to be active. You can use OR to change that so only some of them have to be true. Using NOT just makes it the reverse, so XR = 4 NOT means the link will be active if XR is equal to anything but 4.

Variable Restrictions >/< and OR/NOT

7 years ago

Ooh...

Thanksss....