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 AND 4 Leather OR 4 Glass OR etc. So basically, does it logically evaluate to this: 1 Daedric Artifact AND (4 Leather OR 4 Glass OR etc.) = Bonus or 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...
jackowonderful Posted June 6, 2013 Share Posted June 6, 2013 have you tried making a separate effect for the one starting with the 'daedric artifact and'? Link to comment Share on other sites More sharing options...
blacksupernova Posted June 6, 2013 Share Posted June 6, 2013 In CK, OR takes priority over AND, so it's 1 Daedric Artifact AND (4 Leather OR 4 Glass OR etc.) = Bonus Link to comment Share on other sites More sharing options...
b4nth4f3tt Posted June 6, 2013 Author Share Posted June 6, 2013 (edited) have you tried making a separate effect for the one starting with the 'daedric artifact and'? I had tried that before and couldn't add any new conditions once I created the new entry, but I just tried again and I realized it was because I had Quest selected instead of Entry Point. /facepalm However I am still curious about the logic thing. Can you explain how AND statements are evaluated? Edit: Thanks, blacksupernova. Edited June 6, 2013 by b4nth4f3tt Link to comment Share on other sites More sharing options...
b4nth4f3tt Posted June 6, 2013 Author Share Posted June 6, 2013 (edited) So I tried creating a new perk entry, so now there are two, but whatever I put in one just overwrites the other. I think this is because there is only one rank to the perk. Edit: Changing the priority of one of the entries allowed me to make it unique. Are priorities evaluated lowest to highest? Edited June 6, 2013 by b4nth4f3tt Link to comment Share on other sites More sharing options...
Recommended Posts