Well, I stopped using Nexgen some time ago, but I decided to give it a try and bring it back to support my score recorder. It took me hours to code it, however the mutator doesn't seem to work fine all the time.
First of all, the moment it loads, my logs get spammed a little bit:
Code: Select all
Log: Spawning: Nexgen112.NexgenActor
Log: Spawning: ThHaxersScoreRecorderPlus.ThHaxersScoreRecorderPlus
Warning: ImportText: Illegal or missing key name
Warning: ImportText: Bad termination
Warning: ImportText: Illegal or missing key name
Warning: ImportText: Illegal or missing key name
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Illegal or missing key name
Warning: ImportText: Illegal or missing key name
Warning: ImportText: Illegal or missing key name
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Warning: ImportText: Bad termination
Log: Spawning: ServerAdds.ServerAdds
You can see that the moment my mutator loads, those errors turn up. I searched through the internet and found out it may have something to do with variables I load from ini files - this could be true because I store a lot of information in inis.
One of the ini files holds just config variables, etc - I dont think it is the one causing problems, however I store each players statistics(there is a lot of them) in a struct which looks like that:
Code: Select all
struct PlayerStats
{
//General Vars
var string ClientID;
var string PlayerName;
var int RoundsSpectated;
//var int RoundsPlayed;
//var int RoundsWon;
//var int RoundsLost;
//no longe needed
var float SpectatorTime;
//Thief Vars
var int ThiefScore;
var int ObjectivePoints;
var int Loot;
var float Stealth; // in fact it shows Light Rating
var int GuardKills;
var int GuardKOs;
var int ThiefNumberOfRangedShots;
var int ThiefNumberOfRangedShotsThatHit;
var int RoundsAsAThief;
var int TimesKilledByGuard;
var int RoundsWonAsAThief;
var int RoundsLostAsAThief;
var int TInvisPotsUsed;
var int TSpeedPotsUsed;
var int THealthPotsUsed;
var int TCatfallPotsUsed;
var int TFlashesUsed;
var float ThiefTime;
var float TTimeInvis;
var float TTimeSpeed;
var float TTimeCatfall;
var float TTimeCracked;
var float TTimeFlashed;
var float TTimeParalysed;
var float TTimeEmptyHanded;
var float TTimeBlackJack;
var float TTimeSword;
var float TTimeBow;
var int TFoodEaten;
//Guard Vars
var int GuardScore;
var int LootReturned;
var int GuardNumberOfRangedShots;
var int GuardNumberOfRangedShotsThatHit;
var int RoundsAsAGuard;
var int RoundsWonAsAGuard;
var int RoundsLostAsAGuard;
var int TorchesRelit;
var int ThiefKills;
var int DamageDealt;
var int TrapPoints;
var int GInvisPotsDestroyed;
var int GSpeedPotsUsed;
var int GHealthPotsUsed;
var int GCatfallPotsUsed;
var float GuardTime;
var float GTimeSpeed;
var float GTimeCatfall;
var float GTimeCracked;
var float GTimeFlashed;
var float GTimeParalysed;
var float GTimeEmptyHanded;
var float GTimeSword;
var float GTimeMace;
var float GTimeCrossbow;
var int GFoodEaten;
};
Perhaps this leads to some problems with loading and saving data from files - each Players Stats looks in ini file like this:
Code: Select all
Array[2]=(clientID="**********************************************",PlayerName="Haxer557^Tomcats^",RoundsSpectated=4,SpectatorTime=3552.845215,ThiefScore=819,ObjectivePoints=23,Loot=165,Stealth=158.265060,GuardKills=2,GuardKOs=0,ThiefNumberOfRangedShots=7,ThiefNumberOfRangedShotsThatHit=4,RoundsAsAThief=2,TimesKilledByGuard=0,RoundsWonAsAThief=2,RoundsLostAsAThief=0,TInvisPotsUsed=0,TSpeedPotsUsed=2,THealthPotsUsed=0,TCatfallPotsUsed=0,TFlashesUsed=0,ThiefTime=490.861084,TTimeInvis=20.156853,TTimeSpeed=11.318522,TTimeCatfall=0.000000,TTimeCracked=0.000000,TTimeFlashed=0.000000,TTimeParalysed=0.000000,TTimeEmptyHanded=464.282684,TTimeBlackJack=6.965969,TTimeSword=0.000000,TTimeBow=19.612556,TFoodEaten=0,GuardScore=1867,LootReturned=0,GuardNumberOfRangedShots=56,GuardNumberOfRangedShotsThatHit=19,RoundsAsAGuard=4,RoundsWonAsAGuard=3,RoundsLostAsAGuard=1,TorchesRelit=8,ThiefKills=4,DamageDealt=905,TrapPoints=72,GInvisPotsDestroyed=0,GSpeedPotsUsed=4,GHealthPotsUsed=0,GCatfallPotsUsed=0,GuardTime=1736.312988,GTimeSpeed=40.111130,GTimeCatfall=0.000000,GTimeCracked=0.000000,GTimeFlashed=0.000000,GTimeParalysed=0.000000,GTimeEmptyHanded=0.000000,GTimeSword=0.000000,GTimeMace=0.000000,GTimeCrossbow=0.000000,GFoodEaten=0)
These are my personal stats, I have played enough rounds to have all values greater than 0, whereas, a huge part of them is still 0. The problem is not with counting them during the game, because other player looged have some of those values greater than 0. The problem is that despite using SaveConfig(), not all values are saved. Is it connected with the amount of memory that struct holds? (it is ~252 bytes)
At the end of the round - the moment stats are read and updated into ini file, I got even more warnings.
Note: The variables stored mid-game are stored in variables that do not use any default values - this means that the first time PlayerStats are read is at the end of the round - therefore I have no idea why do those errors occur while loading mutator.
Perhaps the solution is just to split the PlayerStats struct into smaller structs?
Edit: Fixed! The solution was to split the struct PlayerStats - although it took me some time to rearrange the whole code, it payed off, as for now everything seems to work fine.