Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

And/Or logic with Variables

7 years ago

I've got a few questions regarding the and/or/not logic with variables.

There's a few variables in my storygame now and I'm using the variable restriction links for one case (let's call the variables A, B and C):

(variable A = 1) and (variable B = 1) and (variable C >= 3)

I'm fine with this condition. But what about when I want to say the opposite? As in, put a "Not" next to the line above. I don't mean variable A has to be a different number, or that any of them have to be a different number, just make sure that the condition above is false.

I'm theorising that the way to do this might be to use the Or/Not checkboxes and say:

not (variable A = 1) or not (variable B = 1) or not (variable C >=3)

But I'm not sure how true this would be, this is just based on my understanding of rules of logic in general. I'm also not sure if this is strictly how the Or/Not checkboxes would function, they might simply negate each variable at a time which isn't what I want.

 

A second question I have is how to do variable restrictions upon the condition that two variables are equal to one another. The variable restriction only seems to let me restrict it to a set of values, whereas I want the condition to be Variable A = Variable B, for example.

I can't see how to do this without adding a dozen new options along the lines of (variable A = 1 and variable B = 1), (variable A = 2 and variable B = 2) which is a major headache when there's a lot of possible values. Is there a workaround involving scripting maybe?

And/Or logic with Variables

7 years ago
That correct, although there's no reason to say not (C >= 3) when you can just say (C < 3). Use it for not equals instead.

I don't know why you would start using "or" instead though. The condition above being false would still have to consist of ANDs, assuming all three conditions have to not be the number you're talking about.

"Value - must either a valid number (-22, 8, 0, etc) or a variable name (HEALTH, SCORE, etc). When using "In List", a comma-separated list of numbers or variables can be entered. Eg: "22,SCORE,18,-4,0""

Literally says that at the bottom of the variable restriction page. You're not just restricted to numbers, you can also use variable names.

And/Or logic with Variables

7 years ago

No, the three conditions don't necessarily have to be false individually. It's just that I don't want them all to be true at once. i.e. variable A could be true, variable B could be false, variable C could be true, and that would still trigger it off.

But the "In List" does answer my second question, thanks for that. I was wondering how it worked.