Shrine of Kynareth

Oblivion. 10% Playing, 90% Modding.

Modding Woes #2: Fire && Embers

December 1, 2019 General

This is gonna be somewhere between a rant and an update.
So I used the command "ResetInterior" for my tent, which is described as: "Marks the cell as expired so that the next time the game is saved or the player enters the cell, it will be cleaned up as if several days have passed."

Just that... it doesn't. In Oblivion, this is only used for the Arena after matches, completely resetting the interior. If you wait for several days and the interior gets cleaned up, containers respawn, food respawns, but stuff you dropped will still be there.
If you use the ResetInterior command... everything that was dropped or placed in the cell will be gone.

I didn't notice this, since I didn't drop anything, I decorate with statics for a reason. A user noticed and commented on it. Cue me spending about a week or more trying to type around that. I tried putting all plants in an array, and resetting them with "SetHarvested" which says:
Mark or unmark the calling reference as having been harvested. Notes: Changes are saved in the savegame.
Just that... they aren't. If I harvested a plant, used SetHarvested 0 and update3d on them, everything was fine, until I saved and reloaded. Then the plant would be harvested again. So much for saving the changes in savegame, I guess.

I finally solved it by modifying the cell reset timer - just as if the player had been away for several days. Setting it to 0 for a reset, and to max for when the cell should not be reset. And somewhere, someplace in the last few lines, I must have forgotten a && in an if statement, which the compiler didn't catch, but caused an error ingame. So the script died, instead of doing scripty things. I noticed this when looking at something else, because MessageLogger caught it.

Now the real question, do I upload an update just to add &&.

I decided not to and instead spent a few hours changing the campfire like I wanted before. Now it has 3 stages:

  The fire is off
 The fire is off
The fire is burning, wood changes texture
The fire is burning, wood changes texture
After 4 hours (or manually) the fire burns down, leaving glowing embers
After 4 hours (or manually) the fire burns down, leaving glowing embers

This will not happen with the magic fire patch and I have not yet put in a way for the embers to automatically disappear. Perhaps I won't.
I'll test it a bit and then release an update, hopefully this time not forgetting a || somewhere or anything.


Welcome to my little place where I talk about playing Oblivion, and about modding Oblivion, and about making mods for Oblivion and about ...