Issue with GetReference()

Post » Tue Feb 17, 2015 6:24 pm

This is the Script:

Spoiler
Scriptname RikiPortalLinkScript extends ObjectReference{Links the created portals}Alias Property thisportal  AutoAlias Property otherportal  AutoObjectReference Property portalA Auto HiddenObjectReference Property portalB Auto HiddenFunction StartChain()	RegisterForSingleUpdate(0.5)EndFunctionEvent OnInit()	StartChain()EndEventEvent OnUpdate()	{if thisportal.TryToEnable()		Debug.Notification("thisportal successfully enabled")	else		Debug.Notification("thisportal couldn't be enabled")	endif	If otherportal.TryToEnable()		Debug.Notification("otherportal successfully enabled")	else		Debug.Notification("otherportal couldn't be enabled")	endif}		;portalA = thisportal.GetReference()	;portalB = otherportal.GetReference();auskommentiert - will nicht funzen		If portalA != None		Debug.Notification("thisportal reference found")	else		Debug.Notification("thisportal reference not found")	endIf		If portalB != None		Debug.Notification("otherportal reference found")	else		Debug.Notification("otherportal reference not found")	endIf		If portalA.GetDistance(Game.GetPlayer()) <= 15		Debug.PlayerMoveToAndWait(portalB as String)	endIfEndEvent

It won't compile, saying that GetReference does not exist or is not a function. I have tried it with having the script extend ReferenceActors or Actors and with importing any of them.

Usually I get this kind of error when I call the function on the wrong type. But documentation says that GetRef gets the ObjectReference an alias points to (if any). So I don't think thats the case here.

Anyone can help?

PS: In the above posted code it's commented out. I know.

User avatar
NAkeshIa BENNETT
 
Posts: 3519
Joined: Fri Jun 16, 2006 12:23 pm

Post » Wed Feb 18, 2015 12:50 am

Change the Alias properties to ReferenceAlias instead.

User avatar
Josh Sabatini
 
Posts: 3445
Joined: Wed Nov 14, 2007 9:47 pm

Post » Wed Feb 18, 2015 4:07 am

Oh god.. Thank you so much! It did compile! :D

User avatar
Prue
 
Posts: 3425
Joined: Sun Feb 11, 2007 4:27 am


Return to V - Skyrim