Author Topic: Actors  (Read 685 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris Cromer

Actors
« on: August 29, 2003, 10:45:52 AM »
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:

Code: [Select]
/*******************************************************************************
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. :-\


Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Eigen

Re:Actors
« Reply #1 on: August 29, 2003, 12:13:22 PM »
/******************************************************************************/
(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
« Last Edit: August 29, 2003, 12:15:29 PM by Eigen »
Artificial Intelligence Competition

Offline Chris Cromer

Re:Actors
« Reply #2 on: August 29, 2003, 01:36:12 PM »
Thanks, it worked like a charm... but still a ways to go before I have a working gundam rpg. :)
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.033 seconds with 21 queries.