Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: binary1 on April 13, 2015, 07:51:42 AM

Title: moving characters together
Post by: binary1 on April 13, 2015, 07:51:42 AM
I want two NPC's to follow the main player character into another room. The animation is triggered by dialogue.  At a certain point, the main character goes to the door. Then the other two characters follow.  The scene changes when they all get there.  Is there a way to make the three move at the same time?  Right now, they move one-by-one, which looks a little strange.

Thanks for any suggestions.
Title: Re: moving characters together
Post by: Mnemonic on April 13, 2015, 08:00:11 AM
Instead actor.GoTo() use actor.GoToAsync(). That one doesn't block the script execution until the action is finished.

Code: WME Script
  1. actor1.GoToAsync(100, 200);
  2. Sleep(1000);
  3. actor2.GoToAsync(100, 200);
  4. Sleep(1000);
  5. actor3.GoTo(100, 200);
  6.  

This will send the three actors in 1 second intervals.
Title: Re: moving characters together
Post by: binary1 on April 13, 2015, 07:05:19 PM
That worked like a charm!  Thanks for the fast response.  Moving on...