[Not Implemented] "Or" and "And" option for criteria

In this forum you can submit wish list items for the Custom Story Creator. If you are stuck in your story and need the ability to do something that the tool currently does not offer, this is the place to post a request to build a way to do it into the Story Creator.
Forum rules
Forum rules
No racism, sexism, anti-semitism, brigading, doxxing, or ANY form of abusive behavior. No discussion of hacking or piracy or the buying, trading, or selling of ANY type of product or service (digital or otherwise). No advertising of any product or service (digital or otherwise, and this includes streams or any service involving 'subscribers'). No discussion of religion or politics. Do not link to other adult sites, with the exception being discussion of other adult games in Offtopic/allowed subforums; i.e. no pornography.

Do not spam, do not try to circumvent any automated tools that are part of these forums or any linking to these forums. Do not judge others based on their preferences for custom stories, their opinions, sexuality, etc., and most certainly do not bring it to the moderators.

Respect the moderators and each other and all will be well. Report any violations of the above rules. Do not violate local or international laws (including, but not limited to the laws of your country and/or the laws of the United States) while making use of these forums. The IP address of all posts are recorded to aid in enforcing these conditions.

We will use username, e-mail, AND IP bans without reservation, and mods hold the final word in such decisions.
Post Reply
mada7
Posts: 47
Joined: Tue Feb 13, 2018 7:43 pm

[Not Implemented] "Or" and "And" option for criteria

Post by mada7 » Tue Mar 13, 2018 6:06 pm

I saw this mentioned in the previous forum but having an option to have separate groupings of criteria so that if I want to have the same dialogue option or event trigger occur under mutually exclusive circumstances I can. As examples Id want to be able to do stuff like this

{criteria 1 AND 2 AND 3}
or
{criteria 4 AND 5 AND 6}

criteria 1
AND
{criteria 2 OR 3}

This can sorta be done currently but requires a lot of clunk modify value manipulations and duplication of work

peter980
Posts: 231
Joined: Thu Feb 15, 2018 1:50 am

Re: [Not Implemented] "Or" and "And" option for criteria

Post by peter980 » Wed Mar 14, 2018 4:19 am

I concur.
Lack of OR this really makes it difficult to do more complex triggers.

.

One of the workarounds I use is to create event which just checks some conditions (AND) and sets the flag at the end.

And then running that event and then checking for negative version of that flag to run some other action is essentially OR condition. But this is really clunky and I would rather avoid using something like this.

Erock
Posts: 17
Joined: Mon Mar 12, 2018 10:59 pm

Re: [Not Implemented] "Or" and "And" option for criteria

Post by Erock » Wed Mar 14, 2018 9:59 am

That's because in programming computers can't really understand (criteria 1 and 2 and 3). Try doing
( A and B ) and (A and C)

So it is possible. But requires only comparing two things at "once"
The problem could be fixed by operator overloading but that requires source code.
I hope that helps.

mada7
Posts: 47
Joined: Tue Feb 13, 2018 7:43 pm

Re: [Not Implemented] "Or" and "And" option for criteria

Post by mada7 » Thu Mar 15, 2018 8:30 pm

Erock wrote:
Wed Mar 14, 2018 9:59 am
That's because in programming computers can't really understand (criteria 1 and 2 and 3). Try doing
( A and B ) and (A and C)

So it is possible. But requires only comparing two things at "once"
The problem could be fixed by operator overloading but that requires source code.
I hope that helps.
That's not correct at all. I've written programs with if(A == 1 && B == 2 && C == 3) both C# and Javascript (the two scripting languages unity supports) support that kind of condition. It's also already currently supported in the game. You can put as many conditions on a trigger or dialogue option as you want

Erock
Posts: 17
Joined: Mon Mar 12, 2018 10:59 pm

Re: [Not Implemented] "Or" and "And" option for criteria

Post by Erock » Fri Mar 16, 2018 12:24 am

mada7 wrote:
Thu Mar 15, 2018 8:30 pm
Erock wrote:
Wed Mar 14, 2018 9:59 am
That's because in programming computers can't really understand (criteria 1 and 2 and 3). Try doing
( A and B ) and (A and C)

So it is possible. But requires only comparing two things at "once"
The problem could be fixed by operator overloading but that requires source code.
I hope that helps.
That's not correct at all. I've written programs with if(A == 1 && B == 2 && C == 3) both C# and Javascript (the two scripting languages unity supports) support that kind of condition. It's also already currently supported in the game. You can put as many conditions on a trigger or dialogue option as you want
I misinterpreted what you meant. Sure that works. I thought you were comparing "objects".

erasmus
Posts: 280
Joined: Tue Feb 13, 2018 4:29 pm

Re: [Not Implemented] "Or" and "And" option for criteria

Post by erasmus » Mon Mar 19, 2018 7:06 pm

We can certainly look into making conditions and criteria more graceful. I believe we already have at least one ticket in for cleaning up and adding to such functionality but I will verify and add to it if necessary :D
Erasmus
Quality Control and User Experience Manager

Kevner
Posts: 13
Joined: Wed Mar 21, 2018 5:01 am

Re: [Not Implemented] "Or" and "And" option for criteria

Post by Kevner » Wed Mar 21, 2018 8:35 am

mada7 wrote:
Tue Mar 13, 2018 6:06 pm
I saw this mentioned in the previous forum
I think that was me. I remember blarting a thread's worth of going round in circles thinking out loud about logic gates, trying to get a single choice from a possibility of many. When I'm thinking about this stuff it makes more sense to me in electronics terms rather than programming, but the principle is the same.

Thinking about it now, for the OR function, if the context is simple, all you might need is that seperate event that checks it, with two identical event or dialogue triggers inside but with different criteria

1 > Criteria 1 & 2 & 3
2 > Criteria 4 & 5 & 6

Or for the other example

1 > Criteria 1 & 2
2 > Criteria 1 & 3

Either one, or both, will pass if each criteria is met. If you want it more discerning, it starts to get messy.

Logic gates can be done in many combinations to have the same end result, and all gates can be emulated using just NAND gates (Not AND) but that can get complex. This means that since we can use 'does not equal' and similar negative criteria, theoretically problem solved.
The problem with that solution is that you need to have an event or dialogue trigger line for every combination that's possible. Two binary options means four combinations. Four options means 16 combinations.
The simple AND logic is what we have, just having two or more criteria together. To turn this into a NAND gate to do the rest you need separated criteria for 1 yes and 2 no, and 2 yes 1 no (and maybe even 1 no 2 no, and 1 yes 2 yes) feeding into each one.
It takes 3 NAND gates to build an OR choice. It takes 4 NAND gates to build an exclusive OR choice.

If you want to trigger a different dialogue when criteria 1 and 2 are both met, but criteria 3 is not met, or anything similar, it's best laid out a binary truth table. Each line can be whatever event or dialogue trigger you want, the same or different, and each one has three criteria. Binary 0 is negative criteria (does not equal/has not been shown/not in inventory etc.) and binary 1 is naturally positive (has/had/did)

C1 C2 C3
0 0 0 -no criteria are met
0 0 1
0 1 0 - only criteria 2 is met
0 1 1
1 0 0
1 0 1 - criteria 1 and 3 are met, but not 2
1 1 0
1 1 1 - all criteria have been met

You don't need to use every combination, if not triggering any dialogue doesn't make it seem impolite in game context, but otherwise you'd need to do it for each one. Remember, 4 variables is 16 rows. 5 is 32. Nobody wants to go down that path.

However, if you only need a handfull of combinations from 32 (or more!!) and you want a specific dialogue to trigger for the rest of the possibilities, you could have each success option create a value that records a success (equals 1) and then triggers an event that starts the negative/incomplete dialogue with the condition that the success value does not equal 1.

I'm writing all this for my own future reference too, but I hope it helps some others understand things.

Post Reply