//------------------------------------------------------------------ // NOTE: The fsm name below MUST be changed in order for the // script to be considered a unique entity! fsm Generic_Jumping : integer; //------------------------------------------------------------------ // Generic_NoAttack: //------------------------------------------------------------------ //------------------------------------------------------------------ // Constants //------------------------------------------------------------------ const #include_ //------------------------------------------------------------------ // Types //------------------------------------------------------------------ type #include_ //------------------------------------------------------------------ // Variables //------------------------------------------------------------------ var static locpoint SpawnSpot; static locpoint dummy_hpt; static integer nJumpPath; static real fAfterJumping; //------------------------------------------------------------------ // Init: my initialization function //------------------------------------------------------------------ function Init; code GetLocation(me,SpawnSpot); SpawnSpot[1] = SpawnSpot[1] + 100; endfunction; //------------------------------------------------------------------ // StartState: my initial state //------------------------------------------------------------------ state StartState; code //TeleportToHell(me); trans TeleportState; endstate; state TeleportState; code if GetGlobalTrigger(GetMemoryInteger(ME,31)) == TRUE then dummy_hpt[0] = 2; dummy_hpt[1] = 3; dummy_hpt[2] = 4; teleportAndLook(ME,dummy_hpt,0,SpawnSpot); Startup(ME); fAfterJumping = GetTime; trans after_TeleportState endif; endstate; state after_TeleportState; code if GetGlobalTrigger(GetMemoryInteger(ME,30)) == TRUE then StartExecute(ME); trans WaitState; endif; endstate; state WaitState; code if IsDead(ME) then trans DeadState; endif; //if CanJump... fAfterJumping = GetTime + 4.5; //nJumpPath = GetMemoryInteger(ME,28); //orderMoveToRigid(nJumpPath, 50, 2, TRUE, FALSE); //param 3: PATROL_UNDEF=0,PATROL_SINGLE=1,PATROL_LOOP=2,PATROL_SEESAW=3 //orderMoveToLocPoint(SpawnSpot, 50, TRUE, FALSE); trans WaitState2; endstate; state WaitState2; code if IsDead(ME) then trans DeadState; endif; if (fAfterJumping <= GetTime) then trans JumpState; endif; endstate; state JumpState; code if IsDead(ME) then trans DeadState; endif; teleportAndLook(ME,dummy_hpt,0,SpawnSpot); Jump(ME,2); trans WaitState; endstate; state DeadState; code orderDie; endstate; endfsm.