Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
88e78d678d | |||
efd5c3d49f | |||
f335c3932d | |||
fc87924a4d | |||
bf06206445 | |||
9cbe05edfe | |||
eda17af2bb | |||
47e03c9218 | |||
b38412819e | |||
de44bfe00f | |||
a390cffbb8 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.psd
|
||||
/ignore
|
@ -1,4 +1,4 @@
|
||||
[img]https://img.shields.io/static/v1?logo=GitHub&labelColor=gray&color=blue&logoColor=white&label=&message=Open Source[/img] [img]https://img.shields.io/github/license/GenZmeY/KF2-ZedSpawner[/img] [img]https://img.shields.io/steam/subscriptions/2811290931[/img] [img]https://img.shields.io/steam/favorites/2811290931[/img] [img]https://img.shields.io/steam/update-date/2811290931[/img] [url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2811290931][img]https://img.shields.io/github/v/tag/GenZmeY/KF2-ZedSpawner[/img][/url]
|
||||
[img]https://img.shields.io/static/v1?logo=GitHub&labelColor=gray&color=blue&logoColor=white&label=&message=Open Source[/img] [img]https://img.shields.io/github/license/GenZmeY/KF2-ZedSpawner[/img] [img]https://img.shields.io/steam/favorites/2811290931[/img] [img]https://img.shields.io/steam/update-date/2811290931[/img] [url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2811290931][img]https://img.shields.io/github/v/tag/GenZmeY/KF2-ZedSpawner[/img][/url]
|
||||
|
||||
[h1]Description[/h1]
|
||||
Spawner for zeds. Started as a modification of [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2488241348]this version[/url], but now there is almost nothing left of the previous mutator, lol xD
|
||||
@ -37,7 +37,7 @@ No. This mod is not whitelisted and will de-rank your server. Any XP gained will
|
||||
[/olist]
|
||||
|
||||
[h1]Setup[/h1]
|
||||
At the first start, the [b]KFZedSpawner.ini[/b] config will be created. There are already default settings and spawn lists, but you still need to change them because this is just an example.
|
||||
At the first start, the [b]KFZedSpawner.ini[/b] config will be created(*). There are already default settings and spawn lists, but you still need to change them because this is just an example.
|
||||
|
||||
[b]Cyclic spawn[/b]
|
||||
If you don't want to write an endless spawn list for the endless mode (lol) use a cyclic spawn. Set parameter [b]bCyclicalSpawn=True[/b]
|
||||
@ -48,6 +48,9 @@ Using the [b]SpawnTotalCycleMultiplier[/b] and [b]SingleSpawnLimitCycleMultiplie
|
||||
With [b]bShadowSpawn=True[/b], the zeds from the list will replace the original zeds that haven't spawned yet, so the counter of the remaining zeds won't grow. Spawning will stop when there are no unspawned zeds left.
|
||||
With [b]bShadowSpawn=False[/b] zeds from the spawn list will not replace the original ones. The counter of remaining zeds will increase when spawning. Spawn will continue until the end of the wave.
|
||||
|
||||
[b]Smooth spawn[/b]
|
||||
With [b]bSmoothSpawn=True[/b] a group of zeds will spawn gradually (1 zed per second);
|
||||
|
||||
[b]AliveSpawnLimit[/b]
|
||||
If you have a server crash with a large number of zeds, set [b]AliveSpawnLimit[/b]. If the number of live zeds reaches the specified limit, spawning will be stopped until there are fewer zeds. At zero there is no limit.
|
||||
|
||||
@ -72,5 +75,19 @@ I really tried to describe in text how it works, but every time I got some kind
|
||||
[url=https://redirect.genzmey.su/kf2-zedspawner-calc][img]https://img.shields.io/static/v1?message=Spawn%20Calculator&logo=Google%20Sheets&labelColor=34A853&color=gray&logoColor=white&label=Google%20Sheets%20[/img][/url]
|
||||
[i]Just please try not to interfere with each other if you see that someone is already using a calculator.[/i]
|
||||
|
||||
[h1]Notes[/h1]
|
||||
📌 Mutator does not contain custom zeds. You must have the required zeds in your subscriptions to be able to spawn them.
|
||||
📌 If you are using this mutator to add zeds, you should [b]not[/b] use mutators from zed packs (just having them in subscriptions is enough).
|
||||
|
||||
[h1]Troubleshooting[/h1]
|
||||
📌 [b](*)[/b] If your config is not created for some reason, create it manually with the following content:
|
||||
[b][ZedSpawner.ZedSpawner]
|
||||
Version=0
|
||||
[/b]
|
||||
|
||||
Then start the server and check the file again - config content should be generated.
|
||||
|
||||
📌 If the spawner's behavior differs from what you expect, check the server logs first. ZedSpawner writes in the logs everything it does (and describes why), most likely you will find an explanation of what is happening there. If not, feel free to report bugs :)
|
||||
|
||||
[h1]Sources[/h1]
|
||||
[url=https://github.com/GenZmeY/KF2-ZedSpawner]https://github.com/GenZmeY/KF2-ZedSpawner[/url] (GNU GPLv3)
|
||||
[url=https://github.com/GenZmeY/KF2-ZedSpawner]https://github.com/GenZmeY/KF2-ZedSpawner[/url] (GNU GPLv3)
|
||||
|
@ -1 +1 @@
|
||||
ZedSpawner
|
||||
Zed Spawner
|
||||
|
@ -1,7 +1,6 @@
|
||||
# ZedSpawner
|
||||
|
||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931)
|
||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931)
|
||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931)
|
||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931)
|
||||
[](https://github.com/GenZmeY/KF2-ZedSpawner/tags)
|
||||
|
@ -1,40 +1,46 @@
|
||||
class KFGI_Access extends Object
|
||||
within KFGameInfo;
|
||||
|
||||
public function Array<class<KFPawn_Monster> > GetAIClassList()
|
||||
public function Array<class<KFPawn_Monster> > GetAIClassList(E_LogLevel LogLevel)
|
||||
{
|
||||
local Array<class<KFPawn_Monster> > RV;
|
||||
local class<KFPawn_Monster> KFPMC;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
foreach AIClassList(KFPMC)
|
||||
RV.AddItem(KFPMC);
|
||||
|
||||
return RV;
|
||||
}
|
||||
|
||||
public function Array<class<KFPawn_Monster> > GetNonSpawnAIClassList()
|
||||
public function Array<class<KFPawn_Monster> > GetNonSpawnAIClassList(E_LogLevel LogLevel)
|
||||
{
|
||||
local Array<class<KFPawn_Monster> > RV;
|
||||
local class<KFPawn_Monster> KFPMC;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
foreach NonSpawnAIClassList(KFPMC)
|
||||
RV.AddItem(KFPMC);
|
||||
|
||||
return RV;
|
||||
}
|
||||
|
||||
public function Array<class<KFPawn_Monster> > GetAIBossClassList()
|
||||
public function Array<class<KFPawn_Monster> > GetAIBossClassList(E_LogLevel LogLevel)
|
||||
{
|
||||
local Array<class<KFPawn_Monster> > RV;
|
||||
local class<KFPawn_Monster> KFPMC;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
foreach AIBossClassList(KFPMC)
|
||||
RV.AddItem(KFPMC);
|
||||
|
||||
return RV;
|
||||
}
|
||||
|
||||
public function bool IsCustomZed(class<KFPawn_Monster> KFPM)
|
||||
public function bool IsCustomZed(class<KFPawn_Monster> KFPM, E_LogLevel LogLevel)
|
||||
{
|
||||
if (AIClassList.Find(KFPM) != INDEX_NONE) return false;
|
||||
if (NonSpawnAIClassList.Find(KFPM) != INDEX_NONE) return false;
|
||||
@ -42,10 +48,12 @@ public function bool IsCustomZed(class<KFPawn_Monster> KFPM)
|
||||
return true;
|
||||
}
|
||||
|
||||
public function bool IsOriginalAI(class<KFPawn_Monster> KFPM, optional out EAIType AIType)
|
||||
public function bool IsOriginalAI(class<KFPawn_Monster> KFPM, optional out EAIType AIType, optional E_LogLevel LogLevel = LL_None)
|
||||
{
|
||||
local int Type;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
Type = AIClassList.Find(KFPM);
|
||||
if (Type != INDEX_NONE)
|
||||
{
|
||||
@ -56,10 +64,12 @@ public function bool IsOriginalAI(class<KFPawn_Monster> KFPM, optional out EAITy
|
||||
return false;
|
||||
}
|
||||
|
||||
public function bool IsOriginalAIBoss(class<KFPawn_Monster> KFPM, optional out EBossAIType AIType)
|
||||
public function bool IsOriginalAIBoss(class<KFPawn_Monster> KFPM, optional out EBossAIType AIType, optional E_LogLevel LogLevel = LL_None)
|
||||
{
|
||||
local int Type;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
Type = AIBossClassList.Find(KFPM);
|
||||
if (Type != INDEX_NONE)
|
||||
{
|
||||
@ -70,16 +80,20 @@ public function bool IsOriginalAIBoss(class<KFPawn_Monster> KFPM, optional out E
|
||||
return false;
|
||||
}
|
||||
|
||||
public function class<KFPawn_Monster> AITypePawn(EAIType AIType)
|
||||
public function class<KFPawn_Monster> AITypePawn(EAIType AIType, E_LogLevel LogLevel)
|
||||
{
|
||||
`Log_Trace();
|
||||
|
||||
if (AIType < AIClassList.Length)
|
||||
return AIClassList[AIType];
|
||||
else
|
||||
return None;
|
||||
}
|
||||
|
||||
public function class<KFPawn_Monster> BossAITypePawn(EBossAIType AIType)
|
||||
public function class<KFPawn_Monster> BossAITypePawn(EBossAIType AIType, E_LogLevel LogLevel)
|
||||
{
|
||||
`Log_Trace();
|
||||
|
||||
if (AIType < AIBossClassList.Length)
|
||||
return AIBossClassList[AIType];
|
||||
else
|
||||
|
@ -13,12 +13,14 @@ var public config float SingleSpawnLimitCycleMultiplier;
|
||||
var public config int AliveSpawnLimit;
|
||||
var public config bool bSmoothSpawn;
|
||||
|
||||
public static function InitConfig(int Version, int LatestVersion)
|
||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
ApplyDefault();
|
||||
ApplyDefault(LogLevel);
|
||||
|
||||
case 3:
|
||||
default.bSmoothSpawn = false;
|
||||
@ -32,8 +34,10 @@ public static function InitConfig(int Version, int LatestVersion)
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault()
|
||||
private static function ApplyDefault(E_LogLevel LogLevel)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
default.bCyclicalSpawn = true;
|
||||
default.bShadowSpawn = true;
|
||||
default.bSmoothSpawn = true;
|
||||
@ -50,6 +54,8 @@ public static function bool Load(E_LogLevel LogLevel)
|
||||
{
|
||||
local bool Errors;
|
||||
|
||||
`Log_TraceStatic();
|
||||
|
||||
if (default.ZedTotalMultiplier <= 0.f)
|
||||
{
|
||||
`Log_Error("ZedTotalMultiplier" @ "(" $ default.ZedTotalMultiplier $ ")" @ "must be greater than 0.0");
|
||||
|
@ -5,13 +5,15 @@ class SpawnAtPlayerStart extends Object
|
||||
var private config Array<String> ZedClass;
|
||||
var public config Array<String> Map;
|
||||
|
||||
public static function InitConfig(int Version, int LatestVersion)
|
||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
case 2:
|
||||
ApplyDefault();
|
||||
ApplyDefault(LogLevel);
|
||||
|
||||
default: break;
|
||||
}
|
||||
@ -22,8 +24,10 @@ public static function InitConfig(int Version, int LatestVersion)
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault()
|
||||
private static function ApplyDefault(E_LogLevel LogLevel)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
default.ZedClass.Length = 0;
|
||||
default.ZedClass.AddItem("HL2Monsters.Combine_Strider");
|
||||
default.ZedClass.AddItem("HL2Monsters.Combine_Gunship");
|
||||
@ -41,6 +45,8 @@ public static function Array<class<KFPawn_Monster> > Load(E_LogLevel LogLevel)
|
||||
local String ZedClassTmp;
|
||||
local int Line;
|
||||
|
||||
`Log_TraceStatic();
|
||||
|
||||
`Log_Info("Load zeds to spawn at player start:");
|
||||
foreach default.ZedClass(ZedClassTmp, Line)
|
||||
{
|
||||
|
@ -15,12 +15,14 @@ struct S_SpawnEntryCfg
|
||||
var public config bool bStopRegularSpawn;
|
||||
var private config Array<S_SpawnEntryCfg> Spawn;
|
||||
|
||||
public static function InitConfig(int Version, int LatestVersion, KFGI_Access KFGIA)
|
||||
public static function InitConfig(int Version, int LatestVersion, KFGI_Access KFGIA, E_LogLevel LogLevel)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
ApplyDefault(KFGIA);
|
||||
ApplyDefault(KFGIA, LogLevel);
|
||||
|
||||
default: break;
|
||||
}
|
||||
@ -31,12 +33,14 @@ public static function InitConfig(int Version, int LatestVersion, KFGI_Access KF
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault(KFGI_Access KFGIA)
|
||||
private static function ApplyDefault(KFGI_Access KFGIA, E_LogLevel LogLevel)
|
||||
{
|
||||
local S_SpawnEntryCfg SpawnEntry;
|
||||
local Array<class<KFPawn_Monster> > KFPM_Bosses;
|
||||
local class<KFPawn_Monster> KFPMC;
|
||||
|
||||
`Log_TraceStatic();
|
||||
|
||||
default.Spawn.Length = 0;
|
||||
|
||||
default.bStopRegularSpawn = true;
|
||||
@ -46,7 +50,7 @@ private static function ApplyDefault(KFGI_Access KFGIA)
|
||||
SpawnEntry.SingleSpawnLimit = 1;
|
||||
SpawnEntry.Delay = 30;
|
||||
SpawnEntry.Probability = 100;
|
||||
KFPM_Bosses = KFGIA.GetAIBossClassList();
|
||||
KFPM_Bosses = KFGIA.GetAIBossClassList(LogLevel);
|
||||
foreach KFPM_Bosses(KFPMC)
|
||||
{
|
||||
SpawnEntry.BossClass = "KFGameContent." $ String(KFPMC);
|
||||
@ -62,6 +66,8 @@ public static function Array<S_SpawnEntry> Load(E_LogLevel LogLevel)
|
||||
local int Line;
|
||||
local bool Errors;
|
||||
|
||||
`Log_TraceStatic();
|
||||
|
||||
`Log_Info("Load boss waves spawn list:");
|
||||
foreach default.Spawn(SpawnEntryCfg, Line)
|
||||
{
|
||||
|
@ -20,12 +20,14 @@ delegate int SpawnListSort(S_SpawnEntryCfg A, S_SpawnEntryCfg B)
|
||||
return A.Wave > B.Wave ? -1 : 0;
|
||||
}
|
||||
|
||||
public static function InitConfig(int Version, int LatestVersion, KFGI_Access KFGIA)
|
||||
public static function InitConfig(int Version, int LatestVersion, KFGI_Access KFGIA, E_LogLevel LogLevel)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
ApplyDefault(KFGIA);
|
||||
ApplyDefault(KFGIA, LogLevel);
|
||||
|
||||
default: break;
|
||||
}
|
||||
@ -36,12 +38,14 @@ public static function InitConfig(int Version, int LatestVersion, KFGI_Access KF
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault(KFGI_Access KFGIA)
|
||||
private static function ApplyDefault(KFGI_Access KFGIA, E_LogLevel LogLevel)
|
||||
{
|
||||
local S_SpawnEntryCfg SpawnEntry;
|
||||
local Array<class<KFPawn_Monster> > KFPM_Zeds;
|
||||
local class<KFPawn_Monster> KFPMC;
|
||||
|
||||
`Log_TraceStatic();
|
||||
|
||||
default.Spawn.Length = 0;
|
||||
|
||||
SpawnEntry.Wave = 0;
|
||||
@ -51,7 +55,7 @@ private static function ApplyDefault(KFGI_Access KFGIA)
|
||||
SpawnEntry.Delay = 60;
|
||||
SpawnEntry.Probability = 100;
|
||||
|
||||
KFPM_Zeds = KFGIA.GetAIClassList();
|
||||
KFPM_Zeds = KFGIA.GetAIClassList(LogLevel);
|
||||
foreach KFPM_Zeds(KFPMC)
|
||||
{
|
||||
++SpawnEntry.Wave;
|
||||
@ -68,6 +72,8 @@ public static function Array<S_SpawnEntry> Load(E_LogLevel LogLevel)
|
||||
local int Line;
|
||||
local bool Errors;
|
||||
|
||||
`Log_TraceStatic();
|
||||
|
||||
`Log_Info("Load spawn list:");
|
||||
foreach default.Spawn(SpawnEntryCfg, Line)
|
||||
{
|
||||
|
@ -16,12 +16,14 @@ struct S_SpawnEntryCfg
|
||||
var public config bool bStopRegularSpawn;
|
||||
var private config Array<S_SpawnEntryCfg> Spawn;
|
||||
|
||||
public static function InitConfig(int Version, int LatestVersion)
|
||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
ApplyDefault();
|
||||
ApplyDefault(LogLevel);
|
||||
|
||||
default: break;
|
||||
}
|
||||
@ -32,11 +34,13 @@ public static function InitConfig(int Version, int LatestVersion)
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault()
|
||||
private static function ApplyDefault(E_LogLevel LogLevel)
|
||||
{
|
||||
local S_SpawnEntryCfg SpawnEntry;
|
||||
local EAIType AIType;
|
||||
|
||||
`Log_TraceStatic();
|
||||
|
||||
default.bStopRegularSpawn = true;
|
||||
default.Spawn.Length = 0;
|
||||
SpawnEntry.ZedClass = "SomePackage.SomeClass";
|
||||
@ -60,6 +64,8 @@ public static function Array<S_SpawnEntry> Load(KFGameInfo_Endless KFGIE, E_LogL
|
||||
local int Line;
|
||||
local bool Errors;
|
||||
|
||||
`Log_TraceStatic();
|
||||
|
||||
if (KFGIE == None)
|
||||
{
|
||||
`Log_Info("Not Endless mode, skip loading special waves");
|
||||
|
@ -64,7 +64,7 @@ var private Array<class<KFPawn_Monster> > SpawnAtPlayerStartZeds;
|
||||
var private bool SpawnActive;
|
||||
var private String SpawnListsComment;
|
||||
|
||||
var private Array<ZedSpawnerRepLink> RepLinks;
|
||||
var private Array<ZedSpawnerRepInfo> RepInfos;
|
||||
|
||||
public simulated function bool SafeDestroy()
|
||||
{
|
||||
@ -73,7 +73,7 @@ public simulated function bool SafeDestroy()
|
||||
|
||||
public event PreBeginPlay()
|
||||
{
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
if (WorldInfo.NetMode == NM_Client)
|
||||
{
|
||||
@ -83,20 +83,11 @@ public event PreBeginPlay()
|
||||
}
|
||||
|
||||
Super.PreBeginPlay();
|
||||
|
||||
PreInit();
|
||||
}
|
||||
|
||||
public event PostBeginPlay()
|
||||
{
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (bPendingDelete || bDeleteMe) return;
|
||||
|
||||
Super.PostBeginPlay();
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
private function InitConfig()
|
||||
private function PreInit()
|
||||
{
|
||||
if (Version == `NO_CONFIG)
|
||||
{
|
||||
@ -104,11 +95,11 @@ private function InitConfig()
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
CfgSpawn.static.InitConfig(Version, LatestVersion);
|
||||
CfgSpawnAtPlayerStart.static.InitConfig(Version, LatestVersion);
|
||||
CfgSpawnListRW.static.InitConfig(Version, LatestVersion, KFGIA);
|
||||
CfgSpawnListBW.static.InitConfig(Version, LatestVersion, KFGIA);
|
||||
CfgSpawnListSW.static.InitConfig(Version, LatestVersion);
|
||||
CfgSpawn.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||
CfgSpawnAtPlayerStart.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||
CfgSpawnListRW.static.InitConfig(Version, LatestVersion, KFGIA, LogLevel);
|
||||
CfgSpawnListBW.static.InitConfig(Version, LatestVersion, KFGIA, LogLevel);
|
||||
CfgSpawnListSW.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
@ -141,28 +132,7 @@ private function InitConfig()
|
||||
Version = LatestVersion;
|
||||
SaveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
private function Init()
|
||||
{
|
||||
local S_SpawnEntry SE;
|
||||
local String CurrentMap;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
|
||||
KFGIS = KFGameInfo_Survival(WorldInfo.Game);
|
||||
if (KFGIS == None)
|
||||
{
|
||||
`Log_Fatal("Incompatible gamemode:" @ WorldInfo.Game $ ". Destroy...");
|
||||
SafeDestroy();
|
||||
return;
|
||||
}
|
||||
|
||||
KFGIA = new(KFGIS) class'KFGI_Access';
|
||||
KFGIE = KFGameInfo_Endless(KFGIS);
|
||||
|
||||
InitConfig();
|
||||
|
||||
if (LogLevel == LL_WrongLevel)
|
||||
{
|
||||
LogLevel = LL_Info;
|
||||
@ -174,10 +144,6 @@ private function Init()
|
||||
if (Tickrate <= 0)
|
||||
{
|
||||
`Log_Error("Spawner tickrate must be positive (current value:" @ Tickrate $ ")");
|
||||
}
|
||||
|
||||
if (!CfgSpawn.static.Load(LogLevel) || Tickrate <= 0)
|
||||
{
|
||||
`Log_Fatal("Wrong settings, Destroy...");
|
||||
SafeDestroy();
|
||||
return;
|
||||
@ -185,11 +151,56 @@ private function Init()
|
||||
|
||||
dt = 1 / Tickrate;
|
||||
`Log_Info("Spawner tickrate:" @ Tickrate @ "(update every" @ dt $ "s)");
|
||||
|
||||
if (!CfgSpawn.static.Load(LogLevel))
|
||||
{
|
||||
`Log_Fatal("Wrong settings, Destroy...");
|
||||
SafeDestroy();
|
||||
return;
|
||||
}
|
||||
|
||||
SpawnListRW = CfgSpawnListRW.static.Load(LogLevel);
|
||||
SpawnListBW = CfgSpawnListBW.static.Load(LogLevel);
|
||||
SpawnListSW = CfgSpawnListSW.static.Load(KFGIE, LogLevel);
|
||||
SpawnAtPlayerStartZeds = CfgSpawnAtPlayerStart.static.Load(LogLevel);
|
||||
}
|
||||
|
||||
public event PostBeginPlay()
|
||||
{
|
||||
`Log_Trace();
|
||||
|
||||
if (bPendingDelete || bDeleteMe) return;
|
||||
|
||||
Super.PostBeginPlay();
|
||||
|
||||
PostInit();
|
||||
}
|
||||
|
||||
private function PostInit()
|
||||
{
|
||||
local S_SpawnEntry SE;
|
||||
local String CurrentMap;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
KFGIS = KFGameInfo_Survival(WorldInfo.Game);
|
||||
if (KFGIS == None)
|
||||
{
|
||||
`Log_Fatal("Incompatible gamemode:" @ WorldInfo.Game $ ". Destroy...");
|
||||
SafeDestroy();
|
||||
return;
|
||||
}
|
||||
|
||||
KFGIA = new(KFGIS) class'KFGI_Access';
|
||||
if (KFGIA == None)
|
||||
{
|
||||
`Log_Fatal("Can't create KFGI_Access object");
|
||||
SafeDestroy();
|
||||
return;
|
||||
}
|
||||
|
||||
KFGIE = KFGameInfo_Endless(KFGIS);
|
||||
|
||||
SpawnListSW = CfgSpawnListSW.static.Load(KFGIE, LogLevel);
|
||||
|
||||
CurrentMap = String(WorldInfo.GetPackageName());
|
||||
GlobalSpawnAtPlayerStart = (CfgSpawnAtPlayerStart.default.Map.Find(CurrentMap) != INDEX_NONE);
|
||||
@ -220,6 +231,8 @@ private function PreloadContent()
|
||||
{
|
||||
local class<KFPawn_Monster> PawnClass;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
ExtractCustomZedsFromSpawnList(SpawnListRW, CustomZeds);
|
||||
ExtractCustomZedsFromSpawnList(SpawnListBW, CustomZeds);
|
||||
ExtractCustomZedsFromSpawnList(SpawnListSW, CustomZeds);
|
||||
@ -235,10 +248,12 @@ private function ExtractCustomZedsFromSpawnList(Array<S_SpawnEntry> SpawnList, o
|
||||
{
|
||||
local S_SpawnEntry SE;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
foreach SpawnList(SE)
|
||||
{
|
||||
if (Out.Find(SE.ZedClass) == INDEX_NONE
|
||||
&& KFGIA.IsCustomZed(SE.ZedClass))
|
||||
&& KFGIA.IsCustomZed(SE.ZedClass, LogLevel))
|
||||
{
|
||||
Out.AddItem(SE.ZedClass);
|
||||
}
|
||||
@ -251,7 +266,7 @@ private function SpawnTimer()
|
||||
local int Index;
|
||||
local float Threshold;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
if (KFGIS.WaveNum != 0 && CurrentWave < KFGIS.WaveNum)
|
||||
{
|
||||
@ -323,7 +338,7 @@ private function SetupWave()
|
||||
local S_SpawnEntry SE;
|
||||
local EAIType SWType;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
if (CfgSpawn.default.bCyclicalSpawn && KFGIS.WaveNum > 1 && KFGIS.WaveNum == CycleWaveShift + CycleWaveSize * CurrentCycle)
|
||||
{
|
||||
@ -350,7 +365,7 @@ private function SetupWave()
|
||||
|
||||
if (KFGIS.MyKFGRI.IsBossWave())
|
||||
{
|
||||
CurrentBossClass = KFGIA.BossAITypePawn(EBossAIType(KFGIS.MyKFGRI.BossIndex));
|
||||
CurrentBossClass = KFGIA.BossAITypePawn(EBossAIType(KFGIS.MyKFGRI.BossIndex), LogLevel);
|
||||
if (CurrentBossClass == None)
|
||||
{
|
||||
`Log_Error("Can't determine boss class. Boss index:" @ KFGIS.MyKFGRI.BossIndex);
|
||||
@ -432,7 +447,7 @@ private function AdjustSpawnList(out Array<S_SpawnEntry> List)
|
||||
local float PawnTotalF, PawnLimitF;
|
||||
local int ZedNameMaxLength;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
Cycle = float(CurrentCycle);
|
||||
Players = float(PlayerCount());
|
||||
@ -487,7 +502,7 @@ private function SpawnTimerLogger(bool Stop, optional String Comment)
|
||||
{
|
||||
local String Message;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
if (Stop)
|
||||
Message = "Stop spawn";
|
||||
@ -511,7 +526,7 @@ private function SpawnEntry(out Array<S_SpawnEntry> SpawnList, int Index)
|
||||
local String Action, Comment, NextSpawn;
|
||||
local bool SpawnAtPlayerStart;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
SE = SpawnList[Index];
|
||||
|
||||
@ -628,7 +643,7 @@ private function int PlayerCount()
|
||||
local int HumanPlayers;
|
||||
local KFOnlineGameSettings KFGameSettings;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
if (KFGIS.PlayfabInter != None && KFGIS.PlayfabInter.GetGameSettings() != None)
|
||||
{
|
||||
@ -653,7 +668,7 @@ private function Vector PlayerStartLocation()
|
||||
{
|
||||
local PlayerController PC;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
foreach WorldInfo.AllControllers(class'PlayerController', PC)
|
||||
return KFGIS.FindPlayerStart(PC, 0).Location;
|
||||
@ -672,7 +687,7 @@ private function int SpawnZed(class<KFPawn_Monster> ZedClass, int PawnCount, opt
|
||||
local int Failed, Spawned;
|
||||
local int Index;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
PlayerStart = PlayerStartLocation();
|
||||
if (SpawnAtPlayerStart)
|
||||
@ -750,55 +765,58 @@ private function int SpawnZed(class<KFPawn_Monster> ZedClass, int PawnCount, opt
|
||||
|
||||
public function NotifyLogin(Controller C)
|
||||
{
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
CreateRepLink(C);
|
||||
if (!CreateRepInfo(C))
|
||||
{
|
||||
`Log_Error("Can't create RepInfo for:" @ C);
|
||||
}
|
||||
}
|
||||
|
||||
public function NotifyLogout(Controller C)
|
||||
{
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
DestroyRepLink(C);
|
||||
DestroyRepInfo(C);
|
||||
}
|
||||
|
||||
public function bool CreateRepLink(Controller C)
|
||||
public function bool CreateRepInfo(Controller C)
|
||||
{
|
||||
local ZedSpawnerRepLink RepLink;
|
||||
local ZedSpawnerRepInfo RepInfo;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
if (C == None) return false;
|
||||
|
||||
RepLink = Spawn(class'ZedSpawnerRepLink', C);
|
||||
RepInfo = Spawn(class'ZedSpawnerRepInfo', C);
|
||||
|
||||
if (RepLink == None) return false;
|
||||
if (RepInfo == None) return false;
|
||||
|
||||
RepLink.LogLevel = LogLevel;
|
||||
RepLink.CustomZeds = CustomZeds;
|
||||
RepLink.ZS = Self;
|
||||
RepInfo.LogLevel = LogLevel;
|
||||
RepInfo.CustomZeds = CustomZeds;
|
||||
RepInfo.ZS = Self;
|
||||
|
||||
RepLinks.AddItem(RepLink);
|
||||
RepInfos.AddItem(RepInfo);
|
||||
|
||||
RepLink.ServerSync();
|
||||
RepInfo.ServerSync();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function bool DestroyRepLink(Controller C)
|
||||
public function bool DestroyRepInfo(Controller C)
|
||||
{
|
||||
local ZedSpawnerRepLink RepLink;
|
||||
local ZedSpawnerRepInfo RepInfo;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
if (C == None) return false;
|
||||
|
||||
foreach RepLinks(RepLink)
|
||||
foreach RepInfos(RepInfo)
|
||||
{
|
||||
if (RepLink.Owner == C)
|
||||
if (RepInfo.Owner == C)
|
||||
{
|
||||
RepLink.SafeDestroy();
|
||||
RepLinks.RemoveItem(RepLink);
|
||||
RepInfos.RemoveItem(RepInfo);
|
||||
RepInfo.SafeDestroy();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -806,7 +824,7 @@ public function bool DestroyRepLink(Controller C)
|
||||
return false;
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
@ -5,25 +5,23 @@ var private ZedSpawner ZS;
|
||||
|
||||
public event PreBeginPlay()
|
||||
{
|
||||
Super.PreBeginPlay();
|
||||
Super.PreBeginPlay();
|
||||
|
||||
if (WorldInfo.NetMode == NM_Client) return;
|
||||
|
||||
foreach WorldInfo.DynamicActors(class'ZedSpawner', ZS)
|
||||
{
|
||||
`Log_Base("Found 'ZedSpawner'");
|
||||
break;
|
||||
}
|
||||
|
||||
if (ZS == None)
|
||||
{
|
||||
`Log_Base("Spawn 'ZedSpawner'");
|
||||
ZS = WorldInfo.Spawn(class'ZedSpawner');
|
||||
}
|
||||
|
||||
if (ZS == None)
|
||||
{
|
||||
`Log_Base("Can't Spawn 'ZedSpawner', Destroy...");
|
||||
`Log_Base("FATAL: Can't Spawn 'ZedSpawner'");
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
@ -40,19 +38,19 @@ public function AddMutator(Mutator Mut)
|
||||
|
||||
public function NotifyLogin(Controller C)
|
||||
{
|
||||
Super.NotifyLogin(C);
|
||||
|
||||
ZS.NotifyLogin(C);
|
||||
|
||||
Super.NotifyLogin(C);
|
||||
}
|
||||
|
||||
public function NotifyLogout(Controller C)
|
||||
{
|
||||
Super.NotifyLogout(C);
|
||||
|
||||
ZS.NotifyLogout(C);
|
||||
|
||||
Super.NotifyLogout(C);
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
class ZedSpawnerRepLink extends ReplicationInfo;
|
||||
class ZedSpawnerRepInfo extends ReplicationInfo;
|
||||
|
||||
var public ZedSpawner ZS;
|
||||
var public E_LogLevel LogLevel;
|
||||
@ -18,7 +18,7 @@ public simulated function bool SafeDestroy()
|
||||
|
||||
public reliable client function ClientSync(class<KFPawn_Monster> CustomZed)
|
||||
{
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
`Log_Debug("Received:" @ CustomZed);
|
||||
CustomZeds.AddItem(CustomZed);
|
||||
@ -29,7 +29,7 @@ public reliable client function SyncFinished()
|
||||
{
|
||||
local class<KFPawn_Monster> CustomZed;
|
||||
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
foreach CustomZeds(CustomZed)
|
||||
{
|
||||
@ -42,7 +42,7 @@ public reliable client function SyncFinished()
|
||||
|
||||
public reliable server function ServerSync()
|
||||
{
|
||||
`Log_Trace(`Location);
|
||||
`Log_Trace();
|
||||
|
||||
if (bPendingDelete || bDeleteMe) return;
|
||||
|
||||
@ -50,7 +50,7 @@ public reliable server function ServerSync()
|
||||
{
|
||||
`Log_Debug("Sync finished");
|
||||
SyncFinished();
|
||||
if (!ZS.DestroyRepLink(Controller(Owner)))
|
||||
if (!ZS.DestroyRepInfo(Controller(Owner)))
|
||||
{
|
||||
SafeDestroy();
|
||||
}
|
@ -4,6 +4,7 @@ class _Logger extends Object
|
||||
enum E_LogLevel
|
||||
{
|
||||
LL_WrongLevel,
|
||||
LL_None,
|
||||
LL_Fatal,
|
||||
LL_Error,
|
||||
LL_Warning,
|
||||
|
@ -1,11 +1,15 @@
|
||||
// Logger
|
||||
`define Log_Tag 'ZedSpawner'
|
||||
|
||||
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
|
||||
`define LocationStatic "`{ClassName}::" $ GetFuncName()
|
||||
|
||||
`define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
|
||||
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag)
|
||||
`define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
|
||||
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag)
|
||||
`define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag)
|
||||
`define Log_Trace(msg) `log("TRACE:" @ `msg, (LogLevel >= LL_Trace), `Log_Tag)
|
||||
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
|
||||
|
||||
`define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
|
||||
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag)
|
||||
`define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
|
||||
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag)
|
||||
`define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag)
|
||||
|
||||
`define Log_Trace(msg) `log("TRACE:" @ `Location `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
||||
`define Log_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
||||
|
@ -11,6 +11,15 @@ StripSource="True"
|
||||
PackageBuildOrder="ZedSpawner"
|
||||
|
||||
|
||||
### Brew parameters ###
|
||||
|
||||
# Packages you want to brew using @peelz's patched KFEditor.
|
||||
# Useful for cases where regular brew doesn't put *.upk inside the package.
|
||||
# Specify them with a space as a separator,
|
||||
# The order doesn't matter
|
||||
PackagePeelzBrew=""
|
||||
|
||||
|
||||
### Steam Workshop upload parameters ###
|
||||
|
||||
# Mutators that will be uploaded to the workshop
|
||||
|
2
tools
2
tools
Submodule tools updated: 2f173aad7a...88b35bd7eb
Reference in New Issue
Block a user