SimpleRandomizerMaker icon indicating copy to clipboard operation
SimpleRandomizerMaker copied to clipboard

Math in Rules

Open dethwing opened this issue 11 months ago • 0 comments

I'm having some trouble using math in the rules section. Here's an example.

Rule( description="Legend Sword Logic", left_side=[ (value("elder_firestorm")+128),(value("elder_elixer")+128),(value("Legend_Sword")+128), value("Old_Axe"),value("Fire_Urn"),value("Charmstone_Chest"),value("Power"),value("Star_Key"),value("Oasis_Boots") ], rule_type="count", right_side=("==",128,"==",1) ),

I want exactly one of these 7 values to result in the value that creates a particular item called the "Legend Sword". The issue is that for the first 3, that value is 0, and for the other 4, that value is 128.

So I thought I had hit upon a solution by adding 128 to the first 3 and asking the rule to make exactly one is 128. However, after a few trial generations, I got the following seed:

Charmstone_Chest : 128 [0x80] Legend_Sword : 0 [0x00]

Which is not what I had in mind. It seems the rule is ignoring the +128 inside each parenthesis, and just comparing each to 128. Any thoughts on how I could correct this?

Thank you.

dethwing avatar Jan 23 '25 16:01 dethwing