SetEssential on random actors...

Post » Wed Feb 16, 2011 12:15 am

I have been doing a lot of reading on CreateFullActorCopy and several related functions, specifically regarding save bloat and best practice for managing the delete counterpart to this function.

I am also looking into the SetEssential function in this light, and have hit a bit of a snag. From what I can tell it is impossible to call this on an object you don’t know the explicit Base ID for. So, if I wanted to create a full actor copy, then set that copy to essential, I would have to know the editor base ID of that object or it would be impossible. (I know CreateFullActorCopy generates a new base ID anyway, so knowing the editor ID of the original actor probably wouldn't even matter.)

That is my current thinking anyway, but I wanted a 2nd opinion because this seems rather depressing.

Am I correct that there is no way to refer to an arbitrary actor’s base ID via script, without knowing it beforehand? I have been through all the stock CS functions (ignoring OBSE for now), and I can’t seem to find a way it can be done. Any form of reference to the base does not appear to function with SetEssential.

Is there any way to properly reference the generated Base ID from CreateFullActorCopy?
User avatar
Elizabeth Davis
 
Posts: 3406
Joined: Sat Aug 18, 2007 10:30 am

Post » Wed Feb 16, 2011 9:56 am

Nope.
User avatar
Sarah Evason
 
Posts: 3507
Joined: Mon Nov 13, 2006 10:47 pm

Post » Wed Feb 16, 2011 7:37 am

Bit of a bummer, that. Ah well. I think I see my first major OBSE project coming on. =)

EDIT: Or not... For the sake of not cluttering up the forum, hopefully someone can explain why this doesn't seem to work:

scn phitest1sref copyrefbegin ScriptEffectStart     set copyref to createfullactorcopy thisendbegin ScriptEffectUpdate     copyref.setrefessential 1endbegin ScriptEffectFinish     disableend


This is on a spell I cast at an actor. The copy gets created, but never gets set to essential, and the original i cast this on never gets disabled. I have "script effect always applies" and all that checked.

If I go into the console, click the copy in-game, and type setrefessential 1 it works like a charm. :shrug:
User avatar
Alyna
 
Posts: 3412
Joined: Wed Aug 30, 2006 4:54 am

Post » Wed Feb 16, 2011 9:26 am

Never mind, it was just my lazy syntax usage. This one seems to work:

scn phitest1sref copyrefref selfrefbegin ScriptEffectStart     set selfref to GetSelf     set copyref to selfref.createfullactorcopyendbegin ScriptEffectUpdate     copyref.setrefessential 1endbegin ScriptEffectFinish     selfref.disableend

User avatar
Shiarra Curtis
 
Posts: 3393
Joined: Thu Jan 04, 2007 3:22 pm

Post » Wed Feb 16, 2011 6:32 am

lOl just ignore me! =P
User avatar
Nathan Barker
 
Posts: 3554
Joined: Sun Jun 10, 2007 5:55 am


Return to IV - Oblivion