@spooky, that means you don't actually need the extra property in your magic effect script, you can just use the scriptname directly.
aadpMainQuest.DamOrKill(Damage, Target, Attacker) ; Call the global function in script aadpMainQuest.
Re: the Game.GetPlayer() discussion.
I'd say it depends on how often you're going to be using the playerRef.
Using a local as Xetrill suggested would improve the speed of many functions seen posted in this forum. ie those that call Game.GetPlayer() umpteen times within a single function or event.
There'll be a point where the speed gains of accessing a local instead of an instance variable outweigh the cost of the initial call to GetPlayer().
The other advantage of this is that a local won't stop you changing the function to a Global. So there are more potential speed savings to be had there.
I think the property should be avoided altogether. It's just the purist in me that thinks it's a waste to add a property that will never actually be accessed remotely.
If you need a PlayerRef in several locations then using a variable and an OnInit() event will give the same run-time speed as the property.
Actor PlayerRefEvent OnInit() PlayerRef = Game.GetPlayer()EndEvent
But, if it is possible for PlayerRef to change during a game, as kuertee points out above, then the only solution is the local.
Using a local to hold Game.GetPlayer() at run-time does seem to be the most futureproof way.
Return Value:
The http://www.creationkit.com/Actor_Script that represents the player.
The http://www.creationkit.com/Actor_Script that represents the player.
Imagine a new mod where you sleep then dream you are a child in a new worldspace an are represented by a new Actor.