Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: SBOVIS on July 20, 2004, 03:53:53 PM

Title: Main character animations & other things
Post by: SBOVIS on July 20, 2004, 03:53:53 PM
Hi all,
       Could I have some code please to help with the following:-

When the main actor reaches a specific place in the scene (you clicked on the place) he does a specific defined animation.

Example: Player clicks on stone steps, ACtor walks over and when hits the area defined in Scene edit he climbs the steps (series of animation frames)


The same code can be used for automatic reactions by the actor like walking past a mirror , climbing a rope, crawling through a hole, jumping a gap etc.



Also can collision be done between the Main actor and an NPC. Example Npc walking around in scene and your paths meet, could be a rat, bat or another human.


Many thanks for your past and future help.


Regards


SBovis




Title: Re: Main character animations & other things
Post by: Mnemonic on July 23, 2004, 07:02:30 PM
Scene regions can trigger an event when the actor enters/leaves it. Just attach a script to the region (in SceneEdit) containg something like:

on "ActorEntry"
{
  // some action when actors enters this region
}

on "ActorLeave"
{
  // some action when actors leaves this region
}


As for the collision between actors/entites... you are probably already familiar with scene blocked regions and waypoints. So, the actors/entities can have their own blocked region and waypoint set, which moves together with them. All you need to do is to add something like this to your actor/entity definition file:

  BLOCKED_REGION {
    POINT {-60,-48}
    POINT {46,-48}
    POINT {46,53}
    POINT {-60,53}
  }
  WAYPOINTS {
    POINT {-65,-53}
    POINT {-56,39}
    POINT {51,-58}
    POINT {60,58}
  }

There is currently no tool for interactively defining those values, because 1) this feature is rarely used 2) you can use the definition above without modifications