2022-06-13 14:02:03 +00:00
|
|
|
class SpawnAtPlayerStart extends Object
|
|
|
|
dependson(ZedSpawner)
|
|
|
|
config(ZedSpawner);
|
|
|
|
|
|
|
|
var private config Array<String> ZedClass;
|
|
|
|
var public config Array<String> Map;
|
|
|
|
|
2022-07-19 10:28:43 +00:00
|
|
|
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
2022-06-13 14:02:03 +00:00
|
|
|
{
|
2022-07-19 10:28:43 +00:00
|
|
|
`Log_TraceStatic();
|
|
|
|
|
2022-06-13 14:02:03 +00:00
|
|
|
switch (Version)
|
|
|
|
{
|
|
|
|
case `NO_CONFIG:
|
|
|
|
case 2:
|
2022-07-19 10:28:43 +00:00
|
|
|
ApplyDefault(LogLevel);
|
2022-06-13 14:02:03 +00:00
|
|
|
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (LatestVersion != Version)
|
|
|
|
{
|
|
|
|
StaticSaveConfig();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-19 10:28:43 +00:00
|
|
|
private static function ApplyDefault(E_LogLevel LogLevel)
|
2022-06-13 14:02:03 +00:00
|
|
|
{
|
2022-07-19 10:28:43 +00:00
|
|
|
`Log_TraceStatic();
|
|
|
|
|
2022-06-13 14:02:03 +00:00
|
|
|
default.ZedClass.Length = 0;
|
|
|
|
default.ZedClass.AddItem("HL2Monsters.Combine_Strider");
|
|
|
|
default.ZedClass.AddItem("HL2Monsters.Combine_Gunship");
|
|
|
|
default.ZedClass.AddItem("HL2Monsters.Hunter_Chopper");
|
|
|
|
default.ZedClass.AddItem("SomePackage.SomeZedClassYouWantToSpawnAtPlayerStart");
|
|
|
|
|
|
|
|
default.Map.Length = 0;
|
|
|
|
default.Map.AddItem("KF-SomeMapNameWhereYouWantSpawnZedsAtPlayerStart");
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function Array<class<KFPawn_Monster> > Load(E_LogLevel LogLevel)
|
|
|
|
{
|
|
|
|
local Array<class<KFPawn_Monster> > ZedList;
|
|
|
|
local class<KFPawn_Monster> KFPMC;
|
|
|
|
local String ZedClassTmp;
|
2022-07-13 06:56:35 +00:00
|
|
|
local int Line;
|
2022-06-13 14:02:03 +00:00
|
|
|
|
2022-07-19 10:28:43 +00:00
|
|
|
`Log_TraceStatic();
|
|
|
|
|
2022-07-13 07:00:06 +00:00
|
|
|
`Log_Info("Load zeds to spawn at player start:");
|
2022-06-13 14:02:03 +00:00
|
|
|
foreach default.ZedClass(ZedClassTmp, Line)
|
|
|
|
{
|
|
|
|
KFPMC = class<KFPawn_Monster>(DynamicLoadObject(ZedClassTmp, class'Class'));
|
|
|
|
if (KFPMC == None)
|
|
|
|
{
|
2022-07-13 07:00:06 +00:00
|
|
|
`Log_Warn("[" $ Line + 1 $ "]" @ "Can't load zed class:" @ ZedClassTmp);
|
2022-06-13 14:02:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ZedList.AddItem(KFPMC);
|
2022-07-13 07:00:06 +00:00
|
|
|
`Log_Debug("[" $ Line + 1 $ "]" @ "Loaded successfully:" @ ZedClassTmp);
|
2022-06-13 14:02:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-13 06:56:35 +00:00
|
|
|
if (ZedList.Length == default.ZedClass.Length)
|
2022-06-13 14:02:03 +00:00
|
|
|
{
|
2022-07-13 07:00:06 +00:00
|
|
|
`Log_Info("Spawn at player start list (Zeds) loaded successfully (" $ default.ZedClass.Length @ "entries)");
|
2022-06-13 14:02:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-07-13 07:00:06 +00:00
|
|
|
`Log_Info("Spawn at player start list (Zeds): loaded" @ ZedList.Length @ "of" @ default.ZedClass.Length @ "entries");
|
2022-06-13 14:02:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ZedList;
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|