Jump to content

Flora Respawn VMAD


DayDreamer
 Share

Recommended Posts

Starting separate topic:

Actually I'm interested if it is a CK limitation or game doesn't support scripts there.
Midas Magic had VMAD attached to explosions which is impossible to do in CK. I don't know if it worked at all, but there is a possibility.
I can create a special version of TES5Edit which will allow to add VMAD to flora if someone is willing to test it in game.

Brilliant idea!

 

https://docs.google.com/file/d/0B4rR0C-Bcx_JTXlpWURkRFhwZU0/edit?usp=sharing
There is a script included that can copy VMAD from other records.
So copy as override some TREE record(s), select them, apply script, enter FormID of record with VMAD data to copy from.

I've tested -- AND IT WORKS!

 

I put a debug script on a standard flora (mushroom01), and copied it to the only in-game existing testtreeflora (bluemountainflower) -- found in a spriggan protected tower near Falkreath. Man oh man, those are tough to beat with a low level test character!

[10/20/2013 - 03:20:39PM] [florarespawnscript < (000F1DA6)>]OnActivate() [Actor < (00000014)>]

...
[10/20/2013 - 03:42:38PM] [florarespawnscript < (000978FD)>]OnActivate() [Actor < (00000014)>]

Arthmoor, are you interested for USKP?

Link to comment
Share on other sites

You'll need to explain in better detail precisely what it is you're doing here before I'd even consider it. At the moment, it sounds awfully hackish and still seems like it would result in losing the plant animations that exist. Losing the plant animations is not something I will accept for the USKP.

Link to comment
Share on other sites

You'll need to explain in better detail precisely what it is you're doing here before I'd even consider it. At the moment, it sounds awfully hackish and still seems like it would result in losing the plant animations that exist. Losing the plant animations is not something I will accept for the USKP.

Nope. Unlike BlueDanieru, Zilav's fix adds the script directly to the base object. So the base objects stay the same, the animations stay the same.

 

Otherwise, the existing script is pretty simple:

Scriptname FloraRespawnScript extends ObjectReference

Event OnActivate(ObjectReference akActionRef)
    debug.trace(self + "OnActivate() " + akActionRef)
    RegisterForSingleUpdateGameTime(Game.GetGameSettingInt("iHoursToRespawnCell"))
EndEvent

Event OnUpdateGameTime()
    debug.trace(self + "OnUpdateGameTime()")
    ObjectReference newObj = PlaceAtMe(GetBaseObject(), 1, false, true)
    newObj.SetScale(GetScale())
    newObj.SetAngle(GetAngleX(), GetAngleY(), GetAngleZ())
    newObj.Enable(false)
    Disable()
    Utility.Wait(0.1)
    Delete()
EndEvent

He chose to use Update instead of OnCellAttach. It has the disadvantage that the time is fixed at the picking, rather than checked upon entering the cell. So it adds a stack of overhead after each picking.

 

OnCellAttach would use less (as in none) saved game overhead, and wouldn't occur unless/until the player came back. And would be easier to test changes to iHoursToRespawnCell. But could take more CPU on cell attaches.

 

Also, I'd have disabled the old object before enabling the new, so they don't try to exist in the same place at the same time.

Link to comment
Share on other sites

The next most obvious question - what does the CK do with this information when the file is edited normally?

Excellent question. I hadn't tested that yet!

 

The script doesn't show up in the CK, but I didn't expect it to as the menu doesn't have a spot for it.

 

I added 3 coin purse flora using the CK, then checked (with the revised TES5Edit) and the TestTreeFloraMountainFlower01Blue "Mountain Flower" [TREE:0008B5C4] still has its script. Good!

Link to comment
Share on other sites

Couple things:

- OnCellAttach is pretty unreliable and a common source of things not working as expected (cf the caravan fix in USKP). Using OnUpdateGameTime was a conscious decision after finding OnCellAttach was not up to scratch. If you want to revert that for this fix, then fine, but I don't recommend it. Moreover, the performance impact of my way is nearly zero in most cases, and very light in the worst case (and even then, we're talking about a *temporary* increase in save sizes, not framerates).

- Really worried about putting VMAD on records that don't support it.

- If you don't like the respawn event occuring while the player is around, that is pretty easy to fix. I didn't consider it worth the effort. Unless the player stays in one spot for days, they are very unlikely to see it occur.

- People who are using Flora Respawn Fix are going to have a Bad Time if this is implemented in USKP, as existing references already patched by my mod will have been wiped from the game.

Anyway, that's it for now, but I will give this some more thought later.

Link to comment
Share on other sites

Thanks for responding.

- OnCellAttach is pretty unreliable and a common source of things not working as expected (cf the caravan fix in USKP). Using OnUpdateGameTime was a conscious decision after finding OnCellAttach was not up to scratch. If you want to revert that for this fix, then fine, but I don't recommend it. Moreover, the performance impact of my way is nearly zero in most cases, and very light in the worst case (and even then, we're talking about a *temporary* increase in save sizes, not framerates).

That's the voice of experience we need.

- Really worried about putting VMAD on records that don't support it.

Well, that's why we need to test it a lot. But I was amazed that Zilav came up with it. Apparently, there's another plugin out there that did it by hand. Zilav made a special TES5Edit to make it easy for us.

- If you don't like the respawn event occuring while the player is around, that is pretty easy to fix. I didn't consider it worth the effort. Unless the player stays in one spot for days, they are very unlikely to see it occur.

I agree. I'm more concerned that it changes the behavior from vanilla. But we could add OnCellAttach to re-request the update as the player goes through, so that it will eventually update at the same time as other things (barrels, etc).

- People who are using Flora Respawn Fix are going to have a Bad Time if this is implemented in USKP, as existing references already patched by my mod will have been wiped from the game.

No, no, no! Your replaced TreeFlora with FloraTreeFlora will still work, as long as we keep the same script name. And the generated Flora will persist, because they already have the same underlying base. If we do this correctly, all will be well. We just have to be vigilant.
Link to comment
Share on other sites

Eh, I meant if players deactivate FRF because they think the functionality is provided by USKP now. All those references would vanish then.

FWIW, I'm going to try to implement this in FRF 2.0, idea being that existing references would refresh with the TREE objects when they respawn, rather than the base objects.

Link to comment
Share on other sites

I'm sorry but I think I'm going to have to shit on everyone's Christmas tree here, as the saying goes (including my own - I was really hoping this would work).

 

From the look of it, the VMAD info is not being copied over to the new TREE reference the script places in the game, and no scripts will run on the new object. So, while it will respawn correctly once, subsequent to that the bug will reappear. In fact, the behavior is even more broken than in the unplugged game, because now that harvested object is a placed reference, which don't respawn at all. So the player will be able to harvest the item twice, and then never again ever.

 

Do a bit more testing though DayDreamer, to confirm my findings and also you might think of a workaround or something. But it doesn't look good, I think :-(

Link to comment
Share on other sites

Also, what is the other plugin that did this by hand? Maybe that will reveal something...

 

Though I'm not sure how they did it by hand. There isn't even a spot for VMAD in TES5Edit, for TREE objects. You just have to trust that it's there after running Zilav's script.

 

Based on the above I think it's safe to say there are parts of the game engine making the assumption a TREE will never have a VMAD, and the native implementation of PlaceAtMe(...) is among them (or maybe it's GetBaseObject(), or both). Which is reasonable of course. I don't think TREE objects are a fixed size in memory but I'm curious if during the course of my experiment some assumption was violated which corrupted the save somehow, overwriting something somewhere else. And who the hell knows maybe this will cause memory errors as well, in certain cases. Unfortunately proving or disproving that is beyond my ability.

 

Arthmoor was even queasy about changing in bulk the reference type of placed objects in the game, which is something even the CK will let you do. This is easily 10x more daring. I think even if you get this working you'll have your work cut out for you convincing everyone it's safe.

Link to comment
Share on other sites

I see. I don't think that would effect my results though, would it? I won't have time to retest this until a few days.

 

The script was on the base item though. I increased timescale and watched it respawn. It wouldn't do that without the script. Is that modded version doing anything other than make the TREE VMAD visible, that might enable Skyrim.exe to copy over the VMAD to placed references?

Link to comment
Share on other sites

The script was on the base item though. I increased timescale and watched it respawn. It wouldn't do that without the script. Is that modded version doing anything other than make the TREE VMAD visible, that might enable Skyrim.exe to copy over the VMAD to placed references?

That I don't know. I just added ability to attach VMAD to TREE records in TES5Edit.
Link to comment
Share on other sites

Do a bit more testing though DayDreamer, to confirm my findings and also you might think of a workaround or something. But it doesn't look good, I think :-(

I did only test one cycle on my one test plant. I'll try 2 or 3 later today. Thanks for the heads up!

Link to comment
Share on other sites

a bit more testing though DayDreamer

Tested. Works well!

 

console command setgs iHoursToRespawnCell 1

 

Scriptname FloraRespawnScript extends ObjectReference

Event OnActivate(ObjectReference akActionRef)
    debug.trace(self + "OnActivate() " + akActionRef)
    RegisterForSingleUpdateGameTime(Game.GetGameSettingInt("iHoursToRespawnCell"))
EndEvent

Event OnUpdateGameTime()
    ObjectReference newObj = PlaceAtMe(GetBaseObject(), 1, false, true)
    newObj.SetScale(GetScale())
    newObj.SetAngle(GetAngleX(), GetAngleY(), GetAngleZ())
    DisableNoWait()
    debug.trace(self + "OnUpdateGameTime() " + newObj)
    newObj.Enable(false)
;    Utility.Wait(0.1)
    Delete()
EndEvent

 

A half dozen E picks, followed by waits T 1:

[10/22/2013 - 07:43:31PM] [florarespawnscript < (000978FD)>]OnActivate() [Actor < (00000014)>]
[10/22/2013 - 07:43:36PM] [florarespawnscript < (000978FD)>]OnUpdateGameTime() [florarespawnscript < (FF000948)>]
[10/22/2013 - 07:43:38PM] [florarespawnscript < (FF000948)>]OnActivate() [Actor < (00000014)>]
[10/22/2013 - 07:43:42PM] [florarespawnscript < (FF000948)>]OnUpdateGameTime() [florarespawnscript < (FF00086E)>]
[10/22/2013 - 07:43:44PM] [florarespawnscript < (FF00086E)>]OnActivate() [Actor < (00000014)>]
[10/22/2013 - 07:43:51PM] [florarespawnscript < (FF00086E)>]OnUpdateGameTime() [florarespawnscript < (FF000948)>]
[10/22/2013 - 07:43:53PM] [florarespawnscript < (FF000948)>]OnActivate() [Actor < (00000014)>]
[10/22/2013 - 07:43:56PM] [florarespawnscript < (FF000948)>]OnUpdateGameTime() [florarespawnscript < (FF00086E)>]
[10/22/2013 - 07:43:58PM] [florarespawnscript < (FF00086E)>]OnActivate() [Actor < (00000014)>]
[10/22/2013 - 07:44:02PM] [florarespawnscript < (FF00086E)>]OnUpdateGameTime() [florarespawnscript < (FF000894)>]
[10/22/2013 - 07:44:03PM] [florarespawnscript < (FF000894)>]OnActivate() [Actor < (00000014)>]
[10/22/2013 - 07:44:07PM] [florarespawnscript < (FF000894)>]OnUpdateGameTime() [florarespawnscript < (FF000949)>]
Link to comment
Share on other sites

I think you'll need to put up a full scale test as a separate mod, get a bunch of people to hammer it, and then see where we stand. From where I'm sitting, this still seems awfully risky.

 

I almost think it would be better suited as an SKSE plugin than as a straight up record hack.

Link to comment
Share on other sites

I think you'll need to put up a full scale test as a separate mod, get a bunch of people to hammer it, and then see where we stand. From where I'm sitting, this still seems awfully risky.

 

I almost think it would be better suited as an SKSE plugin than as a straight up record hack.

Doesn't have anything to do with SKSE.

I'll publish a separate plugin. Just wanted to know whether you were interested for U*P.

Although there's technically no reason for me to do so, for future compatibility I'll keep the same script name -- just in case someday U*P decides to adopt it.

Link to comment
Share on other sites

There are 3 things that have no seasonal respawn value, should these respawn anyway? I think they do in game.

 

Flora

001062D1 ChickenNest

 

Tree

000BB952 TreeFloraLeek01

000BCF48 TreeFloraCabbage01

EDIT: tested, they do respawn at the same time as other plants and objects.

Link to comment
Share on other sites

There are a number of mushrooms that don't say "harvest" in their prompt:

 

000ECA55 .. 000ECA60 various sorts

000F3E57 FloraMushroom02SmallDirt01 "Bleeding Crown"

000F675F FloraMushroom06SmallDirt01 "Blisterwort"

 

Unlike other mushrooms with the same ingredients:

 

0004D9FF .. 0004DA0C various sorts

0004DA1F FloraMushroom06Small "Blisterwort"

 

EDIT: http://www.afkmods.com/index.php?/tracdown/issue/14036-mushrooms-missing-harvest-prompt/

Link to comment
Share on other sites

There are a number of mushrooms that don't say "harvest" in their prompt:

Some of them aren't used in the game, either. They have dirt or Reach dirt, and then are sparsely used. So nobody noticed they are "Open" or "Take" instead of "Harvest".

 

However, quite a few of them also have OBND Object Bounds of all zero. As I updated them with "Harvest" in the CK, the CK also added actual bounds to about half of them. Should this be reported for USKP? Is there a way to make them all have OBND? (I have no idea how important that record is?)

 

You need a special version of TES5Edit with VMAD added to TREEs linked above.

The good news (as far as this patch and TES5Edit is concerned): the CK didn't disturb the VMAD record, even as it added the RNAM and updated the OBND. Hooray!
Link to comment
Share on other sites

 

Tested. Works well!

 

I can corroborate this. The scripts were definitely being added to the base object in my previous test, but with the hacked TES5Edit Skyrim can copy over the VMAD to references derived from the base object, as well. In addition to doing more than a single respawn cycle, I did a FULL save/reload (as in, save, exit the game, start the game, load the save) in between each as well, for about 5 iterations. The objects continued to respawn, so it appears the references are also saved to disk properly.

 

It's quite remarkable, actually. The engine definitely does not expect the field to be there, but it at least does not crash horribly. So that either means everything is fine, or it introduces some subtle glitch where all hell breaks lose after 50 hours of gameplay. I have no idea.

 

I will create a new Flora Respawn Fix with this and release it as a 2.0 beta, making it backward compatible with 1.x versions. I will probably keep it as a beta permanently, but maybe enough people will use it that we can get more confidence that this works (or that it doesn't).

 

Edit: DayDreamer you're free to release your own plugin based on my work, but I think you probably jumped the gun. Like I said if this is viable I'm putting it in a 2.0 of my mod anyway. And in case you didn't already I will do the work to make sure people can upgrade from the 1.x stuff seamlessly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...