Jump to content

Geck AND and OR conditions on terminals, consumables and etc. (briefly, not scripting)


MrKeytil

Recommended Posts

This isn't a support post, more like an informative post. I don't really know if it really works like that, i'm just writing what i figured out by trying almost all of them.

 

Let's say you have 3 conditions

HasPerk        | Perk: YourPerk       | == | 1.00 | OR

HasPerk        | Perk: WhiskeyRose    | == | 1.00 | AND

GetIsReference | Reference: PlayerRef | == | 1.00 | AND

If player has YourPerk but not WhiskeyRose, it's true and vice versa. It works kinda like this

(Condition1 OR Condition2) AND Condition3

 

I think the one on bottom doesn't count, only first and second ones (that of course depends on your list, it might be bigger)

 

Please write a comment if i'm wrong and tell me the right part, this thing is so confusing i can't really figure out much. Also if you have a good source to learn geck, please leave it in comments (not geck.bethsoft because they don't have everything, geck wiki is just a copy of geck.bethsoft with a different style so don't mention it either)

Link to comment
Share on other sites

Use parentheses to group the pairs you want evaluated first: By default it evaluates left to right, but with parens it's "innermost first". So your conclusion of (Condition1 OR Condition2) AND Condition3 is correct for default behavior. But if you grouped them by (Condition1 OR (Condition2 AND Condition3)), it wouldn't matter if either of the AND conditions were False, as long as Condition1 was True.

 

There are various tutorials linked, along with many "TIPS" of "lessons learned" in the "Scripting" and "Dialog" sections of the wiki "Getting started creating mods using GECK" article.

The GECKWiki is the only one which has the latest functions added by plugins to NVSE, as well as refinements and new discoveries that are not posted to the old Bethsoft site because it was such a pain to edit. Many things look like the same info, until you happen upon the differences.

 

-Dubious-

Link to comment
Share on other sites

Use parentheses to group the pairs you want evaluated first: By default it evaluates left to right, but with parens it's "innermost first". So your conclusion of (Condition1 OR Condition2) AND Condition3 is correct for default behavior. But if you grouped them by (Condition1 OR (Condition2 AND Condition3)), it wouldn't matter if either of the AND conditions were False, as long as Condition1 was True.

 

There are various tutorials linked, along with many "TIPS" of "lessons learned" in the "Scripting" and "Dialog" sections of the wiki "Getting started creating mods using GECK" article.

 

The GECKWiki is the only one which has the latest functions added by plugins to NVSE, as well as refinements and new discoveries that are not posted to the old Bethsoft site because it was such a pain to edit. Many things look like the same info, until you happen upon the differences.

 

-Dubious-

I know the conditional statements in geck scripting, they're not much different from other programming languages's conditional statements, not so hard to understand. However i can't understand the conditions on a perk or terminal or something else similar. I can't add scripts to perks (or maybe i can, i don't really know) so i have to use this weird menu bethesda gave me

Link to comment
Share on other sites

Yeah, I hear you. I dislike "form-based programming" as well. Failed to pick up on that being the underlying cause of your question.

 

AFAIK, you can only construct a straightforward "left to right evaluation" conditional statement. No nesting, and each condition is "compounded" to the following statement (if any) by the final field logical (except of course for the very last statement, where it is ignored). However, I haven't any experience with the use of the "<<"/">>"/"new" buttons at the bottom of the "Conditions" field of that form. Perhaps they lead you to a more complex structure? (Though from what I have seen of the record "Conditions (CTDA) structure" in FNVEdit, they didn't expect Perks to get very complex conditions.)

 

-Dubious-

Link to comment
Share on other sites

Pretty sure the arrows are just shift the highlighted condition up/down the read list.

 

So not only left to right , but top to bottom ... for reading ... right ???

 

So it would seem you could just follow the protocol of "OR" separating the "AND" 's

in groups down the list ?

 

But beyond a few conditions , would be better to multi way weed your scenario down into an all around use of the tools , rather than a choke point use ... if that makes sense ?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...