One thing (bug?) that always gave me problems with NoM is the GetWaterLevel function. This function should be used to determine if an object is above or below the water level, but it has a heavy problem: if used in an interior cell that doesn't have water this function still returns a value, making the check unreliable. I know for sure that this problem is common to other mods as well, so I thought to find a solution, if possible.
I did a little testing and I discovered what follows.
If you get an interior cell with no water (Abaelun Mine, for example) a simple script checking the water level will tell you that you are under water, and that the water level is 0.
So I opened the cell properties in the CS and:
- enabled water (the water level is effectively above the cell ground)
- changed water level to -15000
- disabled water
Loaded the game and ta-daaaa! I'm now above water and the water level is -15000, even if there's no water in the cell.
So basically, it seems that GetWaterLevel effectively returns the exact water level even if water is disabled. But it seems too that if you change the water level and then disable water again, the new water level is remembered and returned. The weird thing is that, after disabling water, the water level for the cell is 0 (greyed out) in the CS and -15000 in game.
The solution is simple, maybe a bit boring: parse the interior game cells without water and lower their level if needed.
I have a few questions though:
1) Anyone can see problems in my idea? I don't want to change the water level of a thousand cells and the discover that it was useless.
2) Is there a mod that already does this?
3) What are the possible conflicts? Will this conflict with mods that change the light settings for the cells, since light and water settings are in the same tab, or the 2 changes will be merged? Changes to a cell usually get merged when loading, but for changes to a cell properties I'm not so sure...