[UT99] Dialogue Trigger

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Raven

Member
Jan 17, 2004
147
0
16
40
turniej.unreal.pl
I want to make trigger, that sends message to player, and play sound, in the same time. It's dialogue trigger with 16 slots for messages, sounds and delays. Script below do this (well not exacly), the only problem is that, the message doesn't show in game. What is wrong??
Code:
//================================================================================
// Dialogue: This is Special trigger designed for dialogues. The most important
//           thing, is to corectly set up DialogueDelay.
//================================================================================
// author: Raven (Nargil)
// mail: [email]raven3@pf.pl[/email]
// www: [url]http://turniej.unreal.pl[/url]
// www: [url]http://ued2.prv.pl[/url]
//================================================================================
class Dialogue extends Triggers;


var(Dialogue) string	DialogueText[16];
var(Dialogue) sound 	DialogueSound[16];
var(Dialogue) float	DialogueDelay[16];
var int i;
var PlayerPawn P;

function Trigger( actor Other, pawn EventInstigator)
{

	Instigator = EventInstigator;
	gotostate('Dial');

}


state Dial
{
Begin:
	disable('Trigger');

	for (i=0; i<16; i++)
	{
		if(DialogueText[i] != "" )
		{
			P.ClientMessage( DialogueText[i] );
			PlaySound(DialogueSound[i], SLOT_Talk, 1, false, 1000.0, 1.0);
			Sleep( DialogueDelay[i] );
		}
	}

	enable('Trigger');
}

defaultproperties
{
     Texture=Texture'UnrealShare.S_Message'
}
 

Raven

Member
Jan 17, 2004
147
0
16
40
turniej.unreal.pl
When I do it in function trigger, always goes the last 16 slot. anyway, in new version I use broadcasting, and all, working, script looks like this:

Code:
//================================================================================
// Dialogue: This is Special trigger designed for dialogues. The most important
//           thing, is to corectly set up DialogueDelay.
//================================================================================
// author: Raven (Nargil)
// mail: [email]raven3@pf.pl[/email]
// www: [url]http://turniej.unreal.pl[/url]
// www: [url]http://ued2.prv.pl[/url]
//================================================================================
class Dialogue extends Triggers;

#exec TEXTURE IMPORT NAME=SP_Dialogue FILE="textures\Icons\SP_Dialogue.pcx" GROUP=Icons LODSET=2

var(Dialogue) string	DialogueText[16];
var(Dialogue) sound 	DialogueSound[16];
var(Dialogue) float	DialogueDelay[16];
var int i;
var Pawn P;

function Trigger( actor Other, pawn EventInstigator)
{

	Instigator = EventInstigator;
	gotostate('Dial');

}

state Dial
{
Begin:
	disable('Trigger');

	for (i=0; i<16; i++)
	{
		if(DialogueText[i] != "" )
		{
		for( P=Level.PawnList; P!=None; P=P.nextPawn )
          		if(P.bIsPlayer)
             			 P.ClientMessage( DialogueText[i] );
			PlaySound(DialogueSound[i], SLOT_Talk, 1, false, 1000.0, 1.0);
			Sleep( DialogueDelay[i] );
		}
	}

	enable('Trigger');
}

defaultproperties
{
     Texture=Texture'SPSystem.Icons.SP_Dialogue'
}