GetActorRef won't compile?

Post » Tue Jun 19, 2012 5:57 pm

Hey there. In an attempt to reduce the amount of scripting I need, I found the GetActorRef() function and have been trying to get it working in my alias script. For some reason, no matter what I try, the script will not compile at all. It keeps returning "GetActorRef is not a function." Tried Refence* as well, considering both are supposed to work, but neither do.

I am trying to use this to attach a follower to a cart, without having to make a seperate script for eah follower (which is the only way I have managed to get this working.) I have seen other scripts use the exact command in the same context, so why will mine refuse to compile?

Here is the script:
Spoiler
Scriptname DC8 extends ReferenceAliasEvent Oninit()if (DriveableCartAlias.IsRunning())  RegisterForSingleUpdate(0.1)endifEndeventEvent OnUpdate()AttachToCart(CompCartAlias.GetActorRef())DriveableCartAlias.Stop()Endeventfunction AttachToCart(bool bDoAttach)if bDoAttach  CompCartAlias.GetActorRef().SetVehicle(DriveableCart1)  Utility.Wait(0.1)  Debug.SendAnimationEvent(CompCartAlias.GetActorRef(), "IdleCartPrisonerCIdle")  Utility.Wait(0.1)endifendfunctionObjectReference property DriveableCart1 AutoQuest property DriveableCartAlias AutoReferenceAlias Property CompCartAlias  Auto

I have also tried defining the actor at the start of the script,

Actor Follower = CompCartAlias.GetActorRef()

But that too refuses to compile.


Now getting
"GetActorReference is not a property on script referencealias or one of its parents"
with the below mentioned fixes. Still won't work.
User avatar
Mike Plumley
 
Posts: 3392
Joined: Wed Sep 05, 2007 10:45 pm

Post » Tue Jun 19, 2012 7:20 pm

function GetActorRef() don't existe but it's GetActorReference()
User avatar
josie treuberg
 
Posts: 3572
Joined: Wed Feb 07, 2007 7:56 am

Post » Tue Jun 19, 2012 10:59 am

First: Unrelated comment, but instead of doing RegisterForUpdate then UnregisterForUpdate, you can use RegisterForSingleUpdate.

Second: You want to be using a ReferenceAlias, not a plain Alias.
User avatar
Project
 
Posts: 3490
Joined: Fri May 04, 2007 7:58 am

Post » Tue Jun 19, 2012 6:30 am

function GetActorRef() don't existe but it's GetActorReference()

I said I tried both. Neither work for the same reason. Also the site lists both commands as working, and I see .GetActorRef being used in other modders scripts.
User avatar
Austin Suggs
 
Posts: 3358
Joined: Sun Oct 07, 2007 5:35 pm

Post » Tue Jun 19, 2012 2:17 pm

First: Unrelated comment, but instead of doing RegisterForUpdate then UnregisterForUpdate, you can use RegisterForSingleUpdate.

Second: You want to be using a ReferenceAlias, not a plain Alias.

I will try both thanks :)
User avatar
Je suis
 
Posts: 3350
Joined: Sat Mar 17, 2007 7:44 pm

Post » Tue Jun 19, 2012 5:57 pm

Just tried it and now I am getting

"GetActorReference is not a property on script referencealias or one of its parents"


Same goes for GetActorRef. Ugh ><;.

The SingleRegisterUpdate was a good fix though, thank you :smile:
User avatar
sally coker
 
Posts: 3349
Joined: Wed Jul 26, 2006 7:51 pm

Post » Tue Jun 19, 2012 2:39 pm

Just tried it and now I am getting

"GetActorReference is not a property on script referencealias or one of its parents"


Same goes for GetActorRef. Ugh ><;.

The SingleRegisterUpdate was a good fix though, thank you :smile:

Odd. I was able to copy & paste the updated code from the OP, compile it as is, and didn't get any errors.
User avatar
Ells
 
Posts: 3430
Joined: Thu Aug 10, 2006 9:03 pm

Post » Tue Jun 19, 2012 1:34 pm

Odd. I was able to copy & paste the updated code from the OP, compile it as is, and didn't get any errors.

Thanks for posting that you tried it. Just tried it again and no errors. Guess it was a CK fart? Who knows.

Thanks again for your help, you have saved me the trouble of copying and pasting 90 scripts :)
User avatar
Adriana Lenzo
 
Posts: 3446
Joined: Tue Apr 03, 2007 1:32 am

Post » Tue Jun 19, 2012 6:57 am

Glad you got it working. I have a question - maybe you can enlighten me. Why does your AttachToCart function call Wait twice, for .1 seconds each time? I have a script that calls Cast on a Spell - it works 90% of the time and the rare failure has me wondering if sticking a few of these .1 second Waits is some technique I've not yet heard about.
User avatar
Amy Melissa
 
Posts: 3390
Joined: Fri Jun 23, 2006 2:35 pm


Return to V - Skyrim