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'
}