View Single Post
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old March 16th, 2018, 10:51 AM
Yeah, never ran into that issue before but I can see what's happening.

I've tried looking deeper in a copy of Darkvision and there's a few lines that go:

Code:
        ~ If we've found a copy other than ourselves, then add the abValue2
        ~ field from that copy to our own abValue2 field.
        if (eachpick.uniqindex <> uniqindex) then
          field[abValue2].value += eachpick.field[abValue2].value
          endif
So after it runs on Dark Velocity dark velocities darkvision totals are:
abValue = 60
abValue2 = 60 + 30 = 90

When the code runs on Nighteye
abValue = 30
abValue2 = 30 + 60 = 90

Then due to timing on the darkvision scripts we calculate distance, which I missed the first time.

So highest abValue plus abValue2 is 150 rather than the 120 you expected.

I'm thinking that items that extend darkvision might need to have a line of script that runs and checks to see if the character has darkvision before assigning an abValue2 number.

The hero tag [Hero.HasDarkVis] gets assigned in First/5000, but the calculations for distance occur in Final/10000. So I think just add some code that runs maybe in pre-levels that checks for the tag and if the tag is there, add an abValue2 to the darkvision that's bootstrapped to the ability... Would take some playing around to get it right...

Maybe ShadowChemosh or a dev wants to chime in and make sure I got the logic right this time? Actually I don't think that would work necessarily either, but just trying to figure it out...

Last edited by dungeonguru; March 16th, 2018 at 11:04 AM. Reason: fixed a confused self
dungeonguru is offline   #5 Reply With Quote