/* Generic Carnivore Sedate Behaviour // */ machine CarnSedate { state SedateBegin { action StopLook() action SetAutoMovementBlend(false) action PlayAnim("sleep", "st", false) action SetStandStill() transition { goto SedatePlaySoundWait } } state SedatePlaySoundWait { transition IsAnimPlaying("sleep", "lp", false) { action SetVariable("Sleepyness", 0.0) goto SedateLoop } } state SedateLoop { ;// The UpdateDeltaVariable multiplies this value by 5! Take this into account here. action UpdateDeltaVariable("Sedate", -0.2) } ;------------------------ Exit States Begin ---------------------- exitstart state CleanUp { action SetSpeedModifier(1.0) transition IsDead() { direct goto LockDeathPose } transition { action StopAnimState("sleep") goto CleanUpLoop } } state LockDeathPose { transition IsAnimPlaying("sleep", "st", false) { action SetLockLastPose("sleep", "st", true) action SetAutoLinkAnimOff("sleep", "st", true) action StopAnim("sleep", "st") action LockDeadPose() goto CleanUpEnd } transition IsAnimPlaying("sleep", "lp", false) { action SetLockLastPose("sleep", "lp", true) action SetAutoLinkAnimOff("sleep", "lp", true) action StopAnim("sleep", "lp") action LockDeadPose() goto CleanUpEnd } transition { action StopAnimState("sleep") goto CleanUpLoop } } state CleanUpLoop { transition IsAnimStatePlaying("sleep", false) == false { action SetAutoMovementBlend(true) action StopLook() goto CleanUpEnd } } exitend state CleanUpEnd { } ;------------------------ Exit States End ---------------------- }