Interaction

From BiaSDK
Jump to: navigation, search

So we've gotten our characters to animate and walk around, how about a little more interaction between them

Add these lines after the first Do Until loop (before Sleep( 2.0 ); )

ACTION_SetLookAtTarget( 'Doyle', Pawn_Paddock, False, 'c_eyebrow' );
ACTION_PlayLipSyncSound( 'Doyle', "BD_DOYLE.S_GREETING_E", 1.0, 1.0, 1.0 );
ACTION_SetLookAtTarget( 'Paddock', Pawn_Doyle, False, 'c_eyebrow' );
Sleep( 0.8 );
ACTION_PlayLipSyncSound( 'Paddock', "BD_PADDOCK.S_GREETING_C", 1.0, 1.0, 1.0 );

ACTION_SetLookAtTarget is telling Doyle to look at Paddock, we use Doyle's PawnTag and for Paddock we use the Pawn_Paddock variable defined earlier. Instead of another character this can be any Actor with a tag. (you would use GetFirstActor( tag here ) )

The False is for a Boolean bFreeze, related to how the head look works. The 4th property is optional, we can supply a bone name to be looked at, and for this I'm using c_eyebrow, since it sits just above the eyes (center eyebrow). Bone names can be checked in the Animation Browser, by turning on View -> Bone Names.

ACTION_PlayLipSyncSound is being used to get our guys to talk, you can use the Sounds Browser to open sound packages and listen to the audio clips, its very similar to how Animations are referenced and played (package . soundcue), and the last 3 properties control the volume, pitch and radius.

Now test the map after compiling changed. Paddock should walk over to the group, Doyle will look up at him and say hello, and Paddock will look at Doyle and reply before turning and walking again.

Let’s use all the commands we've learnt so far and make this a bit more complex... copy these lines, just overwrite everything in your PostFade state!:

ACTION_TriggerEvent( 'EVENT_Friar_Start' );
ACTION_Walk( 'Paddock' );
ACTION_MoveTowardTag( 'Paddock', 'PN_Paddock_01', False, );
Do { sleep( 1.0 ); ACTION_MoveTowardTag( 'Paddock', 'PN_Paddock_01', False, ); } Until ( PawnIsAtDestination( Pawn_Paddock, GetNavigationPoint( 'PN_Paddock_01' )) );
ACTION_SetLookAtTarget( 'Doyle', Pawn_Paddock, True, 'c_eyebrow' ); ACTION_PlayLipSyncSound( 'Doyle', "BD_DOYLE.S_GREETING_E", 1.0, 1.0, 1.0 ); ACTION_SetLookAtTarget( 'Paddock', Pawn_Doyle, True, 'c_eyebrow' ); Sleep( 0.8 ); ACTION_PlayLipSyncSound( 'Paddock', "BD_PADDOCK.S_GREETING_C", 1.0, 1.0, 1.0 );
ACTION_SetLookAtTarget( 'Corrion', Pawn_Paddock, True, 'c_eyebrow' ); Sleep( 0.5 );
ACTION_SetLookAtTarget( 'Paddock', Pawn_Corrion, True, 'c_eyebrow' ); Sleep( 1.0 );
ACTION_PlayLipSyncSound( 'Corrion', "BD_CORRION.S_GREETING_E", 1.0, 1.0, 1.0 ); sleep( 0.5 );
ACTION_SetLookAtTarget( 'Doyle', Pawn_Corrion, True, 'c_eyebrow' ); Sleep( 0.5 );
ACTION_SetLookAtTarget( 'Friar', Pawn_Corrion, True, 'c_eyebrow' ); ACTION_SetLookAtTarget( 'Paddock', Pawn_Doyle, True, 'c_eyebrow' ); ACTION_PlayAnim( 'Paddock', 'standing_idle_relaxed_6', 0.2, 1.0, False ); Sleep( 0.7 );
ACTION_ClearLookAtTarget( 'Friar' ); ACTION_SetLookAtTarget( 'Doyle', Pawn_Paddock, True, 'c_eyebrow' ); Sleep( 0.5 );
ACTION_PlayLipSyncSound( 'Paddock', "D09_1500.PADDOCK_C", 0.3, 1.0, 1.0 ); ACTION_ClearLookAtTarget( 'Doyle' ); Sleep( 0.5 ); ACTION_ClearLookAtTarget( 'Paddock' );
Sleep( 0.5 );
ACTION_ClearLookAtTarget( 'Corrion' ); ACTION_MoveTowardTag( 'Paddock', 'PN_Paddock_02', False, ); Sleep( 2.0 );
ACTION_PlayLipSyncSound( 'Paddock', "BD_PADDOCK.S_GREETING_D00_1630_C", 1.0, 1.0, 1.0 ); ACTION_SetLookAtTarget( 'Corrion', Pawn_Paddock, True, 'c_eyebrow' ); ACTION_SetLookAtTarget( 'Friar', Pawn_Paddock, True, 'c_eyebrow' ); ACTION_SetLookAtTarget( 'Doyle', Pawn_Paddock, True, 'c_eyebrow' ); Do { sleep( 1.0 ); ACTION_MoveTowardTag( 'Paddock', 'PN_Paddock_02', False, ); } Until ( PawnIsAtDestination( Pawn_Paddock, GetNavigationPoint( 'PN_Paddock_02' )) );
Pawn_Paddock.Controller.Focus = GetLocalPlayerPawn(); ACTION_SetLookAtTarget( 'Corrion', GetLocalPlayerPawn(), True, 'c_eyebrow' ); ACTION_SetLookAtTarget( 'Friar', GetLocalPlayerPawn(), True, 'c_eyebrow' ); ACTION_SetLookAtTarget( 'Doyle', GetLocalPlayerPawn(), True, 'c_eyebrow' ); sleep( 3.0 );
Pawn_Paddock.Controller.Focus = NONE; ACTION_TriggerEvent('TS_IntroScene');

Back to Main Page