Achievement Stat/Function Reading

  • 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/

FluX

Grizzled Veteran
Oct 26, 2010
5,394
234
63
www.fluxiserver.co.uk
Hey, i'm trying to implement it for one of my stats for a custom perk for when they survive a wave. Now the problem is, i'm getting errors.

Gametype:
Code:
        if ( Level.NetMode != NM_StandAlone && Level.Game.NumPlayers > 1 &&
             SurvivorCount == 1 && Survivor != none && KFSteamStatsAndAchievements(Survivor.SteamStatsAndAchievements) != none )
        {
            KFSteamStatsAndAchievements(Survivor.SteamStatsAndAchievements).AddOnlySurvivorOfWave();
        }
		// Addition for the Survivor waves survived.
		else ( KFPlayerReplicationInfo(Survivor.PlayerReplicationInfo).ClientVeteranSkill == class'SRVetSurvivor'  && Survivor != none )
			ServerStStats(Survivor.SteamStatsAndAchievements).AddSurvivorWave();

Error:
Error, 'ServerStStats': Expression has no effect

I don't understand why i'll get this error if i'm calling a function from another class file. Any ideas?
 

FluX

Grizzled Veteran
Oct 26, 2010
5,394
234
63
www.fluxiserver.co.uk
Does AddSurvivorWave() returning a class or something like a bool or int?

An int like the other stat functions.

Code:
function AddSurvivorKill()
{
	local int Amount;

		Amount = 1;

	bHasChanged = true;
		Amount = Amount * MutatorOwner.ExperienceScaling;
	Rep.RSurvivorKills += Amount;
	if( MyStatsObject!=None )
		MyStatsObject.SurvivorKills+=Amount;
	DelayedStatCheck();
}
 

forrestmark9

FNG / Fresh Meat
Nov 29, 2011
1,110
40
0
An int like the other stat functions.

That's weird, the error you get happens if your returning a value without a <var> = like int1 + int2 or you're using the incorrect syntax for assigning values to array elements
 

FZFalzar

FNG / Fresh Meat
May 11, 2011
128
3
0
UCC.exe
It looks like a very basic programming mistake.

Your condtions are supposed to be:

Code:
if(condition1)
{
}
else if(condition2)
{
}
else
{
//it is implied that none of the conditions are met here
}

You seem to be trying to put a condition in the else bit, which seems to be the problem here
 

Dinamix

FNG / Fresh Meat
Mar 23, 2012
199
1
0
Hey, i'm trying to implement it for one of my stats for a custom perk for when they survive a wave. Now the problem is, i'm getting errors.

Gametype:
Code:
        if ( Level.NetMode != NM_StandAlone && Level.Game.NumPlayers > 1 &&
             SurvivorCount == 1 && Survivor != none && KFSteamStatsAndAchievements(Survivor.SteamStatsAndAchievements) != none )
        {
            KFSteamStatsAndAchievements(Survivor.SteamStatsAndAchievements).AddOnlySurvivorOfWave();
        }
		// Addition for the Survivor waves survived.
		[COLOR="Red"]else[/COLOR] ( KFPlayerReplicationInfo(Survivor.PlayerReplicationInfo).ClientVeteranSkill == class'SRVetSurvivor'  && Survivor != none )
			ServerStStats(Survivor.SteamStatsAndAchievements).AddSurvivorWave();

Error:


I don't understand why i'll get this error if i'm calling a function from another class file. Any ideas?

should be there else if instead of else?

Edit: Ups didn't saw FZFalzar already mentioned :(
 
Last edited: