2022-05-11 12:43:39 +00:00
|
|
|
class Spawn extends Object
|
|
|
|
dependson(ZedSpawner)
|
|
|
|
config(ZedSpawner);
|
|
|
|
|
|
|
|
var config bool bCyclicalSpawn;
|
|
|
|
var config bool bShadowSpawn;
|
2022-05-16 02:42:13 +00:00
|
|
|
|
|
|
|
var config float ZedTotalMultiplier;
|
|
|
|
var config float SpawnTotalPlayerMultiplier;
|
|
|
|
var config float SpawnTotalCycleMultiplier;
|
|
|
|
|
|
|
|
var config float SingleSpawnLimitMultiplier;
|
|
|
|
var config float SingleSpawnLimitPlayerMultiplier;
|
|
|
|
var config float SingleSpawnLimitCycleMultiplier;
|
|
|
|
|
2022-05-11 12:43:39 +00:00
|
|
|
var config int AliveSpawnLimit;
|
|
|
|
|
2022-05-20 20:45:26 +00:00
|
|
|
public static function InitConfig(int Version, int LatestVersion)
|
|
|
|
{
|
|
|
|
switch (Version)
|
|
|
|
{
|
|
|
|
case `NO_CONFIG:
|
|
|
|
ApplyDefault();
|
|
|
|
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (LatestVersion != Version)
|
|
|
|
{
|
|
|
|
StaticSaveConfig();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private static function ApplyDefault()
|
2022-05-11 12:43:39 +00:00
|
|
|
{
|
|
|
|
default.bCyclicalSpawn = true;
|
|
|
|
default.bShadowSpawn = true;
|
2022-05-16 02:42:13 +00:00
|
|
|
default.ZedTotalMultiplier = 1.0;
|
|
|
|
default.SpawnTotalPlayerMultiplier = 0.75;
|
|
|
|
default.SpawnTotalCycleMultiplier = 0.75;
|
|
|
|
default.SingleSpawnLimitPlayerMultiplier = 0.75;
|
|
|
|
default.SingleSpawnLimitCycleMultiplier = 0.75;
|
2022-05-11 12:43:39 +00:00
|
|
|
default.AliveSpawnLimit = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function bool Load(E_LogLevel LogLevel)
|
|
|
|
{
|
|
|
|
local bool Errors;
|
|
|
|
|
2022-05-16 02:42:13 +00:00
|
|
|
if (default.ZedTotalMultiplier <= 0.f)
|
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Error("ZedTotalMultiplier" @ "(" $ default.ZedTotalMultiplier $ ")" @ "must be greater than 0.0");
|
2022-05-16 02:42:13 +00:00
|
|
|
Errors = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (default.SpawnTotalPlayerMultiplier < 0.f)
|
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Error("SpawnTotalPlayerMultiplier" @ "(" $ default.SpawnTotalPlayerMultiplier $ ")" @ "must be greater than or equal 0.0");
|
2022-05-16 02:42:13 +00:00
|
|
|
Errors = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (default.SpawnTotalCycleMultiplier < 0.f)
|
2022-05-11 12:43:39 +00:00
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Error("SpawnTotalCycleMultiplier" @ "(" $ default.SpawnTotalCycleMultiplier $ ")" @ "must be greater than or equal 0.0");
|
2022-05-11 12:43:39 +00:00
|
|
|
Errors = true;
|
|
|
|
}
|
|
|
|
|
2022-05-16 02:42:13 +00:00
|
|
|
if (default.SingleSpawnLimitPlayerMultiplier < 0.f)
|
2022-05-11 12:43:39 +00:00
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Error("SingleSpawnLimitPlayerMultiplier" @ "(" $ default.SingleSpawnLimitPlayerMultiplier $ ")" @ "must be greater than or equal 0.0");
|
2022-05-11 12:43:39 +00:00
|
|
|
Errors = true;
|
|
|
|
}
|
|
|
|
|
2022-05-16 02:42:13 +00:00
|
|
|
if (default.SingleSpawnLimitCycleMultiplier < 0.f)
|
2022-05-11 12:43:39 +00:00
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Error("SingleSpawnLimitCycleMultiplier" @ "(" $ default.SingleSpawnLimitCycleMultiplier $ ")" @ "must be greater than or equal 0.0");
|
2022-05-11 12:43:39 +00:00
|
|
|
Errors = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (default.AliveSpawnLimit < 0)
|
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Error("AliveSpawnLimit" @ "(" $ default.AliveSpawnLimit $ ")" @ "must be greater than or equal 0");
|
2022-05-11 12:43:39 +00:00
|
|
|
Errors = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return !Errors;
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|