GetSelf in Papyrus?

Post » Tue Jun 19, 2012 7:04 pm

Looking at the wiki, it seems they got rid of this function, and replaced it with a variable every script has by default called 'Self', but this variable refers to the script, not the actual object it's attached to. Is there a way in the new system to have an ObjectReference script know which ObjectReference it's attached to? Other than having some ObjectReference property that is set as itself in the render window for every instance of the object that gets placed, which is really not feasible for what I'm doing, because I'm not placing the things by hand.

I want to do this, essentially:

someOtherReference.MoveTo(thisScriptsReference, 0.0, 0.0, 0.0, true)

But I can't figure out how to get the reference I'd put inside thisScriptsReference.
User avatar
Isaac Saetern
 
Posts: 3432
Joined: Mon Jun 25, 2007 6:46 pm

Post » Tue Jun 19, 2012 11:31 pm

From all I've seen, 'Set Self to GetSelf' works the same as the 'Self' keyword, implicitly referencing the ObjectReference the script is attached to sans the variable. One of my plugins creates FF range references and the script fires, moving a persistent REF to 'Self'.
User avatar
Stacy Hope
 
Posts: 3391
Joined: Thu Jun 22, 2006 6:23 am

Post » Wed Jun 20, 2012 1:15 am

Just tried it, this works. Annoying that the documentation this functionality was somewhere else on the page from the part that says what the Self variable is for.

Thanks!
User avatar
Nauty
 
Posts: 3410
Joined: Wed Jan 24, 2007 6:58 pm


Return to V - Skyrim