Friday, May 11, 2012

CK: GetReference()

With Skyrim's move into object-oriented scripting there many questions like this one from Emhyr:
I have a quest alias created by an event, which is a non-unique NPC and is different every time the event occurs. I use this quest alias in scenes without any issues, but if I want to run scripts on that NPC that requires the object reference, i.e. GetDistance, I am unable to do this. How can I return the distance between the player and an alias?
Thankfully there are those like JustinOther who made the transition effortlessly and answer with precision:
ReferenceAliasProperty.GetReference().GetDistance(Game.GetPlayer())

No comments:

Post a Comment