Set zone to never respawn through a script?

Post » Sun Nov 18, 2012 1:13 pm

Does anyone know if this is possible?

I know how to make a cell never respawn- by changing the encounter zone to "NoResetZone" (or making a new encounter zone for the cell with the no reset flag enabled). But is it possible to change this property through scripting? Either by modifying the properties of an encounter zone object, or by simply changing what encounter zone the cell points to.

The Creation Kit wiki has been... less than helpful in trying to figure this out. EncounterZone.psc is blank, and I can't find any functions that seem to mess with location zones associated with either cell or location script objects.

If this is not possible through scripting, is there any sort of a workaround? I suppose it might be possible to play around with a duplicate cell that replaces the original... is this a feasible idea?
User avatar
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Post » Sun Nov 18, 2012 8:38 pm

http://www.creationkit.com/EncounterZone_Script

Not exactly brimming with helpfulness

So either you can, but we have not been provided with the functions ... Or you cannot because there are no functions.

Whichever, a polite request to the SKSE peoples MIGHT unlock some functionality we cannot already see/use. Otherwise you are SOL, I think?
User avatar
Nims
 
Posts: 3352
Joined: Thu Jun 07, 2007 3:29 pm

Post » Sun Nov 18, 2012 11:22 am

If this is not possible through scripting, is there any sort of a workaround? I suppose it might be possible to play around with a duplicate cell that replaces the original... is this a feasible idea?

Well, yes, that would work. It seems kind of unsafe though, because if a player leaves something in there it will be gone permanently unless they know the cell name to teleport in.

I know this would be a lot of work, but if you look at leveledactor script and leveleditem script, it's possible to change what they spawn through scripting. So... I think you could basically set up your own encounter zone by starting with an empty list for each actor, and populate or depopulate it based on the conditions.
http://www.creationkit.com/LeveledActor_Script
http://www.creationkit.com/LeveledItem_Script

Edit: Alternatively, maybe if you just disable and/or delete the leveled actor references from the cell, it would be about the same as permanently stopping the respawn.
User avatar
Laura Wilson
 
Posts: 3445
Joined: Thu Oct 05, 2006 3:57 pm

Post » Sun Nov 18, 2012 9:09 pm

Hmm... maybe I should clarify what I'm trying to do.

I'd like the marriage quest to set cells owned by your spouse to never respawn, so they can be available as free, cheap player houses.

I investigated the marriage quests, and it looks like RelationshipMarriageFIN is the quest which gives the player a key to the door, sets where the spouse is going to live, and so on. The scripts have a LocationAlias pointing to the house your spouse owns (if your spouse indeed owns a house).

So, I guess I first need to somehow get the cell associated with this location? Then get a list of leveled item spawns for that cell, and delete them somehow? I notice that while there is a function to revert changes made to a leveled item (and leveled actor) by scripting I'm not sure there's one to just delete the leveled item spawns outright- is there?

If not, I guess I would have to have another script setup the leveled item/actor lists, and then use the Revert() function to reset them?
User avatar
stephanie eastwood
 
Posts: 3526
Joined: Thu Jun 08, 2006 1:25 pm

Post » Sun Nov 18, 2012 12:59 pm

By delete I meant using:
http://www.creationkit.com/Delete_-_ObjectReference

I am not sure if it would work on item spawns or not, but you can try it. Make sure you get the reference and not the base object, because it definitely won't work on the base object.

If it doesn't work on the references, then your question about deleting items from the list becomes important. I do not think it's possible to do that, which is why I suggested using new leveled lists that are empty, then adding the items they should have with a script, and then reverting them back to default (empty) at the proper time. If you do this, I think you will have to make new containers as well, because the wiki says that "removeitem" does not work on leveled lists (and so you would have no way to get rid of the leveled lists that are in the base object.). Actually, if it did, you could just remove the leveled lists from the container they're in when you wanted them to stop respawning.

"If not, I guess I would have to have another script setup the leveled item/actor lists, and then use the Revert() function to reset them?"
Yeah, that's what I meant.

You could check if removeallitems works on them though. If it does, you could use that and just move the non-leveled items back.
User avatar
Klaire
 
Posts: 3405
Joined: Wed Sep 27, 2006 7:56 am


Return to V - Skyrim