change log macro

This commit is contained in:
GenZmeY 2022-05-17 12:56:31 +03:00
parent e4fae31d43
commit e5e2b711f0
7 changed files with 82 additions and 82 deletions

View File

@ -35,37 +35,37 @@ public static function bool Load(E_LogLevel LogLevel)
if (default.ZedTotalMultiplier <= 0.f) if (default.ZedTotalMultiplier <= 0.f)
{ {
`ZS_Error("ZedTotalMultiplier" @ "(" $ default.ZedTotalMultiplier $ ")" @ "must be greater than 0.0", LogLevel); `ZS_Error("ZedTotalMultiplier" @ "(" $ default.ZedTotalMultiplier $ ")" @ "must be greater than 0.0");
Errors = true; Errors = true;
} }
if (default.SpawnTotalPlayerMultiplier < 0.f) if (default.SpawnTotalPlayerMultiplier < 0.f)
{ {
`ZS_Error("SpawnTotalPlayerMultiplier" @ "(" $ default.SpawnTotalPlayerMultiplier $ ")" @ "must be greater than or equal 0.0", LogLevel); `ZS_Error("SpawnTotalPlayerMultiplier" @ "(" $ default.SpawnTotalPlayerMultiplier $ ")" @ "must be greater than or equal 0.0");
Errors = true; Errors = true;
} }
if (default.SpawnTotalCycleMultiplier < 0.f) if (default.SpawnTotalCycleMultiplier < 0.f)
{ {
`ZS_Error("SpawnTotalCycleMultiplier" @ "(" $ default.SpawnTotalCycleMultiplier $ ")" @ "must be greater than or equal 0.0", LogLevel); `ZS_Error("SpawnTotalCycleMultiplier" @ "(" $ default.SpawnTotalCycleMultiplier $ ")" @ "must be greater than or equal 0.0");
Errors = true; Errors = true;
} }
if (default.SingleSpawnLimitPlayerMultiplier < 0.f) if (default.SingleSpawnLimitPlayerMultiplier < 0.f)
{ {
`ZS_Error("SingleSpawnLimitPlayerMultiplier" @ "(" $ default.SingleSpawnLimitPlayerMultiplier $ ")" @ "must be greater than or equal 0.0", LogLevel); `ZS_Error("SingleSpawnLimitPlayerMultiplier" @ "(" $ default.SingleSpawnLimitPlayerMultiplier $ ")" @ "must be greater than or equal 0.0");
Errors = true; Errors = true;
} }
if (default.SingleSpawnLimitCycleMultiplier < 0.f) if (default.SingleSpawnLimitCycleMultiplier < 0.f)
{ {
`ZS_Error("SingleSpawnLimitCycleMultiplier" @ "(" $ default.SingleSpawnLimitCycleMultiplier $ ")" @ "must be greater than or equal 0.0", LogLevel); `ZS_Error("SingleSpawnLimitCycleMultiplier" @ "(" $ default.SingleSpawnLimitCycleMultiplier $ ")" @ "must be greater than or equal 0.0");
Errors = true; Errors = true;
} }
if (default.AliveSpawnLimit < 0) if (default.AliveSpawnLimit < 0)
{ {
`ZS_Error("AliveSpawnLimit" @ "(" $ default.AliveSpawnLimit $ ")" @ "must be greater than or equal 0", LogLevel); `ZS_Error("AliveSpawnLimit" @ "(" $ default.AliveSpawnLimit $ ")" @ "must be greater than or equal 0");
Errors = true; Errors = true;
} }

View File

@ -44,7 +44,7 @@ public static function Array<S_SpawnEntry> Load(E_LogLevel LogLevel)
local int Line; local int Line;
local bool Errors; local bool Errors;
`ZS_Info("Load boss waves spawn list:", LogLevel); `ZS_Info("Load boss waves spawn list:");
foreach default.Spawn(SpawnEntryCfg, Line) foreach default.Spawn(SpawnEntryCfg, Line)
{ {
Errors = false; Errors = false;
@ -52,14 +52,14 @@ public static function Array<S_SpawnEntry> Load(E_LogLevel LogLevel)
SpawnEntry.BossClass = class<KFPawn_Monster>(DynamicLoadObject(SpawnEntryCfg.BossClass, class'Class')); SpawnEntry.BossClass = class<KFPawn_Monster>(DynamicLoadObject(SpawnEntryCfg.BossClass, class'Class'));
if (SpawnEntry.BossClass == None) if (SpawnEntry.BossClass == None)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Can't load boss class:" @ SpawnEntryCfg.BossClass, LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Can't load boss class:" @ SpawnEntryCfg.BossClass);
Errors = true; Errors = true;
} }
SpawnEntry.ZedClass = class<KFPawn_Monster>(DynamicLoadObject(SpawnEntryCfg.ZedClass, class'Class')); SpawnEntry.ZedClass = class<KFPawn_Monster>(DynamicLoadObject(SpawnEntryCfg.ZedClass, class'Class'));
if (SpawnEntry.ZedClass == None) if (SpawnEntry.ZedClass == None)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Can't load zed class:" @ SpawnEntryCfg.ZedClass, LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Can't load zed class:" @ SpawnEntryCfg.ZedClass);
Errors = true; Errors = true;
} }
@ -68,28 +68,28 @@ public static function Array<S_SpawnEntry> Load(E_LogLevel LogLevel)
SpawnEntry.DelayDefault = SpawnEntryCfg.Delay; SpawnEntry.DelayDefault = SpawnEntryCfg.Delay;
if (SpawnEntryCfg.Delay <= 0) if (SpawnEntryCfg.Delay <= 0)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Delay" @ "(" $ SpawnEntryCfg.Delay $ ")" @ "must be greater than 0", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Delay" @ "(" $ SpawnEntryCfg.Delay $ ")" @ "must be greater than 0");
Errors = true; Errors = true;
} }
SpawnEntry.Probability = SpawnEntryCfg.Probability / 100.f; SpawnEntry.Probability = SpawnEntryCfg.Probability / 100.f;
if (SpawnEntryCfg.Probability <= 0 || SpawnEntryCfg.Probability > 100) if (SpawnEntryCfg.Probability <= 0 || SpawnEntryCfg.Probability > 100)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Probability" @ "(" $ SpawnEntryCfg.Probability $ ")" @ "must be greater than 0 and less than or equal 100", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Probability" @ "(" $ SpawnEntryCfg.Probability $ ")" @ "must be greater than 0 and less than or equal 100");
Errors = true; Errors = true;
} }
SpawnEntry.SpawnCountBase = SpawnEntryCfg.SpawnCountBase; SpawnEntry.SpawnCountBase = SpawnEntryCfg.SpawnCountBase;
if (SpawnEntry.SpawnCountBase <= 0) if (SpawnEntry.SpawnCountBase <= 0)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "SpawnCountBase" @ "(" $ SpawnEntryCfg.SpawnCountBase $ ")" @ "must be greater than 0", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "SpawnCountBase" @ "(" $ SpawnEntryCfg.SpawnCountBase $ ")" @ "must be greater than 0");
Errors = true; Errors = true;
} }
SpawnEntry.SingleSpawnLimitDefault = SpawnEntryCfg.SingleSpawnLimit; SpawnEntry.SingleSpawnLimitDefault = SpawnEntryCfg.SingleSpawnLimit;
if (SpawnEntry.SingleSpawnLimit < 0) if (SpawnEntry.SingleSpawnLimit < 0)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "SingleSpawnLimit" @ "(" $ SpawnEntryCfg.SingleSpawnLimit $ ")" @ "must be equal or greater than 0", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "SingleSpawnLimit" @ "(" $ SpawnEntryCfg.SingleSpawnLimit $ ")" @ "must be equal or greater than 0");
Errors = true; Errors = true;
} }
@ -98,7 +98,7 @@ public static function Array<S_SpawnEntry> Load(E_LogLevel LogLevel)
if (!Errors) if (!Errors)
{ {
SpawnList.AddItem(SpawnEntry); SpawnList.AddItem(SpawnEntry);
`ZS_Info("[" $ Line + 1 $ "]" @ "Loaded successfully:" @ SpawnEntryCfg.BossClass @ SpawnEntryCfg.ZedClass, LogLevel); `ZS_Info("[" $ Line + 1 $ "]" @ "Loaded successfully:" @ SpawnEntryCfg.BossClass @ SpawnEntryCfg.ZedClass);
} }
} }

View File

@ -53,7 +53,7 @@ public static function Array<S_SpawnEntry> Load(E_LogLevel LogLevel)
local int Line; local int Line;
local bool Errors; local bool Errors;
`ZS_Info("Load spawn list:", LogLevel); `ZS_Info("Load spawn list:");
foreach default.Spawn(SpawnEntryCfg, Line) foreach default.Spawn(SpawnEntryCfg, Line)
{ {
Errors = false; Errors = false;
@ -61,49 +61,49 @@ public static function Array<S_SpawnEntry> Load(E_LogLevel LogLevel)
SpawnEntry.Wave = SpawnEntryCfg.Wave; SpawnEntry.Wave = SpawnEntryCfg.Wave;
if (SpawnEntryCfg.Wave <= 0 || SpawnEntryCfg.Wave > 255) if (SpawnEntryCfg.Wave <= 0 || SpawnEntryCfg.Wave > 255)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Wave" @ "(" $ SpawnEntryCfg.ZedClass $ ")" @ "must be greater than 0 and less than 256", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Wave" @ "(" $ SpawnEntryCfg.ZedClass $ ")" @ "must be greater than 0 and less than 256");
Errors = true; Errors = true;
} }
SpawnEntry.ZedClass = class<KFPawn_Monster>(DynamicLoadObject(SpawnEntryCfg.ZedClass, class'Class')); SpawnEntry.ZedClass = class<KFPawn_Monster>(DynamicLoadObject(SpawnEntryCfg.ZedClass, class'Class'));
if (SpawnEntry.ZedClass == None) if (SpawnEntry.ZedClass == None)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Can't load zed class:" @ SpawnEntryCfg.ZedClass, LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Can't load zed class:" @ SpawnEntryCfg.ZedClass);
Errors = true; Errors = true;
} }
SpawnEntry.RelativeStartDefault = SpawnEntryCfg.RelativeStart / 100.f; SpawnEntry.RelativeStartDefault = SpawnEntryCfg.RelativeStart / 100.f;
if (SpawnEntryCfg.RelativeStart < 0 || SpawnEntryCfg.RelativeStart > 100) if (SpawnEntryCfg.RelativeStart < 0 || SpawnEntryCfg.RelativeStart > 100)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "RelativeStart" @ "(" $ SpawnEntryCfg.RelativeStart $ ")" @ "must be greater than or equal 0 and less than or equal 100", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "RelativeStart" @ "(" $ SpawnEntryCfg.RelativeStart $ ")" @ "must be greater than or equal 0 and less than or equal 100");
Errors = true; Errors = true;
} }
SpawnEntry.DelayDefault = SpawnEntryCfg.Delay; SpawnEntry.DelayDefault = SpawnEntryCfg.Delay;
if (SpawnEntryCfg.Delay <= 0) if (SpawnEntryCfg.Delay <= 0)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Delay" @ "(" $ SpawnEntryCfg.Delay $ ")" @ "must be greater than 0", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Delay" @ "(" $ SpawnEntryCfg.Delay $ ")" @ "must be greater than 0");
Errors = true; Errors = true;
} }
SpawnEntry.Probability = SpawnEntryCfg.Probability / 100.f; SpawnEntry.Probability = SpawnEntryCfg.Probability / 100.f;
if (SpawnEntryCfg.Probability <= 0 || SpawnEntryCfg.Probability > 100) if (SpawnEntryCfg.Probability <= 0 || SpawnEntryCfg.Probability > 100)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Probability" @ "(" $ SpawnEntryCfg.Probability $ ")" @ "must be greater than 0 and less than or equal 100", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Probability" @ "(" $ SpawnEntryCfg.Probability $ ")" @ "must be greater than 0 and less than or equal 100");
Errors = true; Errors = true;
} }
SpawnEntry.SpawnCountBase = SpawnEntryCfg.SpawnCountBase; SpawnEntry.SpawnCountBase = SpawnEntryCfg.SpawnCountBase;
if (SpawnEntry.SpawnCountBase <= 0) if (SpawnEntry.SpawnCountBase <= 0)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "SpawnCountBase" @ "(" $ SpawnEntryCfg.SpawnCountBase $ ")" @ "must be greater than 0", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "SpawnCountBase" @ "(" $ SpawnEntryCfg.SpawnCountBase $ ")" @ "must be greater than 0");
Errors = true; Errors = true;
} }
SpawnEntry.SingleSpawnLimitDefault = SpawnEntryCfg.SingleSpawnLimit; SpawnEntry.SingleSpawnLimitDefault = SpawnEntryCfg.SingleSpawnLimit;
if (SpawnEntry.SingleSpawnLimit < 0) if (SpawnEntry.SingleSpawnLimit < 0)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "SingleSpawnLimit" @ "(" $ SpawnEntryCfg.SingleSpawnLimit $ ")" @ "must be equal or greater than 0", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "SingleSpawnLimit" @ "(" $ SpawnEntryCfg.SingleSpawnLimit $ ")" @ "must be equal or greater than 0");
Errors = true; Errors = true;
} }
@ -112,7 +112,7 @@ public static function Array<S_SpawnEntry> Load(E_LogLevel LogLevel)
if (!Errors) if (!Errors)
{ {
SpawnList.AddItem(SpawnEntry); SpawnList.AddItem(SpawnEntry);
`ZS_Info("[" $ Line + 1 $ "]" @ "Loaded successfully:" @ SpawnEntryCfg.Wave @ SpawnEntryCfg.ZedClass, LogLevel); `ZS_Info("[" $ Line + 1 $ "]" @ "Loaded successfully:" @ SpawnEntryCfg.Wave @ SpawnEntryCfg.ZedClass);
} }
} }

View File

@ -26,7 +26,7 @@ public static function InitConfig()
default.Spawn.Length = 0; default.Spawn.Length = 0;
SpawnEntry.Wave = AT_Husk; SpawnEntry.Wave = AT_Husk;
SpawnEntry.ZedClass = "SomePackage.SomeHuskClass"; SpawnEntry.ZedClass = "SomePackage.SomeClass";
SpawnEntry.SpawnCountBase = 2; SpawnEntry.SpawnCountBase = 2;
SpawnEntry.SingleSpawnLimit = 1; SpawnEntry.SingleSpawnLimit = 1;
SpawnEntry.RelativeStart = 0; SpawnEntry.RelativeStart = 0;
@ -48,11 +48,11 @@ public static function Array<S_SpawnEntry> Load(KFGameInfo_Endless KFGIE, E_LogL
if (KFGIE == None) if (KFGIE == None)
{ {
`ZS_Info("Not Endless mode, skip loading special waves", LogLevel); `ZS_Info("Not Endless mode, skip loading special waves");
return SpawnList; return SpawnList;
} }
`ZS_Info("Load special waves spawn list:", LogLevel); `ZS_Info("Load special waves spawn list:");
foreach default.Spawn(SpawnEntryCfg, Line) foreach default.Spawn(SpawnEntryCfg, Line)
{ {
Errors = false; Errors = false;
@ -60,49 +60,49 @@ public static function Array<S_SpawnEntry> Load(KFGameInfo_Endless KFGIE, E_LogL
SpawnEntry.Wave = SpawnEntryCfg.Wave; SpawnEntry.Wave = SpawnEntryCfg.Wave;
if (KFGIE.SpecialWaveTypes.Find(EAIType(SpawnEntryCfg.Wave)) == INDEX_NONE) if (KFGIE.SpecialWaveTypes.Find(EAIType(SpawnEntryCfg.Wave)) == INDEX_NONE)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Unknown special wave:" @ SpawnEntryCfg.Wave, LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Unknown special wave:" @ SpawnEntryCfg.Wave);
Errors = true; Errors = true;
} }
SpawnEntry.ZedClass = class<KFPawn_Monster>(DynamicLoadObject(SpawnEntryCfg.ZedClass, class'Class')); SpawnEntry.ZedClass = class<KFPawn_Monster>(DynamicLoadObject(SpawnEntryCfg.ZedClass, class'Class'));
if (SpawnEntry.ZedClass == None) if (SpawnEntry.ZedClass == None)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Can't load zed class:" @ SpawnEntryCfg.ZedClass, LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Can't load zed class:" @ SpawnEntryCfg.ZedClass);
Errors = true; Errors = true;
} }
SpawnEntry.RelativeStartDefault = SpawnEntryCfg.RelativeStart / 100.f; SpawnEntry.RelativeStartDefault = SpawnEntryCfg.RelativeStart / 100.f;
if (SpawnEntryCfg.RelativeStart < 0 || SpawnEntryCfg.RelativeStart > 100) if (SpawnEntryCfg.RelativeStart < 0 || SpawnEntryCfg.RelativeStart > 100)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "RelativeStart" @ "(" $ SpawnEntryCfg.RelativeStart $ ")" @ "must be greater than or equal 0 and less than or equal 100", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "RelativeStart" @ "(" $ SpawnEntryCfg.RelativeStart $ ")" @ "must be greater than or equal 0 and less than or equal 100");
Errors = true; Errors = true;
} }
SpawnEntry.DelayDefault = SpawnEntryCfg.Delay; SpawnEntry.DelayDefault = SpawnEntryCfg.Delay;
if (SpawnEntryCfg.Delay <= 0) if (SpawnEntryCfg.Delay <= 0)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Delay" @ "(" $ SpawnEntryCfg.Delay $ ")" @ "must be greater than 0", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Delay" @ "(" $ SpawnEntryCfg.Delay $ ")" @ "must be greater than 0");
Errors = true; Errors = true;
} }
SpawnEntry.Probability = SpawnEntryCfg.Probability / 100.f; SpawnEntry.Probability = SpawnEntryCfg.Probability / 100.f;
if (SpawnEntryCfg.Probability <= 0 || SpawnEntryCfg.Probability > 100) if (SpawnEntryCfg.Probability <= 0 || SpawnEntryCfg.Probability > 100)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "Probability" @ "(" $ SpawnEntryCfg.Probability $ ")" @ "must be greater than 0 and less than or equal 100", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "Probability" @ "(" $ SpawnEntryCfg.Probability $ ")" @ "must be greater than 0 and less than or equal 100");
Errors = true; Errors = true;
} }
SpawnEntry.SpawnCountBase = SpawnEntryCfg.SpawnCountBase; SpawnEntry.SpawnCountBase = SpawnEntryCfg.SpawnCountBase;
if (SpawnEntry.SpawnCountBase <= 0) if (SpawnEntry.SpawnCountBase <= 0)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "SpawnCountBase" @ "(" $ SpawnEntryCfg.SpawnCountBase $ ")" @ "must be greater than 0", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "SpawnCountBase" @ "(" $ SpawnEntryCfg.SpawnCountBase $ ")" @ "must be greater than 0");
Errors = true; Errors = true;
} }
SpawnEntry.SingleSpawnLimitDefault = SpawnEntryCfg.SingleSpawnLimit; SpawnEntry.SingleSpawnLimitDefault = SpawnEntryCfg.SingleSpawnLimit;
if (SpawnEntry.SingleSpawnLimit < 0) if (SpawnEntry.SingleSpawnLimit < 0)
{ {
`ZS_Warn("[" $ Line + 1 $ "]" @ "SingleSpawnLimit" @ "(" $ SpawnEntryCfg.SingleSpawnLimit $ ")" @ "must be equal or greater than 0", LogLevel); `ZS_Warn("[" $ Line + 1 $ "]" @ "SingleSpawnLimit" @ "(" $ SpawnEntryCfg.SingleSpawnLimit $ ")" @ "must be equal or greater than 0");
Errors = true; Errors = true;
} }
@ -111,7 +111,7 @@ public static function Array<S_SpawnEntry> Load(KFGameInfo_Endless KFGIE, E_LogL
if (!Errors) if (!Errors)
{ {
SpawnList.AddItem(SpawnEntry); SpawnList.AddItem(SpawnEntry);
`ZS_Info("[" $ Line + 1 $ "]" @ "Loaded successfully:" @ SpawnEntryCfg.Wave @ SpawnEntryCfg.ZedClass, LogLevel); `ZS_Info("[" $ Line + 1 $ "]" @ "Loaded successfully:" @ SpawnEntryCfg.Wave @ SpawnEntryCfg.ZedClass);
} }
} }

View File

@ -68,7 +68,7 @@ delegate bool WaveCondition(S_SpawnEntry SE);
public function bool WaveConditionRegular(S_SpawnEntry SE) public function bool WaveConditionRegular(S_SpawnEntry SE)
{ {
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
return (SE.Wave == KFGIS.WaveNum - CycleWaveSize * (CurrentCycle - 1)); return (SE.Wave == KFGIS.WaveNum - CycleWaveSize * (CurrentCycle - 1));
} }
@ -78,7 +78,7 @@ public function bool WaveConditionBoss(S_SpawnEntry SE)
local KFPawn_Monster KFPM; local KFPawn_Monster KFPM;
local int Index; local int Index;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
if (CurrentBossClass == None) if (CurrentBossClass == None)
{ {
@ -103,14 +103,14 @@ public function bool WaveConditionBoss(S_SpawnEntry SE)
public function bool WaveConditionSpecial(S_SpawnEntry SE) public function bool WaveConditionSpecial(S_SpawnEntry SE)
{ {
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
return (SE.Wave == SpecialWave); return (SE.Wave == SpecialWave);
} }
event PostBeginPlay() event PostBeginPlay()
{ {
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
Super.PostBeginPlay(); Super.PostBeginPlay();
@ -127,7 +127,7 @@ private function Init()
{ {
local S_SpawnEntry SE; local S_SpawnEntry SE;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
if (!bConfigInitialized) if (!bConfigInitialized)
{ {
@ -138,13 +138,13 @@ private function Init()
CfgSpawnListR.static.InitConfig(); CfgSpawnListR.static.InitConfig();
CfgSpawnListBW.static.InitConfig(); CfgSpawnListBW.static.InitConfig();
CfgSpawnListSW.static.InitConfig(); CfgSpawnListSW.static.InitConfig();
`ZS_Info("Config initialized.", LogLevel); `ZS_Info("Config initialized.");
} }
if (LogLevel == LL_WrongLevel) if (LogLevel == LL_WrongLevel)
{ {
LogLevel = LL_Info; LogLevel = LL_Info;
`ZS_Warn("Wrong 'LogLevel', return to default value", LogLevel); `ZS_Warn("Wrong 'LogLevel', return to default value");
SaveConfig(); SaveConfig();
} }
@ -152,7 +152,7 @@ private function Init()
if (!CfgSpawn.static.Load(LogLevel)) if (!CfgSpawn.static.Load(LogLevel))
{ {
`ZS_Fatal("Wrong settings, Destroy...", LogLevel); `ZS_Fatal("Wrong settings, Destroy...");
Destroy(); Destroy();
return; return;
} }
@ -161,7 +161,7 @@ private function Init()
KFGIS = KFGameInfo_Survival(WorldInfo.Game); KFGIS = KFGameInfo_Survival(WorldInfo.Game);
if (KFGIS == None) if (KFGIS == None)
{ {
`ZS_Fatal("Incompatible gamemode:" @ WorldInfo.Game $ ". Destroy...", LogLevel); `ZS_Fatal("Incompatible gamemode:" @ WorldInfo.Game $ ". Destroy...");
Destroy(); Destroy();
return; return;
} }
@ -183,7 +183,7 @@ private function Init()
if (CustomZeds.Find(SE.ZedClass) == INDEX_NONE if (CustomZeds.Find(SE.ZedClass) == INDEX_NONE
&& KFGIA.IsCustomZed(SE.ZedClass)) && KFGIA.IsCustomZed(SE.ZedClass))
{ {
`ZS_Debug("Add custom zed:" @ SE.ZedClass, LogLevel); `ZS_Debug("Add custom zed:" @ SE.ZedClass);
CustomZeds.AddItem(SE.ZedClass); CustomZeds.AddItem(SE.ZedClass);
SE.ZedClass.static.PreloadContent(); SE.ZedClass.static.PreloadContent();
} }
@ -198,7 +198,7 @@ private function Init()
if (CustomZeds.Find(SE.ZedClass) == INDEX_NONE if (CustomZeds.Find(SE.ZedClass) == INDEX_NONE
&& KFGIA.IsCustomZed(SE.ZedClass)) && KFGIA.IsCustomZed(SE.ZedClass))
{ {
`ZS_Debug("Add custom zed:" @ SE.ZedClass, LogLevel); `ZS_Debug("Add custom zed:" @ SE.ZedClass);
CustomZeds.AddItem(SE.ZedClass); CustomZeds.AddItem(SE.ZedClass);
SE.ZedClass.static.PreloadContent(); SE.ZedClass.static.PreloadContent();
} }
@ -212,7 +212,7 @@ private function Init()
if (CustomZeds.Find(SE.ZedClass) == INDEX_NONE if (CustomZeds.Find(SE.ZedClass) == INDEX_NONE
&& KFGIA.IsCustomZed(SE.ZedClass)) && KFGIA.IsCustomZed(SE.ZedClass))
{ {
`ZS_Debug("Add custom zed:" @ SE.ZedClass, LogLevel); `ZS_Debug("Add custom zed:" @ SE.ZedClass);
CustomZeds.AddItem(SE.ZedClass); CustomZeds.AddItem(SE.ZedClass);
SE.ZedClass.static.PreloadContent(); SE.ZedClass.static.PreloadContent();
} }
@ -223,7 +223,7 @@ private function Init()
private function SpawnTimer() private function SpawnTimer()
{ {
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
if (KFGIS.WaveNum != 0 && CurrentWave < KFGIS.WaveNum) if (KFGIS.WaveNum != 0 && CurrentWave < KFGIS.WaveNum)
{ {
@ -272,7 +272,7 @@ private function SetupWave()
{ {
local int WaveTotalAIDef; local int WaveTotalAIDef;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
CurrentWave = KFGIS.WaveNum; CurrentWave = KFGIS.WaveNum;
@ -286,14 +286,14 @@ private function SetupWave()
if (WaveTotalAIDef != KFGIS.SpawnManager.WaveTotalAI) if (WaveTotalAIDef != KFGIS.SpawnManager.WaveTotalAI)
{ {
`ZS_Info("increase WaveTotalAI from" @ WaveTotalAIDef @ "to" @ WaveTotalAI @ "due to ZedTotalMultiplier" @ "(" $ CfgSpawn.default.ZedTotalMultiplier $ ")", LogLevel); `ZS_Info("increase WaveTotalAI from" @ WaveTotalAIDef @ "to" @ WaveTotalAI @ "due to ZedTotalMultiplier" @ "(" $ CfgSpawn.default.ZedTotalMultiplier $ ")");
} }
} }
if (CfgSpawn.default.bCyclicalSpawn && KFGIS.WaveNum > 1 && KFGIS.WaveNum == CycleWaveShift + CycleWaveSize * CurrentCycle) if (CfgSpawn.default.bCyclicalSpawn && KFGIS.WaveNum > 1 && KFGIS.WaveNum == CycleWaveShift + CycleWaveSize * CurrentCycle)
{ {
CurrentCycle++; CurrentCycle++;
`ZS_Info("Next spawn cycle started:" @ CurrentCycle, LogLevel); `ZS_Info("Next spawn cycle started:" @ CurrentCycle);
} }
ResetSpawnList(SpawnListR); ResetSpawnList(SpawnListR);
@ -316,7 +316,7 @@ private function ResetSpawnList(out Array<S_SpawnEntry> List)
local float MSB, MSC, MSP; local float MSB, MSC, MSP;
local float MLB, MLC, MLP; local float MLB, MLC, MLP;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
Cycle = float(CurrentCycle); Cycle = float(CurrentCycle);
Players = float(PlayerCount()); Players = float(PlayerCount());
@ -350,7 +350,7 @@ private function ResetSpawnList(out Array<S_SpawnEntry> List)
List[Index].SingleSpawnLimit = Round(SE.SingleSpawnLimitDefault * (MLB + MLC * (Cycle - 1.0f) + MLP * (Players - 1.0f))); List[Index].SingleSpawnLimit = Round(SE.SingleSpawnLimitDefault * (MLB + MLC * (Cycle - 1.0f) + MLP * (Players - 1.0f)));
`ZS_Debug(SE.ZedClass @ "SpawnsTotal:" @ List[Index].SpawnsTotal @ "SingleSpawnLimit:" @ List[Index].SingleSpawnLimit, LogLevel); `ZS_Debug(SE.ZedClass @ "SpawnsTotal:" @ List[Index].SpawnsTotal @ "SingleSpawnLimit:" @ List[Index].SingleSpawnLimit);
} }
} }
@ -358,7 +358,7 @@ private function SpawnTimerLogger(bool Stop, optional String Reason)
{ {
local String Message; local String Message;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
if (Stop) if (Stop)
Message = "Stop spawn"; Message = "Stop spawn";
@ -370,7 +370,7 @@ private function SpawnTimerLogger(bool Stop, optional String Reason)
if (Message != SpawnTimerLastMessage) if (Message != SpawnTimerLastMessage)
{ {
`ZS_Info(Message, LogLevel); `ZS_Info(Message);
SpawnTimerLastMessage = Message; SpawnTimerLastMessage = Message;
} }
} }
@ -380,7 +380,7 @@ private function SpawnZeds(out Array<S_SpawnEntry> SpawnList, delegate<WaveCondi
local S_SpawnEntry SE; local S_SpawnEntry SE;
local int Index; local int Index;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
foreach SpawnList(SE, Index) foreach SpawnList(SE, Index)
{ {
@ -398,7 +398,7 @@ private function SpawnZeds(out Array<S_SpawnEntry> SpawnList, delegate<WaveCondi
private function bool ReadyToStart(S_SpawnEntry SE) private function bool ReadyToStart(S_SpawnEntry SE)
{ {
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
if (SE.RelativeStart == 0.f) if (SE.RelativeStart == 0.f)
{ {
@ -412,7 +412,7 @@ private function bool ReadyToStart(S_SpawnEntry SE)
private function bool ReadyToSpawn(S_SpawnEntry SE) private function bool ReadyToSpawn(S_SpawnEntry SE)
{ {
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
return SE.Delay <= 0 && SE.SpawnsLeft > 0; return SE.Delay <= 0 && SE.SpawnsLeft > 0;
} }
@ -423,7 +423,7 @@ private function SpawnEntry(out Array<S_SpawnEntry> SpawnList, int Index)
local int FreeSpawnSlots, SpawnCount, Spawned; local int FreeSpawnSlots, SpawnCount, Spawned;
local String Message; local String Message;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
SE = SpawnList[Index]; SE = SpawnList[Index];
@ -440,7 +440,7 @@ private function SpawnEntry(out Array<S_SpawnEntry> SpawnList, int Index)
FreeSpawnSlots = KFGIS.MyKFGRI.AIRemaining - KFGIS.AIAliveCount; FreeSpawnSlots = KFGIS.MyKFGRI.AIRemaining - KFGIS.AIAliveCount;
if (SpawnCount > FreeSpawnSlots) if (SpawnCount > FreeSpawnSlots)
{ {
`ZS_Info("Not enough free slots to spawn, will spawn" @ FreeSpawnSlots @ "instead of" @ SpawnCount, LogLevel); `ZS_Info("Not enough free slots to spawn, will spawn" @ FreeSpawnSlots @ "instead of" @ SpawnCount);
SpawnCount = FreeSpawnSlots; SpawnCount = FreeSpawnSlots;
} }
} }
@ -459,7 +459,7 @@ private function SpawnEntry(out Array<S_SpawnEntry> SpawnList, int Index)
{ {
Message @= "(Next spawn after" @ SE.DelayDefault $ "sec," @ "spawns left:" @ SpawnList[Index].SpawnsLeft $ ")"; Message @= "(Next spawn after" @ SE.DelayDefault $ "sec," @ "spawns left:" @ SpawnList[Index].SpawnsLeft $ ")";
} }
`ZS_Info(Message, LogLevel); `ZS_Info(Message);
} }
private function int PlayerCount() private function int PlayerCount()
@ -468,7 +468,7 @@ private function int PlayerCount()
local int HumanPlayers; local int HumanPlayers;
local KFOnlineGameSettings KFGameSettings; local KFOnlineGameSettings KFGameSettings;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
if (KFGIS.PlayfabInter != None && KFGIS.PlayfabInter.GetGameSettings() != None) if (KFGIS.PlayfabInter != None && KFGIS.PlayfabInter.GetGameSettings() != None)
{ {
@ -493,7 +493,7 @@ private function Vector PlayerStartLocation()
{ {
local PlayerController PC; local PlayerController PC;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
foreach WorldInfo.AllControllers(class'PlayerController', PC) foreach WorldInfo.AllControllers(class'PlayerController', PC)
return KFGIS.FindPlayerStart(PC, 0).Location; return KFGIS.FindPlayerStart(PC, 0).Location;
@ -510,7 +510,7 @@ private function int SpawnZed(class<KFPawn_Monster> ZedClass, int SpawnCount, bo
local int SpawnFailed; local int SpawnFailed;
local int Index; local int Index;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
for (Index = 0; Index < SpawnCount; Index++) for (Index = 0; Index < SpawnCount; Index++)
CustomSquad.AddItem(ZedClass); CustomSquad.AddItem(ZedClass);
@ -533,7 +533,7 @@ private function int SpawnZed(class<KFPawn_Monster> ZedClass, int SpawnCount, bo
KFPM = Spawn(ZedClass,,, SpawnLocation, rot(0,0,1),, true); KFPM = Spawn(ZedClass,,, SpawnLocation, rot(0,0,1),, true);
if (KFPM == None) if (KFPM == None)
{ {
`ZS_Error("Can't spawn" @ ZedClass, LogLevel); `ZS_Error("Can't spawn" @ ZedClass);
SpawnFailed++; SpawnFailed++;
continue; continue;
} }
@ -541,7 +541,7 @@ private function int SpawnZed(class<KFPawn_Monster> ZedClass, int SpawnCount, bo
C = KFPM.Spawn(KFPM.ControllerClass); C = KFPM.Spawn(KFPM.ControllerClass);
if (C == None) if (C == None)
{ {
`ZS_Error("Can't spawn controller for" @ ZedClass $ ". Destroy this KFPawn...", LogLevel); `ZS_Error("Can't spawn controller for" @ ZedClass $ ". Destroy this KFPawn...");
KFPM.Destroy(); KFPM.Destroy();
SpawnFailed++; SpawnFailed++;
continue; continue;
@ -563,7 +563,7 @@ public function NotifyLogin(Controller C)
{ {
local ZedSpawnerRepLink RepLink; local ZedSpawnerRepLink RepLink;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
RepLink = Spawn(class'ZedSpawnerRepLink', C); RepLink = Spawn(class'ZedSpawnerRepLink', C);
RepLink.LogLevel = LogLevel; RepLink.LogLevel = LogLevel;
@ -573,7 +573,7 @@ public function NotifyLogin(Controller C)
public function NotifyLogout(Controller C) public function NotifyLogout(Controller C)
{ {
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
return; return;
} }

View File

@ -12,9 +12,9 @@ replication
public reliable client function ClientSync(class<KFPawn_Monster> CustomZed) public reliable client function ClientSync(class<KFPawn_Monster> CustomZed)
{ {
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
`ZS_Debug("Received:" @ CustomZed, LogLevel); `ZS_Debug("Received:" @ CustomZed);
CustomZeds.AddItem(CustomZed); CustomZeds.AddItem(CustomZed);
ServerSync(); ServerSync();
} }
@ -23,11 +23,11 @@ public reliable client function SyncFinished()
{ {
local class<KFPawn_Monster> CustomZed; local class<KFPawn_Monster> CustomZed;
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
foreach CustomZeds(CustomZed) foreach CustomZeds(CustomZed)
{ {
`ZS_Debug("Preload Content for" @ CustomZed, LogLevel); `ZS_Debug("Preload Content for" @ CustomZed);
CustomZed.static.PreloadContent(); CustomZed.static.PreloadContent();
} }
@ -36,17 +36,17 @@ public reliable client function SyncFinished()
public reliable server function ServerSync() public reliable server function ServerSync()
{ {
`ZS_Trace(`Location, LogLevel); `ZS_Trace(`Location);
if (CustomZeds.Length == Recieved) if (CustomZeds.Length == Recieved)
{ {
`ZS_Debug("Sync finished", LogLevel); `ZS_Debug("Sync finished");
SyncFinished(); SyncFinished();
Destroy(); Destroy();
} }
else else
{ {
`ZS_Debug("Sync:" @ CustomZeds[Recieved], LogLevel); `ZS_Debug("Sync:" @ CustomZeds[Recieved]);
ClientSync(CustomZeds[Recieved++]); ClientSync(CustomZeds[Recieved++]);
} }
} }

View File

@ -1,10 +1,10 @@
`define ZS_Tag 'ZedSpawner' `define ZS_Tag 'ZedSpawner'
`define ZS_Log(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `ZS_Tag) `define ZS_Log(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `ZS_Tag)
`define ZS_Fatal(msg, level) `log("FATAL:" @ `msg, (`level >= LL_Fatal), `ZS_Tag) `define ZS_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `ZS_Tag)
`define ZS_Error(msg, level) `log("ERROR:" @ `msg, (`level >= LL_Error), `ZS_Tag) `define ZS_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `ZS_Tag)
`define ZS_Warn(msg, level) `log("WARN:" @ `msg, (`level >= LL_Warning), `ZS_Tag) `define ZS_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `ZS_Tag)
`define ZS_Info(msg, level) `log("INFO:" @ `msg, (`level >= LL_Info), `ZS_Tag) `define ZS_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `ZS_Tag)
`define ZS_Debug(msg, level) `log("DEBUG:" @ `msg, (`level >= LL_Debug), `ZS_Tag) `define ZS_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `ZS_Tag)
`define ZS_Trace(msg, level) `log("TRACE:" @ `msg, (`level >= LL_Trace), `ZS_Tag) `define ZS_Trace(msg) `log("TRACE:" @ `msg, (LogLevel >= LL_Trace), `ZS_Tag)