cohMoonPhase.SetValue((GameDaysPassed.Value + ( GameHour.Value / 24 ) - 0.5)% 24 )
That line of code is identical to one found in the Oblivion mod Curse of Hircine, except for the updated syntax, and yet its telling me that you cannot calculate the modulus of a non-integer.
Here's the Curse of Hircine version:
set phaseday to ((GameDaysPassed + (GetCurrentTime/24) - 0.5)%24)
The only problem I can think of is maybe that Oblivion automatically rounded when calculating the modulus of a value, though using the floor() command (with "math" imported) doesn't seem to help, for some reason it returns a number it most certainly shouldn't : 18 on the night of a waning gibbous moon, which corresponds to a waning crescent moon.
I'd appreciate any help anyone who can provide in solving this problem. It's really the last big issue preventing the mod I'm working on from being releasable.