Jump to content

Playidle on Player from Script: Solved, mostly


gammons123

Recommended Posts

Hi,

 

I am trying to make the player play an idle when a button is pressed. I ahve everything working except the playing an idle part...

 

is there a trick to using PlayerREF.playidle(idlename) ? it doesn;t seem to do anything.

 

I can play the idle from the console fine, but need to be able to start it froma  script (ideally a quest script)

 

is this possible? can anyone help me understand this? I've tried googling/searching here but I can't find any answers I understand, except that the above is working for other people. is it because its in a quest script?

 

Thanks in advance.

Link to comment

By shamelessly stealing Dagobaking's code from the Scripts for AAF I figured out something that works.

I have no idea WHY it works, but that's just details...

 

Code as follow for anyone interested.

 

    Idle Property myIdle Auto Const

    Actor Property PlayerRef Auto

Function MakeIdleHapped()

            int targetActorFormID = PlayerRef.GetFormID()
            Actor targetActor = Game.GetForm(targetActorFormID) as Actor
            targetActor.PlayIdle(MyIdle)

EndFunction


 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use