Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Scripting two actors in cutscene  (Read 3096 times)

0 Members and 1 Guest are viewing this topic.

Dan-D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 89
    • View Profile
Scripting two actors in cutscene
« on: June 10, 2008, 11:00:04 PM »

Hi again. So i have two 3d actors in the cutscene but i don't know how to script scene so their animations start at one time. Here's the script
Code: [Select]
#include "scripts\base.inc"

// here comes the stuff which initializes the scene

var char = Scene.LoadActor3D("actors\char\char.act3d");
 char.SkipTo(643, 574);
 char.Direction = DI_DOWN;

// here comes the stuff which initializes the scene
switch(Game.PrevScene)
{
case "":
case "Scene1":

     Game.Interactive = false;
actor.Active = true;
char.PlayAnim("br_cut1_1");
Game.PlaySound("voice\br1.ogg", false);
actor.SkipTo(611, 361);
     actor.Direction = DI_DOWN;
actor.PlayAnim("br_cut1_1");

Game.ChangeScene("scenes\Basement\scene1_cut2\scene1_cut2.scene", false, false);
      break;

case "Scene1b":
     actor.SkipTo(620, 557);
     actor.Direction = DI_LEFT;
char.PlayAnim("br_cut1_2");
      break;

}

actor.Active = true;


////////////////////////////////////////////////////////////////////////////////
// scene state
global StateScene2;


// default values
if(StateScene2==null)
{
  StateScene2.Visited = false;
  // add scene states here
}



////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables



////////////////////////////////////////////////////////////////////////////////
if(!StateScene2.Visited)
{
  StateScene2.Visited = true;

  // this is our first visit in this scene...
}

so as You can see at the beginning actor Char's doing his animation and then second actor doing his animation. As i said i need to they start animations at one time.
Thanks
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Scripting two actors in cutscene
« Reply #1 on: June 10, 2008, 11:46:21 PM »

call PlayAnimAsync() instead. This method doesn't stop script execution so if you call more than one animation, you'll get them ok.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Dan-D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 89
    • View Profile
Re: Scripting two actors in cutscene
« Reply #2 on: June 11, 2008, 01:19:34 AM »

ahhh... Thank You! I knew it's something easy
Logged
 

Page created in 0.033 seconds with 23 queries.