Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
e1face5c04 | |||
35048c6fec | |||
088da70984 | |||
525ee1728e | |||
3dad5b10c7 | |||
3a42094ca2 | |||
a45ba21925 | |||
f681c7d40d | |||
0de9c0088c | |||
c06591d5a2 | |||
11c5490bd6 | |||
3fbf4e9c20 | |||
40c9546858 | |||
83286ea046 | |||
88fcd8b235 |
@ -1,7 +1,71 @@
|
|||||||
[h1]ZedSpawner[/h1]
|
|
||||||
|
|
||||||
[h1]Description[/h1]
|
[h1]Description[/h1]
|
||||||
Work In Progress...
|
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
|
||||||
|
|
||||||
|
[h1]Features[/h1]
|
||||||
|
- spawn without increasing zed counter;
|
||||||
|
- spawn depends on the number of players;
|
||||||
|
- cyclic spawn (useful for endless mode);
|
||||||
|
- separate spawn for special waves and boss waves;
|
||||||
|
- spawn after a certain percentage of killed zeds.
|
||||||
|
|
||||||
|
[h1]Whitelisted?[/h1]
|
||||||
|
No. This mod is not whitelisted and will unrank your server. Any XP gained will not be saved.
|
||||||
|
|
||||||
|
[h1]Usage (single player)[/h1]
|
||||||
|
1. Subscribe to this mutator;
|
||||||
|
2. Start KF2;
|
||||||
|
3. Open console (`) and input:
|
||||||
|
[b]open KF-BioticsLab?Mutator=ZedSpawner.ZedSpawnerMut[/b]
|
||||||
|
(replace the map and add the parameters you need)
|
||||||
|
4. <Enter>.
|
||||||
|
|
||||||
|
[h1]Usage (server)[/h1]
|
||||||
|
[b]Note:[/b] [i]If you don't understand what is written here, read the article [url=https://wiki.killingfloor2.com/index.php?title=Dedicated_Server_(Killing_Floor_2)][u]Dedicated Server (KF2 wiki)[/u][/url] before following these instructions.[/i]
|
||||||
|
|
||||||
|
1. Open your [b]PCServer-KFEngine.ini[/b] / [b]LinuxServer-KFEngine.ini[/b];
|
||||||
|
2. Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
|
||||||
|
[b]ServerSubscribedWorkshopItems=2811290931[/b]
|
||||||
|
3. Start the server and wait while the mutator is downloading;
|
||||||
|
4. Add mutator to server start parameters: [b]?Mutator=ZedSpawner.ZedSpawnerMut[/b] and restart the server.
|
||||||
|
|
||||||
|
[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.
|
||||||
|
|
||||||
|
[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]
|
||||||
|
After the last wave in the spawn list ends, spawn will start again from the beginning of the list.
|
||||||
|
Using the [b]SpawnTotalCycleMultiplier[/b] and [b]SingleSpawnLimitCycleMultiplier[/b] modifiers will allow you to adjust the difficulty of the following cycles.
|
||||||
|
|
||||||
|
[b]Shadow spawn[/b]
|
||||||
|
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]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.
|
||||||
|
|
||||||
|
[b]Spawn lists[/b]
|
||||||
|
Use the [b][ZedSpawner.SpawnListRegular][/b] section to set spawn on any wave.
|
||||||
|
Use the [b][ZedSpawner.SpawnListBossWaves][/b] and [b][ZedSpawner.SpawnListSpecialWaves][/b] sections to set a separate spawn for the boss wave and special waves if needed. Use [b]bStopRegularSpawn=True[/b] if you want to stop spawning from the regular list during boss waves or special waves.
|
||||||
|
|
||||||
|
[b]Spawn entry parameters[/b]
|
||||||
|
[list]
|
||||||
|
[*][b]Wave / BossClass[/b] - what wave is the spawn for. Wave number for the regular list, wave type for the special list; boss class for the boss list.
|
||||||
|
[*][b]ZedClass[/b] - the class of the zed you want to spawn (for example: ZedternalReborn.WMPawn_ZedScrake_Omega).
|
||||||
|
[*][b]RelativeStart[/b] - allows you to start spawning a zed not on a timer, but after killing the specified percentage of zeds. If set to zero, spawn will start after [b]Delay[/b] seconds from the start of the wave. Note that [b]RelativeStart[/b] does not work on bosses.
|
||||||
|
[*][b]Delay[/b] - time in seconds between spawns.
|
||||||
|
[*][b]Probability[/b] - the chance (%) of each spawn (1-100).
|
||||||
|
[*][b]SpawnCountBase[/b] - The base number of zeds to spawn, aka the number of zeds that will be spawned on the first cycle with one player. Can be adjusted by modifiers, number of players and cycle number.
|
||||||
|
[*][b]SingleSpawnLimit[/b] - maximum number of zeds for one spawn. Can be adjusted by modifiers, number of players and cycle number.
|
||||||
|
[*][b]bSpawnAtPlayerStart[/b] - exactly what is written.
|
||||||
|
[/list]
|
||||||
|
|
||||||
|
[h1]Spawn logic[/h1]
|
||||||
|
I really tried to describe in text how it works, but every time I got some kind of crap. Therefore, I decided to explain it a little differently and made a small calculator for this. It is interactive, you can change the parameters and see what happens. It has all the necessary explanations, so I think you will quickly figure out how the spawner works.
|
||||||
|
|
||||||
|
[h1]📌[url=https://redirect.genzmey.su/kf2-zedspawner-calc]Spawn calculator[/url][/h1]
|
||||||
|
[i]Just please try not to interfere with each other if you see that someone is already using a calculator.[/i]
|
||||||
|
|
||||||
|
By the way, ZedSpawner logs everything it does, so reading the logs can also help you figure out how it works.
|
||||||
|
|
||||||
[h1]Sources[/h1]
|
[h1]Sources[/h1]
|
||||||
[url=https://github.com/GenZmeY/KF2-ZedSpawner]https://github.com/GenZmeY/KF2-ZedSpawner[/url]
|
[url=https://github.com/GenZmeY/KF2-ZedSpawner]https://github.com/GenZmeY/KF2-ZedSpawner[/url] (GNU GPLv3)
|
||||||
|
BIN
PublicationContent/preview.gif
Normal file
BIN
PublicationContent/preview.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 879 KiB |
54
README.md
54
README.md
@ -1 +1,53 @@
|
|||||||
# KF2-ZedSpawner
|
# 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)
|
||||||
|
[](LICENSE)
|
||||||
|
|
||||||
|
# Description
|
||||||
|
Spawner for zeds. Started as a modification of the [this version](https://steamcommunity.com/sharedfiles/filedetails/?id=2488241348), but now there is almost nothing left of the previous mutator, lol
|
||||||
|
|
||||||
|
# Features
|
||||||
|
- spawn without increasing zed counter;
|
||||||
|
- spawn depends on the number of players;
|
||||||
|
- cyclic spawn (useful for endless mode);
|
||||||
|
- separate spawn for special waves and boss waves;
|
||||||
|
- spawn after a certain percentage of killed zeds.
|
||||||
|
|
||||||
|
# Usage & Setup
|
||||||
|
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931)
|
||||||
|
|
||||||
|
# Spawn calculator
|
||||||
|
[Spawn Calculator](https://docs.google.com/spreadsheets/d/1q67WJ36jhj6Y0lPNO5tS2bU79Wphu4Xmi62me6DAwtM/edit?usp=sharing)
|
||||||
|
|
||||||
|
# Build
|
||||||
|
**Note:** If you want to build/test/brew/publish a mutator without git-bash and/or scripts, follow [these instructions](https://tripwireinteractive.atlassian.net/wiki/spaces/KF2SW/pages/26247172/KF2+Code+Modding+How-to) instead of what is described here.
|
||||||
|
1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win);
|
||||||
|
2. open git-bash and go to any folder where you want to store sources:
|
||||||
|
`cd <ANY_FOLDER_YOU_WANT>`
|
||||||
|
3. Clone this repository and go to the source folder:
|
||||||
|
`git clone https://github.com/GenZmeY/KF2-ZedSpawner && cd KF2-ZedSpawner`
|
||||||
|
4. Download dependencies:
|
||||||
|
`git submodule init && git submodule update`
|
||||||
|
5. Compile:
|
||||||
|
`./tools/builder -c`
|
||||||
|
5. The compiled files will be here:
|
||||||
|
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
|
||||||
|
|
||||||
|
# Testing
|
||||||
|
Open git-bash in the source folder and run command:
|
||||||
|
`./tools/builder -t`
|
||||||
|
(or `./tools/builder -ct` if you haven't compiled the mutator yet)
|
||||||
|
|
||||||
|
A local single-user test will be launched with parameters from `builder.cfg` (edit this file if you want to test mutator with different parameters).
|
||||||
|
|
||||||
|
# Bug reports
|
||||||
|
If you find a bug, go to the [issue page](https://github.com/GenZmeY/KF2-ZedSpawner/issues) and check if there is a description of your bug. If not, create a new issue.
|
||||||
|
Describe what the bug looks like and how reproduce it.
|
||||||
|
Attaching your KFZedSpawner.ini and Launch.log can also be helpful.
|
||||||
|
|
||||||
|
# License
|
||||||
|
[GNU GPLv3](LICENSE)
|
||||||
|
@ -63,6 +63,12 @@ public static function bool Load(E_LogLevel LogLevel)
|
|||||||
Errors = true;
|
Errors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (default.SingleSpawnLimitMultiplier <= 0.f)
|
||||||
|
{
|
||||||
|
`ZS_Error("SingleSpawnLimitMultiplier" @ "(" $ default.SingleSpawnLimitMultiplier $ ")" @ "must be greater than 0.0");
|
||||||
|
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");
|
`ZS_Error("SingleSpawnLimitPlayerMultiplier" @ "(" $ default.SingleSpawnLimitPlayerMultiplier $ ")" @ "must be greater than or equal 0.0");
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
class ZedSpawner extends Info
|
class ZedSpawner extends Info
|
||||||
config(ZedSpawner);
|
config(ZedSpawner);
|
||||||
|
|
||||||
const LatestVersion = 1;
|
const LatestVersion = 2;
|
||||||
|
|
||||||
const dt = 1;
|
|
||||||
|
|
||||||
const CfgSpawn = class'Spawn';
|
const CfgSpawn = class'Spawn';
|
||||||
const CfgSpawnListRW = class'SpawnListRegular';
|
const CfgSpawnListRW = class'SpawnListRegular';
|
||||||
@ -34,9 +32,9 @@ struct S_SpawnEntry
|
|||||||
var float RelativeStartDefault;
|
var float RelativeStartDefault;
|
||||||
var float RelativeStart;
|
var float RelativeStart;
|
||||||
var int DelayDefault;
|
var int DelayDefault;
|
||||||
var int Delay;
|
var float Delay;
|
||||||
var int SpawnsLeft;
|
var int PawnsLeft;
|
||||||
var int SpawnsTotal;
|
var int PawnsTotal;
|
||||||
var bool SpawnAtPlayerStart;
|
var bool SpawnAtPlayerStart;
|
||||||
var bool ForceSpawn;
|
var bool ForceSpawn;
|
||||||
var String ZedNameFiller;
|
var String ZedNameFiller;
|
||||||
@ -44,6 +42,9 @@ struct S_SpawnEntry
|
|||||||
|
|
||||||
var private config int Version;
|
var private config int Version;
|
||||||
var private config E_LogLevel LogLevel;
|
var private config E_LogLevel LogLevel;
|
||||||
|
var private config float Tickrate;
|
||||||
|
|
||||||
|
var private float dt;
|
||||||
|
|
||||||
var private Array<S_SpawnEntry> SpawnListRW;
|
var private Array<S_SpawnEntry> SpawnListRW;
|
||||||
var private Array<S_SpawnEntry> SpawnListBW;
|
var private Array<S_SpawnEntry> SpawnListBW;
|
||||||
@ -101,6 +102,7 @@ private function InitConfig()
|
|||||||
{
|
{
|
||||||
if (Version == `NO_CONFIG)
|
if (Version == `NO_CONFIG)
|
||||||
{
|
{
|
||||||
|
Tickrate = 1.0f;
|
||||||
LogLevel = LL_Info;
|
LogLevel = LL_Info;
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
}
|
}
|
||||||
@ -114,6 +116,9 @@ private function InitConfig()
|
|||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
`ZS_Info("Config created");
|
`ZS_Info("Config created");
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
Tickrate = 1.0f;
|
||||||
|
|
||||||
case MaxInt:
|
case MaxInt:
|
||||||
`ZS_Info("Config updated to version"@LatestVersion);
|
`ZS_Info("Config updated to version"@LatestVersion);
|
||||||
@ -164,12 +169,20 @@ private function Init()
|
|||||||
}
|
}
|
||||||
`ZS_Log("LogLevel:" @ LogLevel);
|
`ZS_Log("LogLevel:" @ LogLevel);
|
||||||
|
|
||||||
if (!CfgSpawn.static.Load(LogLevel))
|
if (Tickrate <= 0)
|
||||||
|
{
|
||||||
|
`ZS_Error("Spawner tickrate must be positive (current value:" @ Tickrate $ ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CfgSpawn.static.Load(LogLevel) || Tickrate <= 0)
|
||||||
{
|
{
|
||||||
`ZS_Fatal("Wrong settings, Destroy...");
|
`ZS_Fatal("Wrong settings, Destroy...");
|
||||||
Destroy();
|
Destroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dt = 1 / Tickrate;
|
||||||
|
`ZS_Info("Spawner tickrate:" @ Tickrate @ "(update every" @ dt $ "s)");
|
||||||
|
|
||||||
SpawnListRW = CfgSpawnListRW.static.Load(LogLevel);
|
SpawnListRW = CfgSpawnListRW.static.Load(LogLevel);
|
||||||
SpawnListBW = CfgSpawnListBW.static.Load(LogLevel);
|
SpawnListBW = CfgSpawnListBW.static.Load(LogLevel);
|
||||||
@ -193,7 +206,7 @@ private function Init()
|
|||||||
|
|
||||||
PreloadContent();
|
PreloadContent();
|
||||||
|
|
||||||
SetTimer(float(dt), true, nameof(SpawnTimer));
|
SetTimer(dt, true, nameof(SpawnTimer));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function PreloadContent()
|
private function PreloadContent()
|
||||||
@ -281,13 +294,13 @@ private function SpawnTimer()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SE.Delay > 0)
|
if (SE.Delay > 0.0f)
|
||||||
{
|
{
|
||||||
SpawnListCurrent[Index].Delay -= dt;
|
SpawnListCurrent[Index].Delay -= dt;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SE.SpawnsLeft > 0)
|
if (SE.PawnsLeft > 0)
|
||||||
{
|
{
|
||||||
SpawnEntry(SpawnListCurrent, Index);
|
SpawnEntry(SpawnListCurrent, Index);
|
||||||
}
|
}
|
||||||
@ -403,8 +416,9 @@ private function AdjustSpawnList(out Array<S_SpawnEntry> List)
|
|||||||
local S_SpawnEntry SE;
|
local S_SpawnEntry SE;
|
||||||
local int Index;
|
local int Index;
|
||||||
local float Cycle, Players;
|
local float Cycle, Players;
|
||||||
local float MSB, MSC, MSP;
|
local float B, TM, TCM, TPM;
|
||||||
local float MLB, MLC, MLP;
|
local float L, LM, LCM, LPM;
|
||||||
|
local float PawnTotalF, PawnLimitF;
|
||||||
local int ZedNameMaxLength;
|
local int ZedNameMaxLength;
|
||||||
|
|
||||||
`ZS_Trace(`Location);
|
`ZS_Trace(`Location);
|
||||||
@ -412,13 +426,16 @@ private function AdjustSpawnList(out Array<S_SpawnEntry> List)
|
|||||||
Cycle = float(CurrentCycle);
|
Cycle = float(CurrentCycle);
|
||||||
Players = float(PlayerCount());
|
Players = float(PlayerCount());
|
||||||
|
|
||||||
MSB = CfgSpawn.default.ZedTotalMultiplier;
|
B = float(SE.SpawnCountBase);
|
||||||
MSC = CfgSpawn.default.SpawnTotalCycleMultiplier;
|
L = float(SE.SingleSpawnLimitDefault);
|
||||||
MSP = CfgSpawn.default.SpawnTotalPlayerMultiplier;
|
|
||||||
|
TM = CfgSpawn.default.ZedTotalMultiplier;
|
||||||
|
TCM = CfgSpawn.default.SpawnTotalCycleMultiplier;
|
||||||
|
TPM = CfgSpawn.default.SpawnTotalPlayerMultiplier;
|
||||||
|
|
||||||
MLB = CfgSpawn.default.SingleSpawnLimitMultiplier;
|
LM = CfgSpawn.default.SingleSpawnLimitMultiplier;
|
||||||
MLC = CfgSpawn.default.SingleSpawnLimitCycleMultiplier;
|
LCM = CfgSpawn.default.SingleSpawnLimitCycleMultiplier;
|
||||||
MLP = CfgSpawn.default.SingleSpawnLimitPlayerMultiplier;
|
LPM = CfgSpawn.default.SingleSpawnLimitPlayerMultiplier;
|
||||||
|
|
||||||
ZedNameMaxLength = 0;
|
ZedNameMaxLength = 0;
|
||||||
foreach List(SE, Index)
|
foreach List(SE, Index)
|
||||||
@ -427,21 +444,24 @@ private function AdjustSpawnList(out Array<S_SpawnEntry> List)
|
|||||||
if (KFGIS.MyKFGRI.IsBossWave())
|
if (KFGIS.MyKFGRI.IsBossWave())
|
||||||
{
|
{
|
||||||
List[Index].RelativeStart = 0.f;
|
List[Index].RelativeStart = 0.f;
|
||||||
List[Index].Delay = SE.DelayDefault;
|
List[Index].Delay = float(SE.DelayDefault);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List[Index].RelativeStart = SE.RelativeStartDefault;
|
List[Index].RelativeStart = SE.RelativeStartDefault;
|
||||||
if (List[Index].RelativeStart == 0.f)
|
if (List[Index].RelativeStart == 0.f)
|
||||||
List[Index].Delay = SE.DelayDefault;
|
List[Index].Delay = float(SE.DelayDefault);
|
||||||
else
|
else
|
||||||
List[Index].Delay = 0;
|
List[Index].Delay = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
List[Index].ForceSpawn = false;
|
PawnTotalF = B * (TM + TCM * (Cycle - 1.0f) + TPM * (Players - 1.0f));
|
||||||
List[Index].SpawnsTotal = Round(SE.SpawnCountBase * (MSB + MSC * (Cycle - 1.0f) + MSP * (Players - 1.0f)));
|
PawnLimitF = L * (LM + LCM * (Cycle - 1.0f) + LPM * (Players - 1.0f));
|
||||||
List[Index].SingleSpawnLimit = Round(SE.SingleSpawnLimitDefault * (MLB + MLC * (Cycle - 1.0f) + MLP * (Players - 1.0f)));
|
|
||||||
List[Index].SpawnsLeft = List[Index].SpawnsTotal;
|
List[Index].ForceSpawn = false;
|
||||||
|
List[Index].PawnsTotal = Max(Round(PawnTotalF), 1);
|
||||||
|
List[Index].SingleSpawnLimit = Max(Round(PawnLimitF), 1);
|
||||||
|
List[Index].PawnsLeft = List[Index].PawnsTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach List(SE, Index)
|
foreach List(SE, Index)
|
||||||
@ -476,23 +496,23 @@ private function SpawnTimerLogger(bool Stop, optional String Comment)
|
|||||||
private function SpawnEntry(out Array<S_SpawnEntry> SpawnList, int Index)
|
private function SpawnEntry(out Array<S_SpawnEntry> SpawnList, int Index)
|
||||||
{
|
{
|
||||||
local S_SpawnEntry SE;
|
local S_SpawnEntry SE;
|
||||||
local int FreeSpawnSlots, SpawnCount, Spawned;
|
local int FreeSpawnSlots, PawnCount, Spawned;
|
||||||
local String Action, Comment, NextSpawn;
|
local String Action, Comment, NextSpawn;
|
||||||
|
|
||||||
`ZS_Trace(`Location);
|
`ZS_Trace(`Location);
|
||||||
|
|
||||||
SE = SpawnList[Index];
|
SE = SpawnList[Index];
|
||||||
|
|
||||||
SpawnList[Index].Delay = SE.DelayDefault;
|
SpawnList[Index].Delay = float(SE.DelayDefault);
|
||||||
if (FRand() <= SE.Probability || SE.ForceSpawn)
|
if (FRand() <= SE.Probability || SE.ForceSpawn)
|
||||||
{
|
{
|
||||||
if (SE.SingleSpawnLimit == 0 || SE.SpawnsLeft < SE.SingleSpawnLimit)
|
if (SE.SingleSpawnLimit == 0 || SE.PawnsLeft < SE.SingleSpawnLimit)
|
||||||
{
|
{
|
||||||
SpawnCount = SE.SpawnsLeft;
|
PawnCount = SE.PawnsLeft;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SpawnCount = SE.SingleSpawnLimit;
|
PawnCount = SE.SingleSpawnLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CfgSpawn.default.bShadowSpawn && !KFGIS.MyKFGRI.IsBossWave())
|
if (CfgSpawn.default.bShadowSpawn && !KFGIS.MyKFGRI.IsBossWave())
|
||||||
@ -501,22 +521,22 @@ private function SpawnEntry(out Array<S_SpawnEntry> SpawnList, int Index)
|
|||||||
if (FreeSpawnSlots == 0)
|
if (FreeSpawnSlots == 0)
|
||||||
{
|
{
|
||||||
NoFreeSpawnSlots = true;
|
NoFreeSpawnSlots = true;
|
||||||
SpawnList[Index].SpawnsLeft = 0;
|
SpawnList[Index].PawnsLeft = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (SpawnCount > FreeSpawnSlots)
|
else if (PawnCount > FreeSpawnSlots)
|
||||||
{
|
{
|
||||||
SpawnCount = FreeSpawnSlots;
|
PawnCount = FreeSpawnSlots;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spawned = SpawnZed(SE.ZedClass, SpawnCount, SE.SpawnAtPlayerStart);
|
Spawned = SpawnZed(SE.ZedClass, PawnCount, SE.SpawnAtPlayerStart);
|
||||||
if (Spawned == INDEX_NONE)
|
if (Spawned == INDEX_NONE)
|
||||||
{
|
{
|
||||||
SpawnList[Index].Delay = 5;
|
SpawnList[Index].Delay = 5.0f;
|
||||||
SpawnList[Index].ForceSpawn = true;
|
SpawnList[Index].ForceSpawn = true;
|
||||||
Action = "Skip spawn";
|
Action = "Skip spawn";
|
||||||
Comment = "no free spawn volume, try to spawn it again in" @ SpawnList[Index].Delay @ "seconds...";
|
Comment = "no free spawn volume, try to spawn it again in" @ Round(SpawnList[Index].Delay) @ "seconds...";
|
||||||
SpawnLog(SE, Action, Comment);
|
SpawnLog(SE, Action, Comment);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -538,10 +558,10 @@ private function SpawnEntry(out Array<S_SpawnEntry> SpawnList, int Index)
|
|||||||
Spawned = SE.SingleSpawnLimit;
|
Spawned = SE.SingleSpawnLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpawnList[Index].SpawnsLeft -= Spawned;
|
SpawnList[Index].PawnsLeft -= Spawned;
|
||||||
if (SpawnList[Index].SpawnsLeft > 0)
|
if (SpawnList[Index].PawnsLeft > 0)
|
||||||
{
|
{
|
||||||
NextSpawn = "next after" @ SE.DelayDefault $ "sec," @ "pawns left:" @ SpawnList[Index].SpawnsLeft;
|
NextSpawn = "next after" @ SE.DelayDefault $ "sec," @ "pawns left:" @ SpawnList[Index].PawnsLeft;
|
||||||
}
|
}
|
||||||
SpawnLog(SE, Action, Comment, NextSpawn);
|
SpawnLog(SE, Action, Comment, NextSpawn);
|
||||||
}
|
}
|
||||||
@ -593,7 +613,7 @@ private function Vector PlayerStartLocation()
|
|||||||
return KFGIS.FindPlayerStart(None, 0).Location;
|
return KFGIS.FindPlayerStart(None, 0).Location;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function int SpawnZed(class<KFPawn_Monster> ZedClass, int SpawnCount, bool SpawnAtPlayerStart)
|
private function int SpawnZed(class<KFPawn_Monster> ZedClass, int PawnCount, bool SpawnAtPlayerStart)
|
||||||
{
|
{
|
||||||
local Array<class<KFPawn_Monster> > CustomSquad;
|
local Array<class<KFPawn_Monster> > CustomSquad;
|
||||||
local Vector SpawnLocation, PlayerStart;
|
local Vector SpawnLocation, PlayerStart;
|
||||||
@ -614,7 +634,7 @@ private function int SpawnZed(class<KFPawn_Monster> ZedClass, int SpawnCount, bo
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (Index = 0; Index < SpawnCount; Index++)
|
for (Index = 0; Index < PawnCount; Index++)
|
||||||
{
|
{
|
||||||
CustomSquad.AddItem(ZedClass);
|
CustomSquad.AddItem(ZedClass);
|
||||||
}
|
}
|
||||||
@ -635,7 +655,7 @@ private function int SpawnZed(class<KFPawn_Monster> ZedClass, int SpawnCount, bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
Spawned = 0; Failed = 0;
|
Spawned = 0; Failed = 0;
|
||||||
while (Failed + Spawned < SpawnCount)
|
while (Failed + Spawned < PawnCount)
|
||||||
{
|
{
|
||||||
KFPM = Spawn(ZedClass,,, SpawnLocation, rot(0,0,1),, true);
|
KFPM = Spawn(ZedClass,,, SpawnLocation, rot(0,0,1),, true);
|
||||||
if (KFPM == None)
|
if (KFPM == None)
|
||||||
|
2
tools
2
tools
Submodule tools updated: 49fcaf67a2...02222cf453
Reference in New Issue
Block a user