Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

U2Dialog.DialogSession


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
//=============================================================================
// DialogSession.uc
// Created By: Mike Baldwin
// Created On: 2/23/2001
// $Author: Mbaldwin $
// $Date: 1/07/03 12:22p $
// $Revision: 94 $
//=============================================================================
class DialogSession extends Dialog
	native;

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

const NoInterruptTimeFinishedTimer	= 'NoInterruptTimeFinished';
const AudioFinishedTimer			= 'AudioFinished';

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

var DialogEngine			DE;					// reference to dialog singleton
var array<DialogTree>		Trees;				// set of dialog trees available for this session
var array<DialogController>	DControllers;		// participants (dialog controllers)
var DialogNode				CurNode;			// which node is being spoken?
var EDialogTone				Tone;				// tone set by the CurNode (DialogNode.ChangeTone)
var array<ExitEventInfo>	ExitEvents;			// Event to trigger when session is over
var array<NodeEnableInfo>	ExitEnables;		// Nodes to enable when session is over
var float					TimeElapsed;		// time since the audio file began
var bool					bAudioPlaying;		// is someone currently talking?
var bool					bCantInterrupt;		// cant butt in yet
var bool					bSessionFinished;	// session is done and is waiting deletion
var bool					bInitialized;		// all npc's are ready and dialog can begin
var	float					TalkRadius;			// maximum distance from center an actor can go before they'll be kicked from the session
var EDialogStatus			DialogStatus;		// currently status of the dialog session
var DialogController		SpeakingDC;			// current speaker
var float					SoundVolume;		// volume to use for PlaySound / PlayVoice
var float					SoundRadius;		// sound radius to use for PlaySound / PlayVoice

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

var DialogTrigger			Trigger;			// for sessions created by a DialogTrigger
var name					Topic;				// for sessions created for a specific topic
var bool					TopicEnabled;		// cached enabled-ness of the topic tree
var Actor					WaitingActor;		// actor to notify when session is over

//-----------------------------------------------------------------------------
// Interruption support
var actor					Interrupter;		// speaker who's doing the interrupting
var actor					InterruptTarget;	// speaker who the interrupter wants to talk to

//-----------------------------------------------------------------------------
// Natives
//
native function AddDialog(DialogTree NewTree );		// Add dialog tree to this session
native function NodeCompleted();					// Advance the conversation after a node has been spoken
native function bool Contains( string Speaker );	// Is this speaker a participant in the session?
native function string WhoIsSpeaking();				// Who's currently speaking?
native function float TimeSinceLastSpoken();		// Time since the audio file has completed (negative if sound still playing)

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

function AddParticipant( DialogController DC, Actor Other )
{
	DControllers[DControllers.Length] = DC;
	DC.DialogBegin( Other );
	SendSessionBeginEvent(DC);
	bInitialized = false;
}

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

function RemoveParticipant( DialogController DC )
{
	local int i;
	assert( DC != None );
	DMDLG("RemoveParticipant -- speaker:" @ DC.DCSpeaker);

	if( CurNode != None && Caps(CurNode.Speaker) == Caps(DC.DCSpeaker) )
	{
		DMDLG("Stopping audio file for:" @ DC.DCSpeaker @ "Filename:" @ CurNode.Filename);
		StopAudioFile();
	}

	SendSessionEndEvent(DC);
	DC.DialogEnd();
	for( i=DControllers.Length-1; i >= 0 ; i-- )
		if( DControllers[i] == DC )
			DControllers.Remove(i,1);
}

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

function bool FoundValidTopic()
{
	if( DControllers.Length > 0 )
	{
		if( TryResumeDialog() || TryNormalDialog() )
			return true;
		else DMDLG( "Error unable to resume or begin dialog" );
	}
	else DMDLG( "Can't find any speakers to begin conversation" );

	return false;
}

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

event Destroyed()
{
	RemoveAllTimers();
	
	// just to be sure
	AudioFinished();

	// carry out any pending node events
	ProcessActions();

	// pass the dialog status on to the controllers (dialog ending)
	UpdateDCDialogEnding();

	// toss any conversation-specific abort nodes
	ClearAbortNodes();
	
	// remove any leftover choice nodes
	ClearSelections();

	// fire off exit events
	SendExitEvents();

	// carry out all exit enables
	SendExitEnables();

	// everybody out
	while( DControllers.Length > 0 )
		RemoveParticipant( DControllers[0] );

	// inform trigger that dialog is over
	if( Trigger != None )
		Trigger.SessionFinished();

	// reset bookmark if the curnode has the option unset

	if( CurNode != None && CurNode.UseBookmark == DIALOGBOOLEAN_False )
		CurNode.Tree.Bookmark = None;

	// reset the enabled flag on topic dialogs
	ResetTopicEnabled();

	// notify waiting actor that the session is over
	if( WaitingActor != None )
		WaitingActor.DialogUnPause();

	Super.Destroyed();
}

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

function ResetTopicEnabled()
{
	local DialogTree TopicTree;

	if ( Topic != '' )			// dialog by topic
	{
		TopicTree = DE.GetDialogByTopic( Topic );
		if( TopicTree != None )
			TopicTree.bEnabled = TopicEnabled;
	}
}

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

function UpdateDCDialogEnding()
{
	local int i,j;

	if( DialogStatus == DIALOGSTATUS_Normal )
	{
		for( i=0; i < DControllers.Length; i++ )
		{
			for( j=0; j < DControllers.Length; j++ )
			{
				if( i != j )
				{
					DControllers[i].SetDialogEnding( DControllers[j].Actor, DIALOGENDING_Normal );
				}
			}
		}
	}
}

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

function SendSessionBeginEvent( DialogController DC )
{
	DC.Actor.Trigger( Self, None, DialogBeginEvent );
}

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

function SendSessionEndEvent( DialogController DC )
{
	switch( DialogStatus )
	{
	case DIALOGSTATUS_Normal:
		DC.Actor.Trigger( Self, None, DialogEndEvent );
		break;
	case DIALOGSTATUS_Aborting:
	case DIALOGSTATUS_InterruptRequest:
	case DIALOGSTATUS_InterruptResponse:
	case DIALOGSTATUS_InterruptWalkAway:
	case DIALOGSTATUS_SpeakerDamaged:
		DC.Actor.Trigger( Self, None, DialogAbortEndEvent );
		break;
	default:
		break;
	}
}

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

function SendExitEnables()
{
	local int i;
	local DialogNode DN;
	for( i=0; i < ExitEnables.Length; i++ )
	{
		DN = class'DialogEngine'.static.GetNode( Self, ExitEnables[i].Node );
		if( DN!=None ) DN.bEnabled = bool(ExitEnables[i].bEnable);
	}
}

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

function SendExitEvents()
{
	local int i;
	local Actor Receiver;

	for( i=0; i < ExitEvents.Length; i++ )
	{
		if( ExitEvents[i].Target != '' )
		{
			DMDLG("Sending exit event '" $ ExitEvents[i].EventName $ "' to" @ ExitEvents[i].Target);
			Receiver = class'DialogEngine'.static.NameToActor( Self, ExitEvents[i].Target );
			if( Receiver != None )
				Receiver.Trigger( Self, None, ExitEvents[i].EventName );
		}
		else
		{
			DMDLG("Sending global exit event '" $ ExitEvents[i].EventName $ "'");
			TriggerEvent( ExitEvents[i].EventName, Self, None );
		}
	}
}

//-----------------------------------------------------------------------------
// Resume --> Normal --> Abort Dialog functions
//-----------------------------------------------------------------------------

event bool TryResumeDialog()
{
	local int i,j;
	local DialogController DC1, DC2;
	local name ResumeTopic;
	local DialogTree ResumeTree;

	// clear out any existing trees
	RemoveAllTrees();

	// check for special handling dialog from previous conversation
	for( i=0; i < DControllers.Length && ResumeTopic == ''; i++ )
	{
		DC1 = DControllers[i];
		for( j=0; j < DControllers.Length && ResumeTopic == ''; j++ )
		{
			DC2 = DControllers[j];
			if( DC1 != DC2 )
			{
				ResumeTopic = DC1.GetResumeTopic( DC2.DCSpeaker );
			}
		}
	}

	if( ResumeTopic != '' )		// resume handling dialog
	{
		ResumeTree = DE.GetDialogByTopic( ResumeTopic );
		if( ResumeTree != None && ResumeTree.bSpecialEventTree )
			AddDialog( ResumeTree );
		else if( !ResumeTree.bSpecialEventTree )
			DMDLG( "Using a normal tree for resume dialog:" @ ResumeTree.Topic );
	}

	DialogStatus = DIALOGSTATUS_Resuming;
	return Trees.Length > 0;
		
}

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

event bool TryNormalDialog()
{
	local int i;
	local array<DialogTree> ValidDialog;
	local DialogController InterruptTargetDC;
	local DialogController InterruptingDC;

	// clear out any existing (resume) trees
	RemoveAllTrees();

	// toss any conversation-specific resumes leftover from the previous conversation
	ClearResumeNodes();

	// if this dialog interrupted someone talking, handle it
	if( Interrupter != None && InterruptTarget != None )
	{
		RemoveInterruptedSpeakers();

		// tell the interrupt target to headtrack and turn to us
		InterruptingDC = DE.GetDController( Interrupter );
		InterruptTargetDC = DE.GetDController( InterruptTarget );
		if( InterruptTargetDC != None )
		{
			InterruptTargetDC.DialogBegin( InterruptingDC.Actor );
			InterruptTargetDC.NotifyNPCReady();
		}
	}

	if ( Topic != '' )			// dialog by topic
	{
		ValidDialog[0] = DE.GetDialogByTopic( Topic );
		if( ValidDialog[0] != None )
		{
			TopicEnabled = ValidDialog[0].bEnabled;
			ValidDialog[0].bEnabled = true;
			AddDialog( ValidDialog[0] );
		}
	}
	else						// use all dialog b/w these speakers
	{
		DE.GetDialogByParticipants( DControllers, ValidDialog );
		for( i=0; i < ValidDialog.Length; i++ )
			if( ValidDialog[i] != None && !ValidDialog[i].bSpecialEventTree )
				AddDialog( ValidDialog[i] );
			else if( ValidDialog[i].bSpecialEventTree )
				DMDLG( "Using a abort/resume tree for normal dialog:" @ ValidDialog[i].Topic );
	}

	DialogStatus = DIALOGSTATUS_Normal;
	return Trees.Length > 0;
}

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

event bool TryAbortDialog()
{
	local int i,j;
	local DialogController DC1, DC2;
	local name AbortTopic;
	local DialogTree AbortTree;

	// allow abort nodes to interrupt the current node
	bCantInterrupt = false;
	bAudioPlaying = false;
	TimeElapsed = 0;

	// clear out any existing (normal) trees
	RemoveAllTrees();

	// cut off audio
	AudioFinished();

	// check for special handling dialog from previous conversation
	for( i=0; i < DControllers.Length && AbortTopic == ''; i++ )
	{
		DC1 = DControllers[i];
		for( j=0; j < DControllers.Length && AbortTopic == ''; j++ )
		{
			DC2 = DControllers[j];
			if( DC1 != DC2 )
			{
				AbortTopic = DC1.GetAbortTopic( DC2.DCSpeaker );
				DMDLG("Got Topic from abort map of" @ DC1.DCSpeaker @ "with" @ DC2.DCSpeaker @ "Topic:" @ AbortTopic );
			}
		}
	}

	if( AbortTopic != '' )		// abort handling dialog
	{
		AbortTree = DE.GetDialogByTopic( AbortTopic );
		if( AbortTree != None && AbortTree.bSpecialEventTree )
			AddDialog( AbortTree );
		else if( !AbortTree.bSpecialEventTree )
			DMDLG( "Using a normal tree for abort dialog:" @ AbortTree.Topic );
	}

	DialogStatus = DIALOGSTATUS_Aborting;

	for( i=0; i < DControllers.Length; i++ )
		if( DControllers[i].Actor != Interrupter &&
			DControllers[i].Actor != InterruptTarget )
			DControllers[i].Actor.Trigger( Self, None, DialogAbortEvent );
	return Trees.Length > 0;
}

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

event bool TryInterruptRequestDialog()
{
	local int i,j;
	local DialogEngine DE;
	local DialogController InterruptingDC;
	local name InterruptRequestTopic;
	local DialogTree InterruptRequestTree;

	// allow abort nodes to interrupt the current node
	bCantInterrupt = false;
	bAudioPlaying = false;
	TimeElapsed = 0;

	// clear out any existing (normal) trees
	RemoveAllTrees();

	// cut off audio
	AudioFinished();

	// check for interrupt request dialog
	InterruptingDC = DE.GetDController( Interrupter );
	DMDLG("Search for interrupt request dialog with" @ InterruptTarget.Speaker @ "using abort map of" @ InterruptingDC.DCSpeaker );
	InterruptRequestTopic = InterruptingDC.GetInterruptRequestTopic( InterruptTarget.Speaker );

	if( InterruptRequestTopic != '' )		// interrupt request dialog
	{
		InterruptRequestTree = DE.GetDialogByTopic( InterruptRequestTopic );
		if( InterruptRequestTree != None && InterruptRequestTree.bSpecialEventTree )
			AddDialog( InterruptRequestTree );
		else if( !InterruptRequestTree.bSpecialEventTree )
			DMDLG( "Using a normal tree for interrupt request dialog:" @ InterruptRequestTree.Topic );
	}

	ClearEnding( DIALOGENDING_InterruptRequest );

	DialogStatus = DIALOGSTATUS_InterruptRequest;
	return Trees.Length > 0;	
}

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

event bool TryInterruptResponseDialog()
{
	local int i,j;
	local DialogController InterruptTargetDC, InterruptedDC;
	local name InterruptResponseTopic;
	local DialogTree InterruptResponseTree;

	// clear out any existing (normal) trees
	RemoveAllTrees();

	// check for interrupt response dialog
	InterruptTargetDC = DE.GetDController( InterruptTarget );
	for( i=0; i < DControllers.Length; i++ )
		if( DControllers[i].Actor != Interrupter &&
			DControllers[i].Actor != InterruptTarget )
			InterruptedDC = DControllers[i];
	DMDLG("Search for interrupt response dialog with" @ InterruptedDC.Speaker @ "using abort map of" @ InterruptTargetDC.DCSpeaker );
	InterruptResponseTopic = InterruptTargetDC.GetInterruptResponseTopic( InterruptedDC.DCSpeaker );

	if( InterruptResponseTopic != '' )		// interrupt request dialog
	{
		InterruptResponseTree = DE.GetDialogByTopic( InterruptResponseTopic );
		if( InterruptResponseTree != None && InterruptResponseTree.bSpecialEventTree )
			AddDialog( InterruptResponseTree );
		else if( !InterruptResponseTree.bSpecialEventTree )
			DMDLG( "Using a normal tree for interrupt response dialog:" @ InterruptResponseTree.Topic );
	}

	ClearEnding( DIALOGENDING_InterruptResponse );
	DialogStatus = DIALOGSTATUS_InterruptResponse;
	return Trees.Length > 0;	
}

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

event bool TryInterruptWalkAwayDialog()
{
	local int i,j;
	local DialogController InterruptingDC, InterruptTargetDC;
	local name InterruptWalkAwayTopic;
	local DialogTree InterruptWalkAwayTree;

	// clear out any existing (normal) trees
	RemoveAllTrees();

	// check for interrupt walkaway dialog
	InterruptingDC = DE.GetDController( Interrupter );
	InterruptTargetDC = DE.GetDController( InterruptTarget );
	for( i=0; i < DControllers.Length; i++ )
	{
		if( DControllers[i] != InterruptingDC &&
			DControllers[i] != InterruptTargetDC )
		{
			DMDLG("Search for interrupt walkaway dialog with" @ InterruptingDC.DCSpeaker @ "using abort map of" @ DControllers[i].DCSpeaker );
			InterruptWalkAwayTopic = DControllers[i].GetInterruptWalkAwayTopic( InterruptingDC.DCSpeaker );
			break;
		}
	}

	if( InterruptWalkAwayTopic != '' )		// interrupt request dialog
	{
		InterruptWalkAwayTree = DE.GetDialogByTopic( InterruptWalkAwayTopic );
		if( InterruptWalkAwayTree != None && InterruptWalkAwayTree.bSpecialEventTree )
		{
			AddDialog( InterruptWalkAwayTree );
		}
		else if( !InterruptWalkAwayTree.bSpecialEventTree )
			DMDLG( "Using a normal tree for interrupt walkaway dialog:" @ InterruptWalkAwayTree.Topic );
	}

	DialogStatus = DIALOGSTATUS_InterruptWalkAway;
	return Trees.Length > 0;	
}

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

function bool CanBeInterruptedBy( DialogNode InterruptingNode )
{
	if( InterruptingNode.Tone > CurNode.Tone ||
		InterruptingNode.Priority > CurNode.Priority )
		return true;
	return false;
}

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

function RemoveAllTrees()
{
	local int i;
	for( i=0; i < DControllers.Length; i++ )
		DControllers[i].Nodes.Remove( 0, DControllers[i].Nodes.Length );

	Trees.Remove( 0, Trees.Length );
}

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

function RemoveInterruptedSpeakers()
{
	local int i;
	local EDialogEnding Ending;

	for( i=0; i < DControllers.Length; i++ )
	{
		if( DControllers[i].GetDialogEnding( Interrupter.Speaker, Ending ) &&
			Ending == DIALOGENDING_InterruptWalkAway )
		{
			RemoveParticipant( DControllers[i] );
		}
	}
}

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

function ClearAbortNodes()
{
	local int i;
	for( i=0; i < DControllers.Length; i++ )
		DControllers[i].AbortMapCurrent.Remove( 0, DControllers[i].AbortMapCurrent.Length );
}

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

function ClearResumeNodes()
{
	local int i;
	for( i=0; i < DControllers.Length; i++ )
		DControllers[i].ResumeMapCurrent.Remove( 0, DControllers[i].ResumeMapCurrent.Length );
}

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

function ClearSelections()
{
	local int i;
	for( i=0; i < DControllers.Length; i++ )
		DControllers[i].Nodes.Remove( 0, DControllers[i].Nodes.Length );
}

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

function ClearEnding( EDialogEnding InEnding )
{
	local int i,j;
	local EDialogEnding CurrentEnding;
	
	for( i=0; i < DControllers.Length; i++ )
	{
		for( j=0; j < DControllers.Length; j++ )
		{
			if( i != j )
			{
				DControllers[i].GetDialogEnding( DControllers[j].DCSpeaker, CurrentEnding );
				if( CurrentEnding == InEnding )
					DControllers[i].SetDialogEnding( DControllers[j].Actor, DIALOGENDING_Normal );
			}
		}
	}
}

//-----------------------------------------------------------------------------
// Talk event (main node processing function)
//-----------------------------------------------------------------------------

event Talk()
{
	local int i;
	local float AudioLen;
	local Actor SpeakingActor;

	bAudioPlaying = true;													// keep track of when speaker's audio is playing
	bCantInterrupt = true;													// keep track of when someone can interrupt speaker
	
	SpeakingDC = class'DialogEngine'.static.StringToDC( Self, CurNode.Speaker );	// find the speaking actor and dialog controller
	SpeakingActor = SpeakingDC.Actor;

	PlaySoundFile( SpeakingDC, SpeakingActor );								// load and play audio file

	DoLipSync(SpeakingActor);												// play lip sync animations

	AdjustMoods();															// change speaker moods as authored
	
	TurnToFaceSpeaker( SpeakingDC );										// Turn to face speaker

	ProcessNodeProperties();												// copy current node properties to session variables

	ProcessHandlingNodes( SpeakingDC );										// pass any abort / resume nodes to their controllers

	CurNode.SetEndingFocus();

	AudioLen = CurNode.GetAudioLength();									// Get time when audio will have finished
	TimeElapsed = -AudioLen;												// set elapsed time to a negative countdown
	
	DisplayText( SpeakingDC, AudioLen );									// wake up when audio is done playing

	AddTimer( NoInterruptTimeFinishedTimer, AudioLen + CurNode.PostDelay );	// wake up when others can speak (interruptions)
	AddTimer( AudioFinishedTimer, AudioLen );								// wake up when audio is done playing

	CurNode.MakeAllPending();												// mark all of this node's actions as pending
	ProcessActions();														// Send out any node actions (events/animations)

	SpeakingDC.SetTalking( DIALOGBOOLEAN_True );
}

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

function ProcessHandlingNodes( DialogController SpeakingDC )
{
	local int i;

	for( i=0; i < CurNode.AbortMap.Length; i++ )
	{
		SpeakingDC.SetAbortTopic( CurNode.AbortMap[i] );
		DMDLG("Caching abort node" @ CurNode.AbortMap[i].AbortNodeName @ "for speaker" @ SpeakingDC.DCSpeaker @ "for abort type" @ EnumStr( enum'EDialogEnding', CurNode.AbortMap[i].Ending ) );
	}

	for( i=0; i < CurNode.ResumeMap.Length; i++ )
	{
		SpeakingDC.SetResumeTopic( CurNode.ResumeMap[i] );
		DMDLG("Caching resume node" @ CurNode.ResumeMap[i].ResumeNodeName @ "for speaker" @ SpeakingDC.DCSpeaker @ "for abort type" @ EnumStr( enum'EDialogEnding', CurNode.AbortMap[i].Ending ) );
	}
}

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

function PlaySoundFile( DialogController SpeakingDC, actor SpeakingActor )
{
	local int i;
	local actor SourceActor;

	if( CurNode.Filename == "" )
		return;

	for( i=0; i < CurNode.SoundSourceActors.Length; i++ )
	{
		if( CurNode.SoundSourceActors[i] != "" )
		{
			DMDLG("Sound source actor(" $ i $ ") = '" $ CurNode.SoundSourceActors[i] $ "'");

			if( Caps(CurNode.SoundSourceActors[i]) == PlayerSpeakerString )
			{
				// if the player pawn is unpossessed (ie. during matinee)
				// play sound out of the player controller (controlling the camera)
				if( Level.PlayerControllerList.Pawn != None )
					SourceActor = Level.PlayerControllerList.Pawn;
				else
					SourceActor = Level.PlayerControllerList;
				DMDLG("Playing sound out of the player:" @ SourceActor );
			}
			else
			{
				SourceActor = class'DialogEngine'.static.StringToActor(Self, CurNode.SoundSourceActors[i]);
				DMDLG("Playing sound out of:" @ SourceActor );
			}

			if( SourceActor == None )
			{
		        SourceActor = class'UtilGame'.static.GetNamedActor(Self, StringToName(CurNode.SoundSourceActors[i]));
				DMDLG("Searched for named actor for:" @ CurNode.SoundSourceActors[i] @ "result:" @ SourceActor );
			}
			if( CurNode.SoundSourceActors[i] != "" && SourceActor == None )
				DMDLG("Warning: PlaySoundFile -- unable to find dialog sound actor" @ CurNode.SoundSourceActors[i] );
		}

		LoadAndPlayAudioFile( CurNode, SourceActor );
	}

	if( CurNode.SoundSourceActors.Length == 0 )
		LoadAndPlayAudioFile( CurNode, SpeakingActor );
}

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

function LoadAndPlayAudioFile( DialogNode DN, actor SourceActor )
{
	local string OggFilename;

	// get sound parameters from node
	if( DN.SoundRadius	> 0 ) SoundRadius = DN.SoundRadius;
	if( DN.Volume		> 0 ) SoundVolume = DN.Volume;

	// use defaults as a fallback
	if( SoundRadius ~= 0.0 ) SoundRadius = SourceActor.TransientSoundRadius;
	if( SoundVolume ~= 0.0 ) SoundVolume = SourceActor.TransientSoundVolume;

	// Ogg files are stored relative to the Voice subdirectory (a standard defined within the ALAudioSubsystem implementation)
	OggFilename = GetOggFilename( DN.Filename );
	if( GetOggDuration( OggFilename ) > 0.0 )
	{
		DN.bUseOggVoice = true;
		DN.Voice = SourceActor.PlayVoice( OggFilename, SoundVolume, SoundRadius, 1.0 /*pitch*/ );
		DMDLG( "Play dialog sound (ogg) file:" @ OggFilename @ "through actor:" @ SourceActor );
	}
	else
	{
		DN.Voice = sound( DynamicLoadObject( CurNode.Filename, class'Sound' ) );
		SourceActor.PlaySound( DN.Voice, SLOT_Dialog, SoundVolume, true /*bNoOverride*/, SoundRadius, 1.0 /*pitch*/, true /*attenuate*/ );
		DMDLG( "Play dialog sound (wav) file:" @ CurNode.Filename @ "through actor:" @ SourceActor );
	}

	// cache the sound duration while we have the transient sound object handy
	if( DN.Voice != None )
		DN.AudioDuration = GetSoundDuration( DN.Voice );
}
	
//-----------------------------------------------------------------------------

function StopAudioFile()
{
	local int i;
	local actor A;

	if( CurNode != None )
	{
		for( i=0; i < CurNode.SoundSourceActors.Length; i++ )
		{
			A = class'UtilGame'.static.GetNamedActor( Self, StringToName(CurNode.SoundSourceActors[i]) );
			DoStopAudio( A, CurNode );
		}
		if( CurNode.SoundSourceActors.Length == 0 )
			DoStopAudio( SpeakingDC.Actor, CurNode );
	}
}

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

function DoStopAudio( Actor A, DialogNode DN )
{
	local string OggFilename;

	if( A != None )
	{
		if( DN.bUseOggVoice )
		{
			OggFilename = GetOggFilename( DN.Filename );
			A.StopVoiceFile( OggFilename );
		}
		else
			A.StopSoundSlot( SLOT_Dialog );
		
		DMDLG( "Stopping dialog audio for:" @ A @ "(" $ A.Speaker $ ")");
	}
}

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

function TurnToFaceSpeaker( DialogController SpeakingDC )
{
	local int i;

	switch( CurNode.TurnToSpeaker )
	{
	case DIALOGBOOLEAN_True:
		for( i=0; i < DControllers.Length; i++ )
			if( DControllers[i] != SpeakingDC )
			{
				SpeakingDC.TurnToFace( DControllers[i].Actor );
				break;
			}
		break;
	case DIALOGBOOLEAN_False:
		SpeakingDC.TurnToFace( None );
		break;
	default:
		break;
	}
}

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

function DisplayText( DialogController SpeakingDC, float TimeToDisplay )
{
	local float W, H, WrapX;
	local Console Console;
	local DialogController TempDC;
	local DialogControllerPlayer PlayerDC;
	local string SubtitleText;
	local color SubtitleColor;
	local bool bPlayerIsTalking;
	local actor Listener;

	if( CurNode.LongText == "" )
	{
		//DMDLG("DisplayText -- No long text");
		return;
	}

	if( SpeakingDC == None )
	{
		//DMDLG("DisplayText -- No speaker" @ CurNode.LongText );
		return;
	}

	Console = class'UIConsole'.static.GetConsole();
	if( Console == None )
	{
		//DMDLG("DisplayText -- no console" @ CurNode.LongText );
		return;
	}

	if( !class'UIConsole'.static.GetPlayerOwner().ShowSubtitles )
	{
		//DMDLG("DisplayText -- player's subtitles are off" @ CurNode.LongText );
		return;
	}

	PlayerDC = DialogControllerPlayer( DE.StringToDC( Self, PlayerSpeakerString ));
	if( PlayerDC == None )
	{
		//DMDLG("DisplayText -- can't get player dc" @ CurNode.LongText );
		return;
	}

	bPlayerIsTalking = Contains( PlayerSpeakerString );

	// don't display 3rd party subtitles if player is too far away
	if( !bPlayerIsTalking && CurNode.SubtitleRadius > 0 )
	{
		// compensate for dispossessed players (ie. during matinee)
		Listener = Level.PlayerControllerList;
		if( Level.PlayerControllerList.Pawn != None )
			Listener = Level.PlayerControllerList.Pawn;

		if( VSize( Listener.Location - Location ) > CurNode.SubtitleRadius )
		{
			DMDLG("DisplayText -- player is not withing subtitle radius:" @ CurNode.SubtitleRadius);
			return;
		}
	}

	// only display subtitles for the player's conversation or to an outside conversation when he's not talking
	if( bPlayerIsTalking || !class'DialogEngine'.static.IsAlreadyTalking( Level.PlayerControllerList.Pawn ) )
	{
		SubtitleText = CurNode.LongText;

		// compute wrapping width of text
		Console.TextSize( DE.SubtitleFont, SubtitleText, W, H );
		WrapX = W + DE.SubtitlePadding;
		if( WrapX > DE.SubtitleBoxWidth )
			WrapX = DE.SubtitleBoxWidth;

		if( bPlayerIsTalking || class'UtilGame'.static.CutSceneIsRunning( Self ) )
			SubtitleColor = DE.SubtitleColorPlayer;
		else
			SubtitleColor = DE.SubtitleColorOther;

		class'UIConsole'.static.BroadcastStatusMessage( Self, SubtitleText, TimeToDisplay, DE.SubtitleFont, SubtitleColor,/*sound*/,/*volume*/,/*pitch*/, "DialogSubtitlesHolder", true, WrapX );
	}

	// echo to log in debug mode
	DMDLG( SubtitleText );
}

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

function ProcessNodeProperties()
{
	local int i;

	// make any tone changes
	if( CurNode.ToneChange != 0 /*DIALOGTONE_None*/ )
		Tone = CurNode.ToneChange;

	// Update talk radius
	TalkRadius = CurNode.TalkRadius;

	// Add exit events to this session
	for( i=0; i < CurNode.ExitEvents.Length; i++ )
		ExitEvents[ExitEvents.Length] = CurNode.ExitEvents[i];

	for( i=0; i < CurNode.NodeEnables.Length; i++ )
		// Add exit enables to this session
		if( CurNode.NodeEnables[i].bOnExit != 0 )
			ExitEnables[ExitEnables.Length] = CurNode.NodeEnables[i];
}

//-----------------------------------------------------------------------------
// Special Handling events
//-----------------------------------------------------------------------------

event NotifyDialogAborted( actor AbortingActor )
{
	local int i;

	DMDLG(AbortingActor @ "just exited from dialog by user request" );

	NoInterruptTimeFinished();

	if( DialogStatus != DIALOGSTATUS_Aborting )
	{
		// store this event in the status map of the affected DC
		for( i=0; i < DControllers.Length; i++ )
		{
			if( DControllers[i].Actor != AbortingActor )
			{
				DControllers[i].SetDialogEnding( AbortingActor, DIALOGENDING_SpeakerHitEscape);
			}
		}
		
		TryAbortDialog();
	}
}

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

event NotifyDialogWalkedAway( actor LeavingActor )
{
	local int i;

	DMDLG(LeavingActor @ "just walked away from dialog -- talk radius:" @ TalkRadius );

	if( DialogStatus != DIALOGSTATUS_Aborting )
	{
		// store this event in the status map of the affected DC
		for( i=0; i < DControllers.Length; i++ )
		{
			if( DControllers[i].Actor != LeavingActor )
			{
				DControllers[i].SetDialogEnding( LeavingActor, DIALOGENDING_SpeakerWalkedAway );
			}
		}
	
		TryAbortDialog();
	}
}

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

event NotifyDialogScriptedAbort( actor ScriptedActor )
{
	local int i;

	DMDLG(ScriptedActor @ "was scripted to leave dialog" );

	if( DialogStatus != DIALOGSTATUS_Aborting )
	{
		// store this event in the status map of the affected DC
		for( i=0; i < DControllers.Length; i++ )
		{
			if( DControllers[i].Actor != ScriptedActor )
			{
				DControllers[i].SetDialogEnding( ScriptedActor, DIALOGENDING_ScriptedAbort );
			}
		}
	
		TryAbortDialog();
	}
}

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

event NotifyInterruption( actor NewInterrupter, actor NewInterruptTarget, bool bInterrupterTalking )
{
	local int i;
	DMDLG( NewInterrupter @ "is interrupting" @ NewInterruptTarget );

	// cache the interrupt actors
	Interrupter = NewInterrupter;
	InterruptTarget = NewInterruptTarget;

	for( i=0; i < DControllers.Length; i++ )
	{
		if( DControllers[i].Actor == Interrupter )
		{
			if( !bInterrupterTalking )
			{
				DMDLG("Setting interrupt request ending for" @ DControllers[i].DCSpeaker @ "to" @ InterruptTarget );
				DControllers[i].SetDialogEnding( InterruptTarget, DIALOGENDING_InterruptRequest );
			}
		}
		else if( DControllers[i].Actor == InterruptTarget ) 
		{
			DMDLG("Setting interrupt response ending for" @ DControllers[i].DCSpeaker @ "to" @ Interrupter );
			DControllers[i].SetDialogEnding( Interrupter, DIALOGENDING_InterruptResponse );
		}
		else
		{
			DMDLG("Setting interrupt walkaway ending for" @ DControllers[i].DCSpeaker @ "to" @ Interrupter );
			DControllers[i].SetDialogEnding( Interrupter, DIALOGENDING_InterruptWalkAway );
		}
	}

	// process interrupt stages of dialog
	if( !TryInterruptRequestDialog() )
	{
		if( !TryInterruptResponseDialog() )
		{
			if( !TryInterruptWalkAwayDialog() )
			{
				TryNormalDialog();
			}
		}
	}
}

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

function NotifyDialogSpeakerDamaged( actor DamagedActor )
{
	// mib-tbd: other behavior?
	DMDLG("Speaker" @ DamagedActor.Speaker @ "has taken damage / been killed -- setting bSessionFinished to true and Status to SpaekerDamaged");
	bSessionFinished = true;
	DialogStatus = DIALOGSTATUS_SpeakerDamaged;
}

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

function RescaleTimer( name TimerFuncName, float ScaleFactor )
{
	local float RemainingSeconds;

	RemainingSeconds = TimeRemaining( TimerFuncName );
	if( RemainingSeconds > 0 )
	{
		RemoveTimer( TimerFuncName );
		AddTimer( TimerFuncName, RemainingSeconds * ScaleFactor );
	}
}

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

function NotifyLevelChangeEnd()
{
	// re-display the subtitle
	DisplayText( SpeakingDC, -TimeElapsed );
}

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

event NotifyGameSpeedChanged( float OldGameSpeed, float NewGameSpeed )
{
	if( OldGameSpeed > 0 && DE.AllowSlomo )
	{
		RescaleTimer( NoInterruptTimeFinishedTimer, NewGameSpeed / OldGameSpeed );
		RescaleTimer( AudioFinishedTimer, NewGameSpeed / OldGameSpeed );
	}
}

//-----------------------------------------------------------------------------
// callback when its okay for others to speak
//
function NoInterruptTimeFinished()
{
	RemoveTimer( 'NoInterruptTimeFinished' );
	NodeCompleted();
	bCantInterrupt = false;
}

//-----------------------------------------------------------------------------
// callback for when audio is completed/terminated
//
event AudioFinished()
{
	RemoveTimer( AudioFinishedTimer );
	bAudioPlaying = false;
	if( SpeakingDC != None )
		SpeakingDC.SetTalking( DIALOGBOOLEAN_False );
}

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

function AdjustMoods()
{
	local int i;
	local DialogController DC;
	for( i=0; i < CurNode.MoodChanges.Length; i++ )
	{
		if( CurNode.MoodChanges[i].Who != '' )
			DC = class'DialogEngine'.static.NameToDC( Self, CurNode.MoodChanges[i].Who );
		else
			DC = class'DialogEngine'.static.StringToDC( Self, CurNode.Speaker );

		DC.ChangeMood( CurNode.MoodChanges[i].Amount );
	}
}

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

function int GetLipSyncChannel( actor SpeakingActor )
{
	local int i, count;

	count = SpeakingActor.MeshAgentGetChannelCount();
	if (count==0)
		return 8; // non-agentized character, use the old hardcoded channel 8
	
	// try to find agent channel named LipSync, if it exists
	for (i=0;i<count;i++)
	{
		if (MeshAgentGetChannelName(i) == 'LipSync')
		{
			MeshAgentEnableChannel(i, false); // disable agent mode; we're controlling this manually
			return i;
		}
	}
	
	// lipsync channel not found; use channel immediately after agent channels
	return count;
}

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

function DoLipSync( actor SpeakingActor )
{
	local name Anim;
	local int TempInt;
	local string TempStr;

	if( CurNode.bDoLipSync )
	{
		// Lip-sync animation uses the same name as the audio file minus the package name
		// CDH... need to handle more than one dot (for group names)
		TempStr = CurNode.Filename;
		TempInt = InStr(TempStr, ".");
		while (TempInt >= 0)
		{
			TempStr = Mid(TempStr, TempInt + 1);
			TempInt = InStr(TempStr, ".");
		}
		Anim = StringToName(TempStr, true);
	
		if( SpeakingActor.Mesh != None &&
			SpeakingActor.GetAnimFrames( Anim ) > 0 )
			SpeakingActor.PlayAnim( Anim,,,GetLipSyncChannel(SpeakingActor) );
	}
}

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

function ProcessActions()
{
	local float SleepTime;

	if( CurNode != None )
	{
		// first carry out any actions that are ready to go
		CurNode.ProcessActions(Self);

		// sleep until the soonest action should happen
		if( CurNode.MinPendingPctDelay() > 0 )
		{
			SleepTime = (CurNode.MinPendingPctDelay() * CurNode.GetAudioLength()) - (TimeElapsed + CurNode.GetAudioLength());
			AddTimer( 'ProcessActions', SleepTime );
		}
	}
}

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

function DisplayDebugInfo( out int LineCount, out array<string> Text )
{
	local int i,j;

	Text[LineCount] = "Speakers:" @ DControllers.Length;	LineCount++;

	for( i=0; i < DControllers.Length; i++ )
	{
		if( DControllers[i] != None )
		{
			Text[LineCount] = DControllers[i].DisplayDebugInfo();
			LineCount++;
		}
	}

	Text[LineCount] = "Dialog Trees:" @ Trees.Length;		LineCount++;

	for( i=0; i < Trees.Length; i++ )
	{
		if( Trees[i].NextNodes[0] != None )
		{
			Text[LineCount] = "  Root:" @ Trees[i].Topic @ " bEnabled:" @ Trees[i].NextNodes[0].bEnabled @ "UseBookmark:" @ EnumStr( enum'EDialogBoolean', Trees[i].UseBookmark );
			LineCount++;

			for( j=0; j < Trees[i].NextNodes[0].NextNodes.Length; j++ )
			{
				Text[LineCount] = "  SubTopic:" @ Trees[i].NextNodes[0].NextNodes[j].Tag @ " bEnabled:" @ Trees[i].NextNodes[0].NextNodes[j].bEnabled @ "UseBookmark:" @ EnumStr( enum'EDialogBoolean', Trees[i].UseBookmark );
				LineCount++;
			}
		}
	}

	if( CurNode == None )
	{
		Text[LineCount] = "Current node: None";		LineCount++;
		Text[LineCount] = "Bookmarked node: None";	LineCount++;
	}
	else
	{
		Text[LineCount] = "Current node:" @ CurNode.ShortText @ "(" $ CurNode.SpokenCount $ "/" $ CurNode.SpokenMax $ ")";	LineCount++;
		if( CurNode.Tree == None ||
			CurNode.Tree.Bookmark == None )
		{
			Text[LineCount] = "Bookmarked node: None";	LineCount++;
		}
		else
		{
			Text[LineCount] = "Bookmarked node: " @ CurNode.Tree.Bookmark.ShortText @ "(" $ CurNode.SpokenCount $ "/" $ CurNode.SpokenMax $ ")";	LineCount++;
		}
	}
	
	Text[LineCount] = "Status:" @ EnumStr( enum'EDialogStatus', DialogStatus);			LineCount++;

	Text[LineCount] = "Time since audio finished:" @ TimeSinceLastSpoken();				LineCount++;
	Text[LineCount] = " ";	LineCount++;
}

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

defaultproperties
{
	Tone=DIALOGTONE_Formal
     UseReticleOnEvents(0)="UseReticleText"
     UseReticleOnEvents(1)="UseReticleCorners"
     UseReticleOnEvents(2)="UseReticleTopBars"
     ProximityReticleOnEvents(0)="ProximityReticleCorners"
     ProximityReticleOnEvents(1)="ProximityReticleTopBars"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: sk 3-1-2016 10:38:42.000 - Creation time: sk 3-1-2016 10:48:38.188 - Created with UnCodeX