• 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/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

Trader last 30 seg sound

tunins

FNG / Fresh Meat
Apr 24, 2011
94
1
0
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
 

YoYoBatty

FNG / Fresh Meat
Dec 17, 2009
3,468
2,503
0
Canada
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"
}
 

tunins

FNG / Fresh Meat
Apr 24, 2011
94
1
0
Chile
iwg.cl
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
 

YoYoBatty

FNG / Fresh Meat
Dec 17, 2009
3,468
2,503
0
Canada
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 :)
 

tunins

FNG / Fresh Meat
Apr 24, 2011
94
1
0
Chile
iwg.cl
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"
}
 

tunins

FNG / Fresh Meat
Apr 24, 2011
94
1
0
Chile
iwg.cl
You should probably add

Simulated function PostBeginPlay()
{
SetTimer(0.1,True);
}

right before function Timer()
Thanks YoYo , but doesn't work again :(


Code:
PlaySound(Sound'AlarmT');
y agregate this:

Code:
PlaySound(Sound'AlarmT',,1.0);
and doesn't sound :(
 

YoYoBatty

FNG / Fresh Meat
Dec 17, 2009
3,468
2,503
0
Canada
Try putting Your package name in front of AlarmT so it would look like Sound'Replacewithpackagename.AlarmT'
 

tunins

FNG / Fresh Meat
Apr 24, 2011
94
1
0
Chile
iwg.cl
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
 

Marco

Active member
May 23, 2009
644
230
43
Finland
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.
 

***Stuxnet***

FNG / Fresh Meat
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: