Jump to content

Condition Confusion - ANDs and ORs are giving me grief.


Recommended Posts

Every once in a while I'll get confused about how ANDs and ORs are supposed to function for condition checking. Possibly my wires are more than a little crossed from recent personal events, so please bear with me.

Anyway, what I am trying to do is relatively simple: condition some dialogue lines for a custom companion. He's not in the default system, so he can follow when another of the vanilla companions is engaged. The problem is, he's a talkative fellow who doesn't like many people.

He has lines specifically for when certain vanilla companions and other custom ones are around, but then he also has some lines that should only play when the others are not present--which is fine, except the conditions are not firing correctly, so the dialogue is playing when it should not. Either I am going to have to duplicate his lines and condition them individually for each companion he has thoughts about, or find a way to make the conditions work.

-   -   -   -   -   -   -

I tried using all ORs to check whether the companions in question were in the same vicinity as the player, but the dialogue still played regardless of the companions' locations.

Next, I tried using GetInFaction CurrentCompanionFaction for the vanilla followers using ORs. For this attempt, there are some extra AND conditions based on other criteria such as the player's level mixed in, and from what I can tell so far, the dialogue is not playing AT ALL. Using ANDs and ORs together always seems to have mixed results in my Skyrim mods; they either play nice together or play dead, so I suppose this is to be expected--it doesn't make it any less vexing, though.

Lastly, I tried using the GetInFaction CurrentCompanionFaction with all ORs for the vanilla companions yet again (but with no ANDs mixed in this time), but this caused the dialogue to play when it wasn't supposed to.

I am utterly confuzzled about how to proceed and would appreciate some insight. image.png.d885ad655d70c3621dabc6f46b6c73bc.png

If I have to end up duplicating his lines multiple times just to be foolproof with the conditions, then I'll grit my teeth and do it, but I am still hoping there is another option.

 

Link to comment
Share on other sites

Not familiar with Papyrus and/or strings but if they are anything like the workshop build condition strings i have found that mixing them always leads to the string breaking. the only way i have consistently gotten them to work is by putting all the "or' strings first and the "and" strings last. It might be possible to feather in the "and" strings if the first string is an "or" but one thing i know for sure is if you end the string with an "or" it breaks it. Might not be the same because the workshop conditions are open ended and closes itself on the last 'and" string.

  • Thanks 1
Link to comment
Share on other sites

5 hours ago, worm82075 said:

Not familiar with Papyrus and/or strings but if they are anything like the workshop build condition strings i have found that mixing them always leads to the string breaking. the only way i have consistently gotten them to work is by putting all the "or' strings first and the "and" strings last. It might be possible to feather in the "and" strings if the first string is an "or" but one thing i know for sure is if you end the string with an "or" it breaks it. Might not be the same because the workshop conditions are open ended and closes itself on the last 'and" string.

I wondered if the order they were placed had a part in it! Thank you for the tip.

Let me make sure I am understanding this correctly: When you say Or strings first and And strings last, do you mean the Ors are lowest and the Ands are highest? (Like in SKKmods' image below?) Or should it be visa-versa? 👀

5 hours ago, SKKmods said:

Gotta group them  and its always 50/50 if I configure the correct line to switch between them:

conditions.jpg

Thank you for posting an image! Now I have something to compare! 🔎

I have the CK open, so I'm going to do a quick check on the dialogue that has both Or and Ands mixed in.

Hmm... Okay, my Ors are high instead of low, and I think one of the conditions would be better off as an Or instead of an And. I will make those changes, and then revise it to look more like your screenshot.

Okay, I now have 4 Ands on top and 4 Ors below them. The Ands are all related to keywords and leveling, and the Ors are focused on whether some of the vanilla companions are in the CurrentCompanionFaction. I will test this out the next the chance I get.

 

Thank you both so much. I'm beginning to feel optimistic. 😊

Link to comment
Share on other sites

It doesnt actualy matter if the AND block or OR block come first.

To help with game engine load (fail fast) I just put the broadest filter at the top which could be AND or OR.

Ideally the order would be exactly from broad to specific, but interleaving AND OR statements becomes super messy.

 

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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