


Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!load.scr_anim[nameactor_from_radiant_named][animname] ="%ch_named_actor_animation_(form_xanim_folder) ";
//chatting
load.scr_sound[nameactor_from_radiant_named][animname] = "name_sound_from_soundaliases";
#include maps\_anim;
#include maps\_utility;
#include common_scripts\utility;
main()
{
flag_init( "player_spawns_soldier" );
flag_init( "sgt_reaches_trigger" );
flag_init( "soldier_reaches_trigger" );
thread heroes();
//wait for soldier to reach his trigger after spawn
flag_wait( "soldier_reaches_trigger" );
}
heroes() {
flag_wait( "player_spawns_soldier" );
//we have to wait a small instance so game recognizes ai existance
wait 0.15;
level.chernov = getent( "pvt. Chernov", "targetname" );
level.chernov.animname = "intro_cher";
flag_wait( "soldier_reaches_trigger" );
//wait a bit for seargant to be alive in game
wait 0.15;
level.Reznov = getent( "sgt. Reznov", "targetname" );
level.Reznov.animname = "intro_rez";
}
//////////// and this code insort to my map _anim.gsc :
#include maps\_anim;
#include maps\_utility;
#include common_scripts\utility;
#using_animtree("generic_human");
main() {
setup_level_anims();
audio_loader();
}
////////////////////////////////////////////// this code /////////////////////////////////////////////////////////////////////
setup_level_anims()
{
//lets wait for sargeant to reach his trigger
flag_wait( "sgt_reaches_trigger" );
//wait for a bit so it looks like they regroup
wait 0.75;
level.scr_anim["Reznov"]["intro_rez"] = %ch_seelow1_reznov_runandcaugh;
addNotetrack_dialogue( "reznov", "Ber3_INT_000A_REZN", "intro_rez_01", "Ber3_INT_000A_REZN" );
level.scr_anim["chernov"]["intro_cher"] = %ch_seelow1_intro_chernov;
addNotetrack_dialogue( "chernov", "Ber3_IGD_028A_CHER_A", "intro_chern_01", "Ber3_IGD_028A_CHER_A" );
wait 0.15; //pause2
}
audio_loader()
{
level.scr_sound["Reznov"]["intro_rez_01"] = "See1_INT_011A_REZN01";
level.scr_sound["Reznov"]["intro_rez_02"] = "See1_INT_013A_REZN02";
wait 0.2; //pause
level.scr_sound["chernov"]["intro_chern_01"] = "Ber3_IGD_028A_CHER_A";
wait 0.2; //pause
level.scr_sound["Reznov"]["intro_rez_03"] = "See1_IGD_148A_REZN03";
level.scr_sound["Reznov"]["intro_rez_04"] = "See1_IGD_149A_REZN04";
level.scr_sound["Reznov"]["intro_rez_05"] = "See1_IGD_300A_REZN05";
level.scr_sound["Reznov"]["intro_rez_06"] = "See1_IGD_058A_REZN06";
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
You will need a function to actually tell your ai to do dialog.
Check ber3_util.gsc and look for "say_dialog" and "is_active_ai" functions and paste them both into your mapname anim gsc
Ex
Level.scr_sound ["sarge"] ["speaker1234"] = "speaker1234";
Level.sarge say_dialog( "sarge", "speaker1234", true ,true,false);
//
There is also a function called play_generic_facial( sound, looktarget)
If you pass the player as looktarget it will face the player then say the dialog with lip sync.
Edited to add
https://www.mediafire.com/download/zr8aueggbwqwadd
Another working example with addnotetrack_customdialog thats closer to what your trying to do.
You will need a function to actually tell your ai to do dialog.
Check ber3_util.gsc and look for "say_dialog" and "is_active_ai" functions and paste them both into your mapname anim gsc
Ex
Level.scr_sound ["sarge"] ["speaker1234"] = "speaker1234";
Level.sarge say_dialog( "sarge", "speaker1234", true ,true,false);
//
#include maps\_utility;
#include maps\_anim;
#include common_scripts\utility;
#include maps\_music;
#using_animtree( "generic_human" );
main()
{
init_flags();
setup_friendlies();
<.... other standart functions .... >
}
init_flags() {
flag_init( "friends_setup" );
}
setup_friendlies() {
// set up the sarge
level.sarge = getent("sarge", "script_noteworthy");
level.sarge.animname = "sarge";
level.sarge.anime = "intro_sarge_1";
level.chernov = getent("anderson", "script_noteworthy");
level.chernov.animname = "chernov";
level.chernov.anime = "intro_chernov_2";
}
#include common_scripts\utility;
#include maps\_utility;
#include maps\_anim;
#include maps\ber3_util;
#include maps\_music;
#using_animtree( "generic_human" );
main()
{
say_dialogue();
setup_anims_audio();
}
///////////////////// this is all dialogs /////////////////
setup_anims_audio()
{
// anims setting
level.scr_anim["sarge"]["intro_sarge_1"] = %ch_peleliu1a_outro_roebuck_v2;
level.scr_anim["chernov"]["intro_chernov_2"] = %ch_peleliu1a_outro_polonsky_v2;
////// all speech sarge and chernov ///////////////////
// sarge talking...
level.scr_sound["sarge"]["intro_sarge_1"] = "Pel1_IGD_044A_ROEB";
Level.sarge say_dialog( "sarge", "Pel1_IGD_044A_ROEB", true, true, false );
wait 0.7;
// chernov talking...
level.scr_sound["chernov"]["intro_chernov_2"] = "Pel1_OUT_004A_POLO";
Level.chernov say_dialog( "chernov", "Pel1_OUT_004A_POLO", true, true, false);
wait 0.7;
// reznov talking...
level.scr_sound["sarge"]["intro_sarge_1"] = "Pel1_IGD_006A_ROEB";
Level.sarge say_dialog( "sarge", "Pel1_IGD_006A_ROEB", true, true, false);
}
////////added driving functions
say_dialogue( animname, theLine, waitForEnd, giveMagicBulletShield, soundOnly )
{
ASSERTEX( is_active_ai( self ), "play_dialogue(): the entity that's supposed to be speaking is not an active AI." );
if( !IsDefined( waitForEnd ) )
{
waitForEnd = false;
}
if( !IsDefined( giveMagicBulletShield ) )
{
giveMagicBulletShield = true;
}
if( !IsDefined( soundOnly ) )
{
soundOnly = false;
}
if( !soundOnly )
{
self.og_animname = self.animname;
self.animname = animname;
}
if( giveMagicBulletShield )
{
// don't want to mess up previously scripted values
if( !IsDefined( self.magic_bullet_shield ) || !self.magic_bullet_shield )
{
self thread magic_bullet_shield();
self.say_dialogue_bullet_shield = true;
}
}
if( is_active_ai( self ) )
{
if( !soundOnly )
{
self thread anim_single_solo( self, theLine );
}
else
{
self thread animscripts\face::SaySpecificDialogue( undefined, level.scr_sound[animname][theLine], 1.0, "soundOnly_done" );
}
}
if( waitForEnd )
{
if( !soundOnly )
{
self waittill( theLine );
}
else
{
self waittill( "soundOnly_done" );
}
}
if( !soundOnly )
{
self.animname = self.og_animname;
}
if( giveMagicBulletShield )
{
if( IsDefined( self.say_dialogue_bullet_shield ) && self.say_dialogue_bullet_shield )
{
self notify( "stop magic bullet shield" );
}
}
}
is_active_ai( suspect )
{
if( IsDefined( suspect ) && IsSentient( suspect ) && IsAlive( suspect ) )
{
return true;
}
else
{
return false;
}
}
The error in your script is that you are calling say_dialog() in your first funtion on nothing. There could be other errors that i didnt see.
//
Heres another way to do anims and voice for ai. Its not synced so you will prob need to edit the waits in the gsc. With this and the gsc linked in my previous post you should be able to get it working. Both were tested have instructions and work independently.
https://www.mediafire.com/download/78csa6ymwtjujqc