Profit from Effects

xKiv

Active member
Yes, but you seem to be adding combat_rate (which seems to be combat rate - positive when it increases combats) to freq[$monster[none]] (which is noncombat rate - negative when it increases combats) and then using that as a noncombat rate.
In the script, rate2 is what multiplies value of noncombat, and increasing combat_rate increases rate2, and combat_rate is increased by casting musk of the moose/cantata (also, combat_rate starts as the current numeric_modifier('Combat Rate') [plus combat rate of the considered effect, when applicable], which is positive when it increases combats). So it would seem that, say, shrugging cantata (combat_rate += 5 in the script) places higher weight on value of noncombat and lower weight on value of combat, which is exactly the opposite of what should happen (and exactly what BlanketThief is observing and reporting as possible bug).
 

Theraze

Active member
Sounds good. Here's a version with the +combat turned to -combat and another -combat added to the end of rate1. Let me know how it goes. :D
 

Attachments

  • profit_fx.ash
    21.1 KB · Views: 45

xKiv

Active member
I think you might have forgot some parentheses.
Code:
float rate1=freq[$monster[none]] < 100 ? ((100-(freq[$monster[none]]-combat_rate)*(noncombats[wear].NC_count/(noncombats[wear].NC_count+noncombats[wear].skip)))/(100-freq[$monster[none]]-combat_rate)) : 0;
should probably be
Code:
float rate1=freq[$monster[none]] < 100 ? ((100-(freq[$monster[none]]-combat_rate)*(noncombats[wear].NC_count/(noncombats[wear].NC_count+noncombats[wear].skip)))/(100-(freq[$monster[none]]-combat_rate))) : 0;

Also, I am not trying it out, just reading the code.

Also, still doesn't explain why castle would have higher NC value than C value ... is that with negative modifiers or something?
 

Theraze

Active member
You ARE aware that with subtraction and subtraction, 100-freq-combat == 100-(freq-combat), right? :)
 

Theraze

Active member
Wow, my maths are failing hard at the moment. Was reading that differently... yeah, so this version does that. Amusingly, if the parenthesis had just been removed, we could have gone with +combat in the first place.
 

Attachments

  • profit_fx.ash
    21.1 KB · Views: 48

Theraze

Active member
So... the reason why it didn't do the second -combat was to avoid this:
Division by zero (profit_fx.ash, line 406)
So... here's a version with that division removed.
 

Attachments

  • profit_fx.ash
    21.1 KB · Views: 55
Top