b4nth4f3tt Posted June 6, 2013 Share Posted June 6, 2013 I need some help understanding how conditions are evaluated in perks.I am creating a mod to allow daedric-artifacts to be counted towards the matched set bonus regardless of their armor material. My confusion arises when trying to modify the criteria that the Matched Set perk uses to determine whether or not a set matches. The logic of the perk looks roughly like this:if( WornApparelKeywordCount(ArmorMaterialLeather) == 4, OR WornApparelKeywordCount(ArmorMaterialFur) == 4, OR etc.)ArmorRating = ArmorRating * 1.25 Which is pretty straight forward. If the character is wearing four pieces that have the same light armor material keywords then they are wearing a matched set. This is how I want the logic of the perk to look:if((WornApparelKeywordCount(ArmorMaterialLeather) == 4, OR WornApparelKeywordCount(ArmorMaterialFur) == 4, OR etc.) OR (WornApparelKeywordCount(DaedricArtifact) == 1 AND (WornApparelKeywordCount(ArmorMaterialLeather) == 3, OR WornApparelKeywordCount(ArmorMaterialFur) == 3, OR etc.))ArmorRating = ArmorRating * 1.25 Here I want to change the logic so that the armor bonus is applied if there are four matching pieces, or if there are three matching pieces and one daedric artifact. The problem:I don't see a way to nest conditions. The original perk conditions are just a series of OR statements. If any of them are evaluated to be true, the bonus is applied. If I add a condition looking for a daedric artifact as an OR statement, then if they wear any daedric piece they will get the bonus regardless of what else they are wearing. If I add the daedric artifact requirement as an AND... I honestly don't know what will happen. I don't understand if AND applies simply to the next condition, or if it applies to all subsequent conditions. The conditions are listed like this:1 Daedric Artifact AND4 Leather OR4 Glass ORetc. So basically, does it logically evaluate to this:1 Daedric Artifact AND (4 Leather OR 4 Glass OR etc.) = Bonusor this:(1 Daedric Artifact AND 4 Leather) OR 4 Glass OR etc. = Bonus Any help is appreciated. If this is the wrong place to post a request of this type please let me know. Link to comment Share on other sites More sharing options...
stschwarz Posted June 6, 2013 Share Posted June 6, 2013 The problem:I don't see a way to nest conditions. The original perk conditions are just a series of OR statements. If any of them are evaluated to be true, the bonus is applied. If I add a condition looking for a daedric artifact as an OR statement, then if they wear any daedric piece they will get the bonus regardless of what else they are wearing. If I add the daedric artifact requirement as an AND... I honestly don't know what will happen. I don't understand if AND applies simply to the next condition, or if it applies to all subsequent conditions. The conditions are listed like this:1 Daedric Artifact AND4 Leather OR4 Glass ORetc. So basically, does it logically evaluate to this:1 Daedric Artifact AND (4 Leather OR 4 Glass OR etc.) = Bonusor this:(1 Daedric Artifact AND 4 Leather) OR 4 Glass OR etc. = Bonus Any help is appreciated. If this is the wrong place to post a request of this type please let me know. Hi,to clarify your problem read this in the CK Wiki.So your conditions will evaluate as: Artifact AND (Leather OR Glass) Link to comment Share on other sites More sharing options...
Recommended Posts