Talk:PlayIdle

From GECK
Jump to: navigation, search

There is a method to play an idle animation on the player, via a trigger-script, which is used at the start of the Dead Money DLC for New Vegas. The "disableplayercontrols" function is used, with all flags set to 1. The player is also moved to a new xmarkerheading object, using the "moveto" function. Then the script adds an AI package to the player, using the "addscriptpackage" function. This AI package is a default "travel" package, set to "current location" with a "0" radius. "Must complete" flag is ticked. Under the "On Begin" section of the "Begin/End/Change" tab in the AI package's window, locate the idle you want to run in the idle field. Also, in the "idles" tab, tick "use specific idles", then right-click and select new in the field below, and locate the same idle you chose before. Also, tick "Run in sequence" at the bottom of the "idles" tab. To remove the ai package, later in the script, the devs used the simple line "player.removescriptpackage" (they don't designate any package ID).

So I'm not sure if 100 percent of those steps are necessary or not, but by replicating the above I was able to successfully get it working. To be on the safe side, review the scripting in Dead Money, so you know you've not missed anything, if you run into problems.

RJHelms84 23:28, 10 June 2012 (EDT)


PlayIdle can be used on the player, without using the flying camera, through actor effects. The limitation with running PlayIdle on the PC doesn't come from the PC itself, but rather from the use of "Player" as a calling reference. Since an actor effect is always cast on a specific actor, a calling reference isn't required. For example, if you wanted to make the player smoke a cigarette, you could cast an actor effect with the following script.

Begin ScriptEffectUpdate
      PlayIdle LooseSmokingStanding
End

Note that PlayIdle was run without a calling reference. This will cause the player - or any other actor the effect is cast on - to run the smoking animation until the effect expires. This can be done with any idle animation, although those marked "Loop Forever" won't stop when the effect expires.