Is there some disconcert with alias and their actors?

Post » Thu Jun 21, 2012 6:29 am

I put this in the Onhit part of a script that is attached to NPC via a cloak spell from the player:

aadpXMarkerStatic.disable()
aadpXMarkerStatic.MoveTo(ME)
aadpXMarkerStatic.SetPosition(10.0, 10.0, 10.0)
aadpXMarkerStatic.MoveToNode(ME, "NPC Head [Head]")
aadpXMarkerStatic.enable()
MEHeight = aadpXMarkerStatic.GetPositionz()
debug.messagebox("height " + MeHeight)


I gave the same script to the player via alias in a quest.

This works (I get a number in the message box OTHER than 0 ) IF the NPC is hitting the player....but... it will not work (all I get is ZERO Z pos) if the player is hitting an NPC.

This only happens in negative elevation areas like -6000 pos z.

The issue with negative elevations is a separate head ache (for the purpose of my question) but my question is specifically IS there is some separation or some disconnect between the player and the player alias or should there be no differences at all?


EDIT: wait...no what am I thinking, if there was a disconnect then the NPC hitting the PLAYER would give the ZERO message box not the player hitting the NPC. oh boy I need a drink...
User avatar
i grind hard
 
Posts: 3463
Joined: Sat Aug 18, 2007 2:58 am

Post » Wed Jun 20, 2012 11:48 pm

Perhaps ME = GetReference()? If a script is on the player, the functions can be called implicitly, but for an alias it seems like GetReference() is needed.
Spoiler
Auto State AutoStash	Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)		If IsKeyPressed(iAutoStashKey)			If BagOfHoldingItemFLST.HasForm(akBaseItem)			ElseIf akBaseItem != BagOfHoldingARMO				GetReference().RemoveItem(akBaseItem, aiItemCount, True, BagOfHoldingREF)			EndIf		EndIf	EndEventEndState 
...won't work without it.

Just started using aliases, so take it with a grain of salt.
User avatar
Prue
 
Posts: 3425
Joined: Sun Feb 11, 2007 4:27 am

Post » Wed Jun 20, 2012 2:17 pm

from what i (barely) understand about aliases, is that it's just a "vessel" that points to whatever is filled inside it. so if you need the alias to do something you would have to call its filled reference using GetReference()


imagine a fish in a bucket, and you want the fish to die.

the fish is the actor reference the bucket is the alias.


so with that in mind you wouldnt say
Bucket.Die()

you would want to do
Bucket.WhateverIsInsideIt().Die()
User avatar
Rachael Williams
 
Posts: 3373
Joined: Tue Aug 01, 2006 6:43 pm


Return to V - Skyrim