Jump to content

Inconsitent enable/disable


corsta

Recommended Posts

Hi folks, I'm having another issue.

 

I've made a mod that adds furniture to a home, but only when an XMarker is activated by purchasing a furniture set from a merchant, so the new furniture spawns in with the other items that would ordinarily spawn. On a new save, it works fine. On a current in-progress save, it works most of the time but occasionally a few of the containers will disappear. It seems entirely random which will be enabled or disabled on loading a save, but it's so far skipped over the containers that have items in them (thankfully). I don't know how to fix it, so I'm hoping one of you fabulous lot will be able to help.

 

Thanks,

Corey

Link to comment
Share on other sites

More details would be great really, like placing the scripts here as well. So the furniture's is placed at the spot but disabled?

 

You could add them to a temp cell and when the player buys the deed, then move them in to the house but also make sure to disable and enable them ones, not within the same frame though as that do not work as the game needs at least a frame to disable an item and then another frame to enable it or nothing will happen.

 

I am doing similar but with books right now. I do hope they will get enabled when they should though...

Link to comment
Share on other sites

When looking at Enable on the Construction Set Wiki it warns us about parent ref.

The only time I've found problems with enable/disable is with related parenting.

The idea being to control enable from parent, never child.

It makes sense as a parent can have many child which in turn can have many child - hierarchical on hierarchical, not something a relational algorithm would easily solve - not back then anyway.

 

PS Of course, OBSE provides related solutions.

Link to comment
Share on other sites

How common is it to use parents and children references? I only seen it at the Luggage so far in COBL. I made a summonable Luggage reference that works perfect, so far, well I made a spell that is able to summon loads of different object to the player and the Luggage is part of it, 4 different altars, a bed and a chair.

 

If a static object is moved or spawned in the same cell where the player is, the only way to update the collisions is to disable and enable them as far as I know and it will require at least a frame between them. This must also be the main reason why so many mods that makes changes to a cell, asks the player to stay away for a while like ef shop as one example, where you must go outside the house until the changes applies.

Link to comment
Share on other sites

Thanks for the replies, folks. To be honest, I did it that way because that's how I saw the vanilla furniture stuff done, and I don't know how else to make something only enable when a furniture thing is bought at a shop. Is there a better way to do it?

Link to comment
Share on other sites

You can set the objects you want as initially disabled and give a unique cell reference then enable them through a script when the player buys their activators.

Edited by Oblivionaddicted
Link to comment
Share on other sites

But then you can only buy that specific object. The Reznods Mannequins mod does work that way, where at least 60 of each mannequins are put in separate cells, and are moved to the positions where the player drops the fake one that they have in their inventory as you cannot carry an NPC in there. Do peek at it how it is done really as it is a cool solution. I do not think that the player needs more than 60 of each object you do put in game... ;)

 

There are many cool stuff to learn by just peeking at how others did solve stuff and make your own version of it or just get inspirations from it.

Link to comment
Share on other sites

Usually, parent refs are for triggers (ie.traps ... activate this and the parent ref activates, perform script)

if mytarget.GetParentRef == 0 ;pretty sure getparentref works in the console as well

so, open up the game. fire up the console and prior to placing an item at the Xmarker, run a couple of tests on the obscuring items:

ref.disable
set parentRef to ref.getparentref
ref.moveto "some empty cloned cell, w/ a unique identifier. looking at other mods for unique way of building a unique remote cell" ;disabling often doesn't work on dynamic (usually the cause of using placeatme instead of moveto ref x y z), owned, child ... many others ... refs.

[reference.]ClearOwnership ;may be of use if the ref is owned, followed up by movetoplayer owned items are never cleared by the system reset, as i doubt are any persistent or essential refs

there's a utility "FormID Finder", i was about to enable it to try and figure out why i can't disable some dead actor via script, but i can using the console "a bald spot now exists where i've been scratching my head, thinking it would ignite a idea".

back-tracking the formid may be of use to determine the root mod, parent ref, isscripted ... etc.

Maskar's Oblivion Overhaul sells deeds to houses. When placed they remove the surrounding environmental refs. If ya have a mod that does similar, probably a good place to start and see the existing conditional checks and whether it's even possible.

hope ya have better luck than i've had.

Edited by bobbyskel78
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...