Quote Originally Posted by alpaca
No, I don't think that'd save time. Using my system, the game will execute exactly one trigger per attribute, using yours it will execute all.
Anyways, it probably doesn't really matter, we're talking about microseconds here.

Anyways, the trait is capped at 9 I think (well in R:TW the max number of levels per trait was 9), does anybody have an idea which values the Trading attribute takes?
True, executing a bunch of triggers is clearly worse, don't know what I was thinking, I'm supposed to know better than that. Maybe that was a bad day.

Trading attribute takes on the actual percent value of the guy's bonus to trade. If the game says it's a 10% bonus, that trait affects Trading by +10. Usually a guy gets an amount from a trait that's divisible by 5, but I know I just saw some 2s in there, meaning you're probably talking about a range of possible values [-95, 95]. Some may in fact not be possible totals, but I'm not about to go find that out. If I just checked correctly then 95 is the upper bound (i.e. max possible from all traits that can give bonus to Trading).

Based on those values, the most natural system to me would be to implement 9 levels of TradePenalty and 9 levels of TradeBonus. You'd threshold the levels at 1 point intervals, so the 9 levels are Threshold 1 - 9. Then simply divide the Trading attribute by 10 and truncate to get the right number of trait points to give (just a fancy way of saying we'll just use the tens digit of Trading). Since we can't do math, even simple integer division, it's easiest to partition the Trading range to simulate said math, since we easily know the results:

I'll notate as [Trading range] -> (TradePenalty, TradeBonus).

...
[-29, -20] -> (2, 0)
[-19, -10] -> (1, 0)
[-9, 9] -> (0, 0)
[10, 19] -> (0, 1)
[20, 29] -> (0, 2)
...

I'm sure you can easily extrapolate to the needed range. This corresponds to triggers with conditions like "Condition Attribute Trading >= -29 and Attribute Trading <= -20" which would then award TradePenalty 2 points.

One could of course instead opt to let TradeBonus and TradePenalty take on the actual value of Trading, and then Threshold at 10/20/30/40... in order to achieve the same effect. However since there seems to be no way to directly assign that value to the trait, it would involve ~10 times as many triggers for no good reason I can see (1 trigger per Trading value, instead of 1 per 10 values that I proposed above).

With an appropriate amount of time to spend, similar logical partitions can be applied to all of the attributes we're interested in.

As for crunching out code based on this, I have to say I'm not exactly chomping at the bit. Even if you automate all those triggers you still also have to write the corresponding descriptions to make the trait levels have text in-game, and it just doesn't seem worth it to me for the minor benefit it provides. I'm much more captivated by actively shooting down persistent and annoying game bugs at the moment, at least as best we can with our limited tools. So while I'm gonna say I won't champion this particular project, I'll certainly help as much as I can if someone else has a mind to take it on. And even if not, I'll certainly keep talking about it, as I'm enjoying the discussion