Using Parent when calling on an object?

Post » Wed Jun 20, 2012 10:52 pm

From the wiki:

"Parent" is only used to call a parent script's version of a function, in the case where you extend the parent.

; Call the parent's version of DoStuff, ignoring our local definitionParent.DoStuff()


But what if you have a line for example:
Game.GetPlayer().DoStuff()

And you want to call the script's parent version of DoStuff? The following don't work:

Parent.(Game.GetPlayer()).DoStuff()(Game.GetPlayer()).Parent.DoStuff()

I'm using this with a Native function that I made a local definition for in my script ActorEx (extends Actor), so I don't want to add an extra parameter to add the Player that way. I also realize I could simply make my function a new custom one rather than changing the native, but I really prefer not to.


I also tried this, but it didn't work either, it still uses the local function definition:

(Game.GetPlayer() as Actor).DoStuff()

Actually pretty logical that that doesn't work...
User avatar
Baylea Isaacs
 
Posts: 3436
Joined: Mon Dec 25, 2006 11:58 am

Return to V - Skyrim