Moving a reference without changing reference ID

Post » Sun Jun 15, 2014 9:02 pm

Is it possible to move a reference from one cell to another without changing its reference ID? Basically a move move not a copy move. Cutting and pasting an NPC from one cell to another will obviously change its reference ID but I'm not sure if a batch command functions in the same manner?

So here's the scenario: I have two NPCs in holding cells that are scripted to be moved to a vanilla xmarker in a vanilla cell which works perfectly fine until another mod deletes that xmarker for reasons unknown. So to get around this I'd like to pick a random cell in the Tamriel worldspace to move those two NPCs to so even if the scripted move fails at least they can still run to their destinations.

Also does anyone have any clever workarounds up their sleeves? I've considered going so far as to create a door between the holding cell and the vanilla cell then replace the door at the destination with an invisible non-interactive object to try and make it one-way but I'm not sure that'll work quite as effectively.

User avatar
Kari Depp
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:19 pm

Post » Sun Jun 15, 2014 3:52 pm

How about making them initially disabled, move them to the Player, and then check if they're in the same cell as the PC? If not, enable them?

Something like...

If ( HasBeenWithPC == 0 )   MyNPC.MoveTo(PlayerRef)   If ( MyNPC.GetDistance(PlayerRef) <= 1000 )    HasBeenWithPC = 1   EndIfElseIf ( HasBeenWithPC == 1 )   If ( MyNPC.GetDistance(PlayerRef) >= 5000 )     MyNPC.Enable()     HasBeenWithPC = 2   EndIfEndIf

That's just super rough, but you get the idea. Probably not perfect, but...

User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Sun Jun 15, 2014 6:58 pm

Not a bad idea, never thought of moving them to the player. One problem though: NPC1 has voicing acting telling the player to meet NPC2 at a specific location.

I might have to bite the bullet and just resort to a cell edit by placing my own xmarker.

User avatar
Cedric Pearson
 
Posts: 3487
Joined: Fri Sep 28, 2007 9:39 pm


Return to V - Skyrim