Conditions, order of operations?

Post » Thu Jun 21, 2012 12:40 pm

I want to have a set of conditions on a spell that looks like this:


IsHostileToActor == 1 (and)
GetDead == 1 (and)

Here is the tricky part. I also want IsBleedingOut == 0 (and) but only when IsEssential == 1 is true

How do I do that?
User avatar
adam holden
 
Posts: 3339
Joined: Tue Jun 19, 2007 9:34 pm

Post » Wed Jun 20, 2012 11:51 pm

To put it more simply, how do I do:

((A or (B and C)) and (D and E))
User avatar
Damned_Queen
 
Posts: 3425
Joined: Fri Apr 20, 2007 5:18 pm

Post » Thu Jun 21, 2012 7:55 am

Are you sure you have that right? From your first post, it's more like:

A && B && ((!C && D) || C)

where A is hostile, B is dead, C is bleeding out, and D is essential.

From the http://www.creationkit.com/Category:Conditions#Comparison, you can think of "AND" as "+" and "OR" as "*".

A + B + ((!C + D) * C)A + B + (!C * C) + (D * C)A + B + (D * C)A + B + C * DA && B && C || D

So it should work if you have your conditions set like this:

IsHostileToActor == 1 AND
GetDead == 1 AND
IsBleedingOut == 1 OR
IsEssential == 1 (either)
User avatar
Brandon Bernardi
 
Posts: 3481
Joined: Tue Sep 25, 2007 9:06 am

Post » Thu Jun 21, 2012 1:18 am

Oops, big typos. I meant:

((A or (B and C)) and (D and E))

A is IsEssential == 0
B is IsEssential == 1
C is IsBleedingOut == 0
D is IsHostileToActor == 1
E is GetDead == 0


I will give your suggestion a shot, thanks so much!
User avatar
Haley Cooper
 
Posts: 3490
Joined: Wed Jun 14, 2006 11:30 am

Post » Thu Jun 21, 2012 2:15 am

you have to set it up something like this (it's been a long time since i've done the complex conditions, it was a massive headache):


D and
E and
A and
D or
E and
B and
C and


or maybe it was


D and
E and
A or
D and
E and
B and
C and


i forgot if the OR should be at the end of the "parenthases" group or at the top. either way you have to duplicate the stack as ive shown in order for that first "and" block to work like you have in parentheses


basically you need to fit 2 stacks of conditions

getDead == 0 And
isHostile == 1 And
isEssential == 0 And

getDead == 0 And
isHostile == 1 And
isEssential == 1 And
isBleedingOut == 0 And

they need to be joined by an OR somewhere, either at the bottom of the first group, or the top of the 2nd group.

User avatar
Jessie Rae Brouillette
 
Posts: 3469
Joined: Mon Dec 11, 2006 9:50 am

Post » Thu Jun 21, 2012 1:21 pm

I tried randomnoobs suggestion and it didnt work. The effect only applied to essential actors which isnt what I want. I basically just want to cancel the effect if the actor is essential and starts bleeding out, but not cancel it if the actor bleeds out but is not essential, on top of the other stuff.
User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm

Post » Thu Jun 21, 2012 11:51 am

Your suggestion didn't quite work either. Putting or at the end of the first stack made the spell hit non-essentials only and canceled the spell when they started bleeding out, and putting or at the beginning of the second stack made the spell not hit anything.
User avatar
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Thu Jun 21, 2012 7:44 am

So what you mean is that this is a magic effect with these conditions?

IsHostileToActor() && !GetDead() && !(IsEssential() && IsBleedingOut())

Brain's not working today...

So the conditions are:

1. IsHostileToActor == 1
2. GetDead == 0

and then any one of these conditions:

3. IsBleedingOut && !IsEssential
4. IsEssential && !IsBleedingOut
5. !IsEssential && !IsBleedingOut

So if we say:

A = IsHostileToActor
B = GetDead
C = IsBleedingOut
D = IsEssential

Our expression should be something like:

A && !B && ((C && !D) || (!C && D) || (!C && !D))
User avatar
CArla HOlbert
 
Posts: 3342
Joined: Wed Feb 21, 2007 11:35 pm

Post » Thu Jun 21, 2012 6:31 am

Exactly. How do I put those parentheses around the isessential and isbleedingout, haha!
User avatar
Courtney Foren
 
Posts: 3418
Joined: Sun Mar 11, 2007 6:49 am

Post » Thu Jun 21, 2012 4:22 am

I tried to convert it to math and do it:

A && !B && ((C && !D) || (!C && D) || (!C && !D))A + !B + ((C + !D) * (!C + D) * (!C + !D))A + !B + (((C * !C) + (C * D) + (!D * !C) + (!D * D)) * (!C + !D))A + !B + (((C * D) + (!D * !C)) * (!C + !D))A + !B + ((C * D) * (!C + !D)) + ((!D * !C) * (!C + !D))A + !B + ((!C * C * D) + (!D * C * D)) + ((!C * !D * !C) + (!D * !D * !C))A + !B + (!C * !D) + (!D * !C)A + !B + (!C * !D)A && !B && !C || !D

Which means something like this:

IsHostileToActor == 1 AND
GetDead == 0 AND
IsBleedingOut == 0 OR
IsEssential == 0

No matter how I look at it though, it doesn't seem right.
User avatar
Cedric Pearson
 
Posts: 3487
Joined: Fri Sep 28, 2007 9:39 pm

Post » Thu Jun 21, 2012 9:57 am

Screw it. I'll just script it in. This wouldn't be a problem I don't think if AND had priority over OR or if they just came up with a better system for conditions.
User avatar
Cartoon
 
Posts: 3350
Joined: Mon Jun 25, 2007 4:31 pm

Post » Thu Jun 21, 2012 3:17 am

Certain condition combonations, like what you may be trying to do, are impossible using the normal conditions editor. It can only handle a reasonably simple array of conditions. Complex conditions requires Papryus to really pull off. What I end up doing, is making (for example) a dummy spell that acts as the container for the real spell. So the dummy spell might have a script on it, and all the script does is add the REAL spell effect to the player, under X conditions/if-statments

The same general priciple applies to all sorts of things. Such as what I do to add a perk to the player that has complicated conditions I want to check for, is to add a dummy perk to the player (the one the actual player selects, but it does nothing). Then in a script I attach to the player, it checks for this perk. Once it detects it, I have it check for all my conditions, and if true, add the magic effect ability of the perk to the player. If not true, it'll remove said ability.
User avatar
Nana Samboy
 
Posts: 3424
Joined: Thu Sep 14, 2006 4:29 pm

Post » Thu Jun 21, 2012 12:47 am

if my suggestion did not work (multiple stacks), then it is impossible to do in the conditions function, as the second stack only applies to the first condition in that stack, leaving the rest of the stack to throw a wrench in the whole thing (lame unfortunately).
User avatar
Heather Dawson
 
Posts: 3348
Joined: Sun Oct 15, 2006 4:14 pm


Return to V - Skyrim