UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Help me with script dialogs (for SP)

broken avatar :(
Created 7 years ago
by artsergo
0 Members and 1 Guest are viewing this topic.
4,157 views
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
Signature
Believe in your strength, anytime, anywhere!
Only you can force yourself to change something in your life!
But In general, the world itself is beautiful if  you be optimist :)
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
Hi.  :)

Advise me please.
as i think that i have problem with soundaliases. I see many forums and other sites about this topic but it's no helped me, and I do not understand.

This is example how i want to do:

Such moment.  :)
I want to make a dialogue for my allies actors. the like code examples working in all standart maps named_anim.gsc
into CoDWaW (SP):

---------------------------------------------

Code Snippet
Plaintext
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";
--------------------------------------------

and i write so code for dialogue (animation + sound):

//////////// in main gsc i insort:

Code Snippet
Plaintext
#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";
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
----------------------------------------------------------------------------------------------------------------

but still this code don't working.  :(
CoDWaW doesn't show any errors when loading this map .

the map starting complite and i walking in the map and Chernov and Reznov spawning - ok,
but they don't talking both  :(

Help, what could be the problem, at least understanding of the causes.
code like as a "self playsound (....);" - no interest because then actor speech without animation lips



Last Edit: January 11, 2017, 09:42:24 pm by sevengpluke
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
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.
Last Edit: January 12, 2017, 01:30:29 pm by codmoddd1234
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
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.

hi!
I No all understand a little.
Can you write a simple such code how it might look like full code, please.
Just there are moments you mentioned in your post, I have never seen and I'm confused)

Thanks you
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
over this function - addnotetrack_customdialog.
I saw her use in the standard maps (the missions) but probably this - addnotetrack_customdialog need include something else for working because in my example isn't working for - addnotetrack_customdialog.

 ::)
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
Quote from: codmoddd1234
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);
//

i try this. CoDWaW showing  error ((

http://www.mediafire.com/view/dhbn93as3zn3f1y/err_1.jpg

//////

now rewriting code is such (in folder mods\sp_dialog5\  :

1) in main gsc:
Code Snippet
Plaintext
#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";
}

---------------------------------------------------------------
2) in my map _anim gsc:

Code Snippet
Plaintext
#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;
}
}
Last Edit: January 12, 2017, 08:58:04 pm by MZslayer11
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
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
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
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

wow! thanks you very much! it very cool!   :)
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
until I haven't tried  it, I hope everything will be ok)
thank you very much once again  :)

Double Post Merge: January 13, 2017, 06:44:30 pm
hi!  :)

) Its working if setting KVP for Actors set no Spawner but I need:

1) i goin the loaded map and go to the location where planted trigger1 for spawner - Polonsky,
2) When Polonsky spawned he go to location for all be meet),
3) when Polonsky stand, here i planted trigger2 (for spawning Roebuk),
4) When Roebuk spawning and go to meet location too.
5) and then after all process starting speech Roebuk and next Polonsky, next Roebuk again.

its from first post in this topic   ::)

https://i.imgur.com/xcgcozr.jpg

Double Post Merge: January 13, 2017, 06:51:41 pm
just I add - Spawner in Entity option then actors no speech this dialog
but if they no spawners then speech dialog.

How can i do it that actors be spawner and they may speech dialog too?

Double Post Merge: January 13, 2017, 07:02:00 pm
And tell me please, 
Do know exists a viewer program for view animation type (xanim)?
for select need animation type in personal map and for history mission in map.  :)
Last Edit: January 13, 2017, 07:02:00 pm by artsergo
Marked as best answer by artsergo 7 years ago
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
I think heroes like roebuck talk quotes with subtitles and other spawner guys use random voices but this worked for a spawner to talk.

https://www.mediafire.com/download/xkkhf8dgjq9fqbh

I don't think there is an xanim viewer but you could export tanims with tombmx program and apply them to a skeleton/mesh in maya to view.
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 3 January 2017
Last active: 7 years ago
Posts
78
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Goodluck for all !
×
artsergo's Groups
artsergo's Contact & Social Linksartsibsergeiartsergoartsergo
Ok. Thank you.  :)

But how to understand that an actors look in animation moment?
Just these animation names me little understood.
So I interesting a program on the Internet, view animations but easy to use, only))
it for able understand how need us an animation names for some moment in map.
Previous your script, which you included in the post, I checked (it worked, if actors is no spawners). And there at start of the map, when the actors run through a wall in the map and there speech, and next they run meet location.
I understand that it such a strange animation using here when they run away somewhere.
So, I interesting how understand what the animation fits what not   ::)

Can i using an other animation for this last script?  :)
don't " casual_stand_idle,, " series

Double Post Merge: January 14, 2017, 09:58:45 am
And last moment.  :)

How can I make that actors go to the location for speech
Roebuk and Polonsky.

Example:
we have a two cover_stand_node and we need that our actors go to the cover_stand_nodes and when they get this cover_stand_nodes after starting speech but no early. (each cover_stand_node for each actors)
but now, actors talking anywhere but not where need the location   :D

I want to make such so show in the figure above  ::)


Double Post Merge: January 14, 2017, 05:28:20 pm
codmoddd1234, thank you very much!

all work, but right i a few remaking your code)
but now in general it working such:


Last Edit: January 16, 2017, 06:42:18 pm by artsergo

 
Loading ...