Actors

AGI1122 I am having a bit of a problem with what I want to do with an actor.

I have 2 views of an actor, and when the user types a command in it changes to the second view... but the problem is that I want it to change back to the first view once it reaches the end of the second view's loop.

Here is what I have so far:

/*******************************************************************************
Battle script
*******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 100)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
/******************************************************************************/
(instance public rm100 of Rm
   (properties
      picture scriptNumber
      north 0
      east 0
      south 0
      west 0
   )
   (method (init)
      (super:init())
      (self:setScript(RoomScript))

(deathscythe_stand:
init()
setCycle(Fwd)
setLoop(0)
setStep(5)
posn(60 170)
)

(epyon_stand:
init()
setCycle(Fwd)
setLoop(1)
setStep(5)
posn(270 189)
)
   )
)
/******************************************************************************/
(instance RoomScript of Script
   (properties)
   (method (handleEvent pEvent)
(var dyingScript)
(super:handleEvent(pEvent))

/*****************************************
* Handle the possible said phrases here *
*****************************************/
(if(Said('attack'))
(deathscythe_stand:dispose())
(deathscythe_shoot:
init()
setCycle(End)
setLoop(2)
setStep(5)
posn(51 170)
)
)

(if(Said('debug'))
SetDebug()
)
//(send gGame:changeScore(1))
/*
= dyingScript ScriptID(DYING_SCRIPT)
(send dyingScript:
caller(10)
register("You press the self detonation button.")
)
(send gGame:setScript(dyingScript))
*/
   )
)
/******************************************************************************/
// Death scythe instances
(instance deathscythe_stand of Act
(properties
view 1
)
)

(instance deathscythe_shoot of Act
(properties
view 6
)
)

// Epyon instances
(instance epyon_stand of Act
(properties
view 15
)
)


I am making the deathscythe shoot which is the second view... it animates just fine and stops at the end of the loop. But I can't for the life of me figure out how to tell if the loop is done or not so that I can change it back to his "standby" picture for when he is standing still. :-\
Eigen /******************************************************************************/
(instance EndShoot of Script
(properties)
(method(changeState newState)
= newState 0
= state newState
(switch(state)
(case 0
(deathscythe_shoot: dispose())
(deathscythe_stand:init())
)
)
)
)


(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
(var dyingScript)
(super:handleEvent(pEvent))

/*****************************************
* Handle the possible said phrases here *
*****************************************/
(if(Said('attack'))
(deathscythe_stand:dispose())
(deathscythe_shoot:
init()
setCycle(End EndShoot)
setLoop(2)
setStep(5)
cel(0)
posn(51 170)
)
)

(if(Said('debug'))
SetDebug()
)
//(send gGame:changeScore(1))
/*
= dyingScript ScriptID(DYING_SCRIPT)
(send dyingScript:
caller(10)
register("You press the self detonation button.")
)
(send gGame:setScript(dyingScript))
*/
)
)
/******************************************************************************/



-Eigen
AGI1122 Thanks, it worked like a charm... but still a ways to go before I have a working gundam rpg. :)