• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Trader last 30 seg sound

tunins

Grizzled Veteran
Apr 24, 2011
94
1
Chile
iwg.cl
hi hi everyone

I'm planning to add a sound when the trader time 30 seconds left, the sound is "civil defense alarm" the silent hill. This gives it a more tense in the game and gives a bit scary haha.

But when I try to compile the mutator was as follows:

AlarmTrader class extends KFGameType;

# exec AUDIO IMPORT FILE = "Sounds \ AlarmT.WAV" NAME = "AlarmT"

function Timer ()

KFGameReplicationInfo (GameReplicationInfo). TimeToNextWave = WaveCountDown;
if (WaveCountDown == 30)
{
for (C = Level.ControllerList; C! = None, C = C. NextController)
{
if (KFPlayerController (C)! = None)
{
/ / tell players Trader Have That They've got 30 seconds
KFPlayerController (C). ClientLocationalVoiceMessage (C. PlayerReplicationInfo, none, 'Trade', 4);
PlaySound (Sound'AlarmT 'SLOT_Misc, 30.0);

}
}
}

defaultProperties
{

bAlwaysRelevant = True
GroupName = "KFAlarmTrader"
FriendlyName = "AlarmTrader"
Description = "AlarmTrader last 30 seconds"

fails to compile, I'm doing wrong? I am very new to this, if anyone can help me on this idea, I appreciate.

This is the sound:

http://www.mediafire.com/?4ieu85c18ea8ns9

thanks
 
AlarmTrader class extends Mutator;

# exec AUDIO IMPORT FILE = "Sounds \ AlarmT.WAV" NAME = "AlarmT"

function Timer ()
local float WaveCountDown;

KFGameReplicationInfo (GameReplicationInfo). TimeToNextWave = WaveCountDown;
if (WaveCountDown == 30)
{
for (C = Level.ControllerList; C! = None, C = C. NextController)
{
if (KFPlayerController (C)! = None)
{
/ / tell players Trader Have That They've got 30 seconds
KFPlayerController (C). ClientLocationalVoiceMessage (C. PlayerReplicationInfo, none, 'Trade', 4);
PlaySound (Sound'AlarmT 'SLOT_Misc, 30.0);

}
}
}

defaultProperties
{

bAlwaysRelevant = True
GroupName = "KFAlarmTrader"
FriendlyName = "AlarmTrader"
Description = "AlarmTrader last 30 seconds"
}
 
Upvote 0
AlarmTrader class extends Mutator;

# exec AUDIO IMPORT FILE = "Sounds \ AlarmT.WAV" NAME = "AlarmT"

function Timer ()
local float WaveCountDown;

KFGameReplicationInfo (GameReplicationInfo). TimeToNextWave = WaveCountDown;
if (WaveCountDown == 30)
{
for (C = Level.ControllerList; C! = None, C = C. NextController)
{
if (KFPlayerController (C)! = None)
{
/ / tell players Trader Have That They've got 30 seconds
KFPlayerController (C). ClientLocationalVoiceMessage (C. PlayerReplicationInfo, none, 'Trade', 4);
PlaySound (Sound'AlarmT 'SLOT_Misc, 30.0);

}
}
}

defaultProperties
{

bAlwaysRelevant = True
GroupName = "KFAlarmTrader"
FriendlyName = "AlarmTrader"
Description = "AlarmTrader last 30 seconds"
}

Thanks yoyo, but when i compile the mutator, this:
Code:
class AlarmTraderMut extends Mutator;

#exec AUDIO IMPORT FILE="alarmt.WAV" NAME="AlarmT"

function Timer()
{
local float WaveCountDown;

	KFGameReplicationInfo(GameReplicationInfo).TimeToNextWave = WaveCountDown;
			if ( WaveCountDown == 30 )
			{
				for ( C = Level.ControllerList; C != None; C = C.NextController )
				{
					if ( KFPlayerController(C) != None )
					{
						// Have Trader tell players that they've got 30 seconds
						KFPlayerController(C).ClientLocationalVoiceMessage(C.PlayerReplicationInfo, none, 'TRADER', 4);
						PlaySound (Sound'alarmt 'SLOT_Misc, 30.0);
					}
				}
			}
	
	
}

defaultProperties
{
	bAlwaysRelevant = True
	GroupName = "KFAlarmTrader"
	FriendlyName = "AlarmTrader"
	Description = "AlarmTrader last 30 seconds"
}
get this error:
Code:
Analyzing...
Parsing AlarmTraderMut
Compiling AlarmTraderMut
D:\KF1021\AlarmTrader\Classes\AlarmTraderMut.uc(9) : Error, 'KFGameReplicationInfo': Bad command or expression
Compile aborted due to errors.
Failure - 1 error(s), 0 warning(s)
Log file closed, 05/15/11 18:26:47

What is the problem? :( thanks
 
Upvote 0
Code:
class AlarmTraderMut extends Mutator;

#exec AUDIO IMPORT FILE="alarmt.WAV" NAME="AlarmT"

function Timer()
{
local float WaveCountDown;

KFGameReplicationInfo(Level.Game.GameReplicationInfo).TimeToNextWave = WaveCountDown;
if ( WaveCountDown == 30 )
{
for ( C = Level.ControllerList; C != None; C = C.NextController )
{
if ( KFPlayerController(C) != None )
{
// Have Trader tell players that they've got 30 seconds
KFPlayerController(C).ClientLocationalVoiceMessage(C.PlayerReplicationInfo, none, 'TRADER', 4);
PlaySound (Sound'alarmt 'SLOT_Misc, 30.0);
}
}
}


}

defaultProperties
{
bAlwaysRelevant = True
GroupName = "KF-AlarmTrader"
FriendlyName = "AlarmTrader"
Description = "AlarmTrader last 30 seconds"
}

There ya go :)
 
Upvote 0
Code:
class AlarmTraderMut extends Mutator;

#exec AUDIO IMPORT FILE="alarmt.WAV" NAME="AlarmT"

function Timer()
{
local float WaveCountDown;

KFGameReplicationInfo(Level.Game.GameReplicationInfo).TimeToNextWave = WaveCountDown;
if ( WaveCountDown == 30 )
{
for ( C = Level.ControllerList; C != None; C = C.NextController )
{
if ( KFPlayerController(C) != None )
{
// Have Trader tell players that they've got 30 seconds
KFPlayerController(C).ClientLocationalVoiceMessage(C.PlayerReplicationInfo, none, 'TRADER', 4);
PlaySound (Sound'alarmt 'SLOT_Misc, 30.0);
}
}
}


}

defaultProperties
{
bAlwaysRelevant = True
GroupName = "KF-AlarmTrader"
FriendlyName = "AlarmTrader"
Description = "AlarmTrader last 30 seconds"
}

There ya go :)

thanks again YoYo, but another problem occurred, I tried to compile but got an error on the value "C", put it: "local Controller C" and compiled, but when I tasted the mutator, nothing happened, no sound. .. what is the problem now: c, sorry for so many questions

the code:

Code:
class AlarmTraderMut extends Mutator;

#exec AUDIO IMPORT FILE="alarmt.WAV" NAME="AlarmT"

function Timer()
{
	local Controller C;
	local float WaveCountDown;

	KFGameReplicationInfo(Level.Game.GameReplicationInfo).TimeToNextWave = WaveCountDown;
	if ( WaveCountDown == 30 )
	{
		for ( C=Level.ControllerList;C!=None;C=C.NextController )
		{
			if ( KFPlayerController(C) != None )
			{
				PlaySound(Sound'AlarmT');

			}
		}
	}


}

defaultProperties
{
GroupName = "KF-AlarmTrader"
FriendlyName = "AlarmTrader"
Description = "AlarmTrader last 30 seconds"
}
 
Upvote 0
try KFPlayerController(C).PlaySound(Sound'AlarmT');

doesn't sound i try this:

#exec AUDIO IMPORT FILE="alarmt.WAV" NAME="AlarmT"

function Timer()
{
local float WaveCountDown;

KFGameReplicationInfo(Level.Game.GameReplicationInfo).TimeToNextWave = WaveCountDown;
if ( WaveCountDown == 30 )
{

PlaySound (Sound'alarmt 'SLOT_Misc, 30.0);

}

defaultProperties
{
bAlwaysRelevant = True
GroupName = "KF-AlarmTrader"
FriendlyName = "AlarmTrader"
Description = "AlarmTrader last 30 seconds"
}

and nothing
 
Upvote 0
Code:
Class AlarmTrader extends Mutator;

#exec AUDIO IMPORT FILE="Sounds\AlarmT.WAV" NAME="AlarmT"

function MatchStarting()
{
    Destroyed(); // Remove from mutator list as not needed there.
    SetTimer(1,true);
}
function Timer ()
{
    if ( KFGameReplicationInfo(Level.GRI).TimeToNextWave==30 )
    {
        for (C = Level.ControllerList; C! = None, C = C. NextController)
            if ( PlayerController(C)!=None )
                PlayerController(C).ClientPlaySound(Sound'AlarmT');
    }
}

defaultProperties
{
    GroupName="KFAlarmTrader"
    FriendlyName="AlarmTrader"
    Description="AlarmTrader last 30 seconds"
}
..should do the trick.
 
Upvote 0
hello all i have an error after compil

Code:
Class AlarmTrader extends Mutator;

#exec AUDIO IMPORT FILE="Sounds\Alarm_S.WAV" NAME="Alarm_S"

function MatchStarting()
{
    Destroyed(); // Remove from mutator list as not needed there.
    SetTimer(1,true);
}
function Timer ()
{
    if ( KFGameReplicationInfo(Level.GRI).TimeToNextWave==40 )
    {
        for (C = Level.ControllerList; C! = None, C = C. NextController)
            if ( PlayerController(C)!=None )
                PlayerController(C).ClientPlaySound(Sound'Alarm_S');
    }
}

defaultProperties
{
    GroupName="KFAlarmTrader"
    FriendlyName="AlarmTrader"
    Description="AlarmTrader last 40 seconds"
}
Parsing AlarmTrader
Compiling AlarmTrader
C:\Program Files (x86)\Steam\SteamApps\common\KillingFloor\AlarmTrader\Classes\A
larmTrader.uc(14) : Error, 'C': Bad command or expression
Compile aborted due to errors.
Failure - 1 error(s), 0 warning(s)
 
Last edited:
Upvote 0