I looked it up, and it DynamicLoads audio, which was interesting. The audio file playing was:
Code: Select all
function PostBeginPlay()
{
local byte i;
local FlagBase fb;
local bool IsTrue;
local string ServerPackages;
Log("+----------------------------------------------------------------------------------------------------+");
Log("| ");
Log("| FlagAnnouncements Loading ... ");
Log("| Author - The_Cowboy ");
Log("| Voicepack - "@VoicePack@" ");
Log("| ");
// Get server actor list.
ServerPackages = (consoleCommand("get Engine.GameEngine ServerPackages"));
if( !(instr(ServerPackages, Voicepack ) > 0) )
{
Log("| (Error) - VoicePack "@VoicePack@" is not found in ServerPackages");
Log("| FlagAnnouncements will now destroy itself ");
Log("+----------------------------------------------------------------------------------------------------+");
super.PostBeginPlay();
Destroy();
return;
}
if ( bPickupAnnouncement )
{
Log("|++ Loading FlagPickup Announcement ");
if (!(DynamicLoadSound(PickupAnnouncement[0],"RedFlag_Taken")
&& DynamicLoadSound(PickupAnnouncement[1],"BlueFlag_Taken")))
LogError("Flag_taken","PickupAnnouncement");
}
else Log("|-- FlagPickup Announcement not loaded ");
[.............]
}
// =============================================================================
// DynamicLoadSound ~ Load a sound from our VoicePack
// =============================================================================
function bool DynamicLoadSound (out sound zzSound, string zzSoundName)
{
// zzLastSoundName = zzSoundName;
zzSound = sound(DynamicLoadObject(VoicePack$"."$zzSoundName,class'sound',true));
if (zzSound == None)
return false;
else
return true;
}
function PlayDroppedAnnouncement(byte Team)
{
local Pawn P;
for ( P=Level.PawnList; P!=None; P=P.nextPawn )
{
if (PlayerPawn(P) != None && DroppedAnnouncement[Team] != None)
PlayerPawn(P).ClientPlaySound(DroppedAnnouncement[Team]);
}
}
Interesting mutator.
Does this
Code: Select all
ServerPackages = (consoleCommand("get Engine.GameEngine ServerPackages"));
load ALL server package names into a comma delimited string? Then you use:
Code: Select all
if( !(instr(ServerPackages, Voicepack ) > 0) )
to ensure this mutator ONLY loads if that package ('Voicepack') is in the string? So for example, if my code depends on ChaosUT, i could do this:
Code: Select all
if( !(instr(ServerPackages, "ChaosUT") > 0) )
and my code will detect if ChaosUT isn't included as a loaded package? And this can be any package name? What if I want to check for a package when NOT running on a server? (local client only / self host client)?
I also use essentially the same code to play the sound, and my sound doesn't play :/ Ideas?
EDIT:
I found an issue:
The sounds I have are NONE when I check using an if statement... Why would this be?
I set it in the default properties block..... And there's no import errors.....
IntroSound=Sound'MyGame.Announcer.MyIntro',