I've created Hi-Score, and I want to save it in .ini. Specially for this I have created this Scripts.
RabbitPlayer is just another UnrealPlayer class (new model).
When I try to compile this I have an error (RabbitEndGameTrigger):
Unrecognized member 'SaveScores' in class 'Class'
And I can't read value of Score in RabbitScoreKeeper (RabbitEndGameTrigger line TPScore=RabbitPlayer(Instigator).ScoreHolder.Score; ).
Anyone can help me?
Code:
class RabbitEndGameTrigger extends Triggers;
function Touch(actor Other)
{
local RabbitScoreKeeper scoreholder;
local string TPName;
local int TPScore, TPDiff;
local RabbitHSClient RHS;
Instigator=pawn(Other);
ScoreHolder=RabbitScoreKeeper(RabbitPlayer(Instigator).FindInventoryType(class 'RabbitScoreKeeper'));
TPName=RabbitPlayer(Instigator).PlayerReplicationInfo.PlayerName;
TPScore=RabbitPlayer(Instigator).ScoreHolder.Score;
TPDiff=Level.Game.Difficulty;
Class'RabbitHSClient'.SaveScores(TPName, TPSCore, TPDiff);
Disable('Touch');
}
Code:
class RabbitHSClient extends UMenuDialogClientWindow
config(RabbitGame);
var config string TPlayerName[10];
var config int TPlayerScore[10];
var config string TPlayerDiff[10];
var string difficulties[4];
//This will be High Score Window. Now it can only save scores...
function SaveScores(string TPName, int TPScore, string TPDiff)
{
local int i;
local string TName;
local int TScore;
local string TDiff;
if(TPlayerScore[9] < TPScore){
TPlayerName[9]=TPName;
TPlayerScore[9]=TPScore;
TPlayerDiff[9]=difficulties[TPDiff];
}
for (i=9; i>1; i--){
if(TPlayerScore[i] > TPlayerScore[i-1]){
TName=TPlayerName[i-1];
TScore=TPlayerScore[i-1];
TDiff=TPlayerDiff[i-1];
TPlayerName[i-1]=TPlayerName[i];
TPlayerScore[i-1]=TPlayerScore[i];
TPlayerDiff[i-1]=TPlayerDiff[i];
TPlayerName[i]=TName;
TPlayerScore[i]=TScore;
TPlayerDiff[i]=TDiff;
}
}
StaticSaveConfig();
}
defaultproperties
{
Difficulties(0)="Easy"
Difficulties(1)="Medium"
Difficulties(2)="Hard"
Difficulties(3)="Unreal"
}
Code:
class RabbitScoreKeeper expands TournamentPickup;
var travel int Score;
RabbitPlayer is just another UnrealPlayer class (new model).
When I try to compile this I have an error (RabbitEndGameTrigger):
Unrecognized member 'SaveScores' in class 'Class'
And I can't read value of Score in RabbitScoreKeeper (RabbitEndGameTrigger line TPScore=RabbitPlayer(Instigator).ScoreHolder.Score; ).
Anyone can help me?
Last edited: