Jump to content

Recommended Posts

Here is a super simple script for animating lip movement for an AI unit for specified # of seconds.  

Script:

Spoiler

// ***********************************************************************************
// JBOY_Lip.sqf
// Do random lip for X seconds
// Compile in init.sqf:    JBOY_Lip =  compile preprocessFileLineNumbers "Scripts\JBOY_Lip.sqf";
// Call:                   _n = [dude, 3] call JBOY_Lip;
// ***********************************************************************************
params["_speaker","_seconds"];

_n = [_speaker,_seconds] spawn
{
    params["_speaker","_seconds"];
    _speaker setRandomLip true;
    sleep _seconds;
    _speaker setRandomLip false;
};

 

Here is some sample usage code, where two different units talk with each other.  In this example the valdez character says a sound file that is about 5 seconds long, and the paramedic1 character says a sound file that is 2.6 seconds long.

// **************************************************************
[valdez, 5] call JBOY_Lip;
valdez customRadio [JBOY_Channel,"hvTempHospital"];   
//valdez globalchat "Hey Zeke.  When are they going to build the new hospital?  This temporary one is a dump.";
sleep 5;
// **************************************************************
[paramedic1, 2.6] call JBOY_Lip;
paramedic1 customRadio [JBOY_Channel,"hParaCutOffFunding"];  
//paramedic1 globalchat "Maybe never.  Madagascar has cut off the funding.";
sleep 3;

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
13 hours ago, pierremgi said:

Did you test setMimic?

Bonjour Pierre.  I've tried setMimic, but IMO its not that useful.  In ARMA 1 you could make an AI smile and more, and it was great.  The few expressions that work in ARMA 3 aren't that useful to me.  Except maybe for a putting a unit on a toilet and having him make a constipated face.

  • Haha 2

Share this post


Link to post
Share on other sites
1 hour ago, Chris Wilkinson said:

Hi dude. Does this script make lips move in n time with the words?

It does random lip movements for the duration past in to the script.  So if your sound file is 5 seconds of talking, then pass in 5 to the script.  The lip movement aren't perfectly aligned with the words necessarily though.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×