Author Topic: Extra Ego animations  (Read 2696 times)

0 Members and 1 Guest are viewing this topic.

Pikachu14

  • Guest
Extra Ego animations
« on: August 04, 2002, 03:33:06 AM »
Allright, I got this Ego character and I want him to do shyte, like dying in several nasty ways and stuff. I can do the Death dialog window, but how do I handle the animations?



Offline Brian Provinciano

Re:Extra Ego animations
« Reply #1 on: August 04, 2002, 03:56:10 AM »
You can change the ego's animation easily with main.sc's SetUpEgo() procedure.

See the info at:
http://www.bripro.com/scistudio/help/scc/script_main.html

Pikachu14

  • Guest
Re:Extra Ego animations
« Reply #2 on: August 04, 2002, 04:22:30 AM »
Uhhn...no.

I mean, Ego walks through some dangerous area and suddenly trips over a rock or something.

How do I make Ego trip?

Offline lskovlun

Re:Extra Ego animations
« Reply #3 on: August 04, 2002, 06:38:03 AM »

Uhhn...no.

I mean, Ego walks through some dangerous area and suddenly trips over a rock or something.

How do I make Ego trip?


Control lines. Choose a colour and draw on the control map of your picture. Define a constant that identifies the colour (this will clarify your code somewhat). Then put something like this in the doit of your room script:

Code: [Select]

(if (& (send gEgo:onControl()) CONTROL_EGO_TRIP)
 (send gRoom:setScript(egoTripScript))
)


Then define egoTripScript accordingly. You can use the End cycler to play an animation once and have the controlling script notified:

Code: [Select]

(send gEgo:view(VIEW_TRIP_DIE) setCycle(End self))


Then in the second state of your script, you call the death handler as usual.

Pikachu14

  • Guest
Re:Extra Ego animations
« Reply #4 on: August 04, 2002, 07:56:36 AM »
...Thank you. I'm gonna try that now...

Pikachu14

  • Guest
Re:Extra Ego animations
« Reply #5 on: August 04, 2002, 08:21:00 AM »
Errrm...how do I define EgoTripScript?

Pikachu14

  • Guest
Re:Extra Ego animations
« Reply #6 on: August 04, 2002, 09:08:39 AM »
Allright forget it. It works.

"Specify:
[ DIE                    ]"
* BLAM! Monkeyman's head explodes! *
"Whatever gave you the idea...."

Joe

  • Guest
Re:Extra Ego animations
« Reply #7 on: August 04, 2002, 09:42:00 AM »
Lars, that's a good idea, I would've done:

Code: [Select]

(if (& (send gEgo:onControl()) CONTROL_EGO_TRIP)
 (send gEgo:view(VIEW_TRIP_DIE) setCycle(End egoTripScript))
)


But your way is much better.  Thanks

Offline lskovlun

Re:Extra Ego animations
« Reply #8 on: August 04, 2002, 09:50:26 AM »

Errrm...how do I define EgoTripScript?


I have drawn a yellow control line on the picture and added the sample death icon to the game as view number 5.
This will cycle the death icon once, wait a short while and then run the standard death handler.

Code: [Select]
(define CONTROL_EGO_TRIP $4000) /* This is ctlYELLOW */
(define VIEW_EGO_TRIP 5)

(instance egoTripScript of Script
   (properties)
   (method (changeState newState)
       (var dyingScript)
       (super:changeState(newState))
       (switch (newState)
          (case 0 (send gEgo:view(VIEW_EGO_TRIP) setMotion(NULL) setCycle(End self)))
          (case 1 ((send gEgo:setCycle(NULL)) = cycles 13)) /* Short pause */
          (case 2 (Print("You tripped!"))
                    = dyingScript ScriptID(DYING_SCRIPT)
                    (send dyingScript:caller(VIEW_EGO_TRIP)
                                      register("You're dead!"))
                    (send gGame:setScript(dyingScript)))
       )
   )
)

/******************************************************************************/
(instance RoomScript of Script
   (properties)
   (method (doit)
       (if (& (send gEgo:onControl()) CONTROL_EGO_TRIP)
           (send gRoom:setScript(egoTripScript))
       )
   )
   (method (handleEvent pEvent)
       (super:handleEvent(pEvent))

       /*****************************************
        * Handle the possible said phrases here *
        *****************************************/
       (if(Said('look'))
           Print("You are in an empty room")
       )
   )
)


Pikachu14

  • Guest
Re:Extra Ego animations
« Reply #9 on: August 04, 2002, 09:54:06 AM »
Thanks, but I already figured it out!


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

Page created in 0.061 seconds with 22 queries.