Compare commits
No commits in common. "master" and "v1.3.0" have entirely different histories.
@ -1,33 +0,0 @@
|
||||
root = true
|
||||
|
||||
# Global
|
||||
[*]
|
||||
indent_style = unset
|
||||
indent_size = 4
|
||||
tab_width = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = unset
|
||||
|
||||
# Unreal Engine 3 / Source
|
||||
[*.uc]
|
||||
indent_style = tab
|
||||
|
||||
[*.{uci,upkg}]
|
||||
|
||||
# Unreal Engine 3 / i18n
|
||||
[*.{chn,cht,cze,dan,deu,dut,esl,esn,fra,frc,hun,int,ita,jpn,kor,pol,por,ptb,rus,tur,ukr}]
|
||||
charset = utf-16le
|
||||
|
||||
# Other
|
||||
[*.md]
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{txt,cfg,conf}]
|
||||
indent_style = tab
|
114
.github/workflows/mega-linter.yml
vendored
114
.github/workflows/mega-linter.yml
vendored
@ -1,114 +0,0 @@
|
||||
---
|
||||
name: MegaLinter
|
||||
|
||||
permissions: read-all
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
APPLY_FIXES: none
|
||||
APPLY_FIXES_EVENT: pull_request
|
||||
APPLY_FIXES_MODE: commit
|
||||
FILTER_REGEX_EXCLUDE: (mega-linter.yml)
|
||||
DISABLE: SPELL
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
megalinter:
|
||||
name: MegaLinter
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||
with:
|
||||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: MegaLinter
|
||||
uses: oxsecurity/megalinter@7e042c726c68415475b05a65a686c612120a1232
|
||||
id: ml
|
||||
env:
|
||||
VALIDATE_ALL_CODEBASE: true
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Archive production artifacts
|
||||
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392
|
||||
if: success() || failure()
|
||||
with:
|
||||
name: MegaLinter reports
|
||||
path: |
|
||||
megalinter-reports
|
||||
mega-linter.log
|
||||
|
||||
- name: Set APPLY_FIXES_IF var
|
||||
run: |
|
||||
printf 'APPLY_FIXES_IF=%s\n' "${{
|
||||
steps.ml.outputs.has_updated_sources == 1 &&
|
||||
(
|
||||
env.APPLY_FIXES_EVENT == 'all' ||
|
||||
env.APPLY_FIXES_EVENT == github.event_name
|
||||
) &&
|
||||
(
|
||||
github.event_name == 'push' ||
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
)
|
||||
}}" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Set APPLY_FIXES_IF_* vars
|
||||
run: |
|
||||
printf 'APPLY_FIXES_IF_PR=%s\n' "${{
|
||||
env.APPLY_FIXES_IF == 'true' &&
|
||||
env.APPLY_FIXES_MODE == 'pull_request'
|
||||
}}" >> "${GITHUB_ENV}"
|
||||
printf 'APPLY_FIXES_IF_COMMIT=%s\n' "${{
|
||||
env.APPLY_FIXES_IF == 'true' &&
|
||||
env.APPLY_FIXES_MODE == 'commit' &&
|
||||
(!contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref))
|
||||
}}" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Create Pull Request with applied fixes
|
||||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
|
||||
id: cpr
|
||||
if: env.APPLY_FIXES_IF_PR == 'true'
|
||||
with:
|
||||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
|
||||
commit-message: "[MegaLinter] Apply linters automatic fixes"
|
||||
title: "[MegaLinter] Apply linters automatic fixes"
|
||||
labels: bot
|
||||
|
||||
- name: Create PR output
|
||||
if: env.APPLY_FIXES_IF_PR == 'true'
|
||||
run: |
|
||||
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||
|
||||
- name: Prepare commit
|
||||
if: env.APPLY_FIXES_IF_COMMIT == 'true'
|
||||
run: sudo chown -Rc $UID .git/
|
||||
|
||||
- name: Commit and push applied linter fixes
|
||||
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d
|
||||
if: env.APPLY_FIXES_IF_COMMIT == 'true'
|
||||
with:
|
||||
branch: >-
|
||||
${{
|
||||
github.event.pull_request.head.ref ||
|
||||
github.head_ref ||
|
||||
github.ref
|
||||
}}
|
||||
commit_message: "[MegaLinter] Apply linters fixes"
|
||||
commit_user_name: "github-actions"
|
||||
commit_user_email: "github-actions[bot]@users.noreply.github.com"
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
*.psd
|
||||
/ignore
|
@ -1,76 +1,53 @@
|
||||
[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]
|
||||
[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]
|
||||
|
||||
[h1]📋 Description[/h1]
|
||||
Spawner for zeds.
|
||||
[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
|
||||
|
||||
This mutator uses the same method of spawning zeds by timer as in [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2488241348]Custom Zed Spawn Mutator[/url]. But the implementation is completely new.
|
||||
[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]✨ Features[/h1]
|
||||
[list]
|
||||
[*]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
|
||||
[/list]
|
||||
[h1]Whitelisted?[/h1]
|
||||
No. This mod is not whitelisted and will de-rank your server. Any XP gained will not be saved.
|
||||
|
||||
[h1]❌ Whitelisted?[/h1]
|
||||
No. This mod is not whitelisted and will de-rank your server. Any XP earned will not be saved.
|
||||
|
||||
[h1]🎮 Usage (single player)[/h1]
|
||||
[h1]Usage (single player)[/h1]
|
||||
[olist]
|
||||
[*]Subscribe to this mutator.
|
||||
[*]Create a file:
|
||||
[code]C:\Users\<username>\Documents\My Games\KillingFloor2\KFGame\Config\KFZedSpawner.ini[/code]
|
||||
with content:
|
||||
[code][ZedSpawner.ZedSpawner]
|
||||
Version=0[/code]
|
||||
[*]Launch KF2.
|
||||
[*]Open console (~) and start any map with the mutator (this will generate the default KFZedSpawner.ini content):
|
||||
[code]open KF-BioticsLab?Mutator=ZedSpawner.Mut[/code]
|
||||
[*]Close the game and configure the mutator (see [b]⚙️ Setup (KFZedSpawner.ini)[/b] below).
|
||||
[*]Launch KF2 again, open the console, and start the game:
|
||||
[code]open KF-BioticsLab?Game=KFGameContent.KFGameInfo_Endless?Difficulty=3?GameLength=2?Mutator=ZedSpawner.Mut[/code]
|
||||
(replace the map and set/add parameters you need).
|
||||
[*]Subscribe to this mutator;
|
||||
[*]Start KF2;
|
||||
[*]Open console (`) and input:
|
||||
[b]open KF-BioticsLab?Mutator=ZedSpawner.ZedSpawnerMut[/b]
|
||||
(replace the map and add the parameters you need)
|
||||
[*]<Enter>.
|
||||
[/olist]
|
||||
|
||||
[h1]🖥️ Usage (server)[/h1]
|
||||
[b]Note:[/b] [i]If this is unclear, first read: [url=https://wiki.killingfloor2.com/index.php?title=Dedicated_Server_(Killing_Floor_2)][u]Dedicated Server Guide (KF2 wiki)[/u][/url][/i]
|
||||
[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]
|
||||
[olist]
|
||||
[*]Open [b]PCServer-KFEngine.ini[/b] / [b]LinuxServer-KFEngine.ini[/b].
|
||||
[*]Find [b][IpDrv.TcpNetDriver][/b] section and ensure line exists (add if missing):
|
||||
[code]DownloadManagers=OnlineSubsystemSteamworks.SteamWorkshopDownload[/code]
|
||||
(If there are several [b]DownloadManagers[/b] then the line above should be the first)
|
||||
[*]Open your [b]PCServer-KFEngine.ini[/b] / [b]LinuxServer-KFEngine.ini[/b];
|
||||
[*]Find the [b][IpDrv.TcpNetDriver][/b] section and make sure that there is a line (add if not):
|
||||
[b]DownloadManagers=OnlineSubsystemSteamworks.SteamWorkshopDownload[/b]
|
||||
❗️ If there are several [b]DownloadManagers=[/b] then the line above should be the first ❗️
|
||||
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
|
||||
[code]ServerSubscribedWorkshopItems=2811290931[/code]
|
||||
[*]Start server and wait for mutator download.
|
||||
[*]When the download is complete, stop the server.
|
||||
[*]Create a file:
|
||||
[code]<kf2-server>\KFGame\Config\KFZedSpawner.ini[/code]
|
||||
with content:
|
||||
[code][ZedSpawner.ZedSpawner]
|
||||
Version=0[/code]
|
||||
[*]Add mutator to server start parameters: [code]?Mutator=ZedSpawner.Mut[/code] and start the server (this will generate the default KFZedSpawner.ini content).
|
||||
[*]Stop the server and configure the mutator (see [b]⚙️ Setup (KFZedSpawner.ini)[/b] below).
|
||||
[*]Start the server.
|
||||
[b]ServerSubscribedWorkshopItems=2811290931[/b]
|
||||
[*]Start the server and wait while the mutator is downloading;
|
||||
[*]Add mutator to server start parameters: [b]?Mutator=ZedSpawner.ZedSpawnerMut[/b] and restart the server.
|
||||
[/olist]
|
||||
|
||||
[h1]⚙️ Setup (KFZedSpawner.ini)[/h1]
|
||||
[b]bPreloadContentServer[/b] - Enable/Disable server-side preload content.
|
||||
[b]bPreloadContentClient[/b] - Enable/Disable client-side preload content.
|
||||
[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 (😁) use a cyclic spawn. Set parameter [b]bCyclicalSpawn=True[/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.
|
||||
Use the [b]SpawnTotalCycleMultiplier[/b] and [b]SingleSpawnLimitCycleMultiplier[/b] modifiers to adjust the difficulty of the following cycles.
|
||||
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]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.
|
||||
|
||||
@ -80,7 +57,7 @@ Use the [b][ZedSpawner.SpawnListBossWaves][/b] and [b][ZedSpawner.SpawnListSpeci
|
||||
|
||||
[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]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.
|
||||
@ -89,29 +66,11 @@ Use the [b][ZedSpawner.SpawnListBossWaves][/b] and [b][ZedSpawner.SpawnListSpeci
|
||||
[*][b]SingleSpawnLimit[/b] - maximum number of zeds for one spawn. Can be adjusted by modifiers, number of players and cycle number.
|
||||
[/list]
|
||||
|
||||
[h1]🔬 Spawn logic[/h1]
|
||||
[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.
|
||||
|
||||
[b]Link (remove spaces):[/b]
|
||||
[code]htt ps://docs .google .com/spreadsheets/d/1q67WJ36jhj6Y0lPNO5tS2bU79Wphu4Xmi62me6DAwtM/edit?usp=drive_link[/code]
|
||||
[list]
|
||||
[*]Please try not to interfere with each other if you see that someone is already using a calculator.
|
||||
[*]If some villain broke the calculator - let me know in the comments, I'll roll it back to its previous state.
|
||||
[/list]
|
||||
[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]
|
||||
[list]
|
||||
[*]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).
|
||||
[*]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.
|
||||
[/list]
|
||||
|
||||
[h1]🌍 Credits[/h1]
|
||||
[list][*][url=https://steamcommunity.com/profiles/76561198071961495]Windows11[/url] - Custom Zed Spawn Mutator.[*]The cat on the cover is Meawbin (original character by [url=https://x.com/horrormove]Cotton Valent[/url]).[/list]
|
||||
|
||||
[h1]☑️ Status: Completed[/h1]
|
||||
✔️ The mutator works with the current version of the game (v1150) and I have implemented everything I planned.
|
||||
⛔️ Development has stopped: I no longer have the time or motivation to maintain this mod. No further updates or bug fixes are planned.
|
||||
|
||||
[h1]📜 Sources[/h1]
|
||||
https://github.com/GenZmeY/KF2-ZedSpawner [b](GNU GPLv3)[/b]
|
||||
[h1]Sources[/h1]
|
||||
[url=https://github.com/GenZmeY/KF2-ZedSpawner]https://github.com/GenZmeY/KF2-ZedSpawner[/url] (GNU GPLv3)
|
@ -1 +1 @@
|
||||
Zed Spawner
|
||||
ZedSpawner
|
||||
|
27
README.md
27
README.md
@ -1,29 +1,29 @@
|
||||
# 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/actions/workflows/mega-linter.yml)
|
||||
[](https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931)
|
||||
[](https://github.com/GenZmeY/KF2-ZedSpawner/tags)
|
||||
[](LICENSE)
|
||||
|
||||
## Description
|
||||
# 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
|
||||
# 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
|
||||
# Usage & Setup
|
||||
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2811290931)
|
||||
|
||||
## Spawn calculator
|
||||
# Spawn calculator
|
||||
[Spawn Calculator](https://docs.google.com/spreadsheets/d/1q67WJ36jhj6Y0lPNO5tS2bU79Wphu4Xmi62me6DAwtM/edit?usp=sharing)
|
||||
|
||||
## Build
|
||||
# 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:
|
||||
@ -37,10 +37,17 @@ Spawner for zeds. Started as a modification of the [this version](https://steamc
|
||||
5. The compiled files will be here:
|
||||
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
|
||||
|
||||
## Bug reports
|
||||
# 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
|
||||
[](LICENSE)
|
||||
# License
|
||||
[GNU GPLv3](LICENSE)
|
||||
|
@ -1,46 +1,40 @@
|
||||
class KFGI_Access extends Object
|
||||
within KFGameInfo;
|
||||
|
||||
public function Array<class<KFPawn_Monster> > GetAIClassList(E_LogLevel LogLevel)
|
||||
public function Array<class<KFPawn_Monster> > GetAIClassList()
|
||||
{
|
||||
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(E_LogLevel LogLevel)
|
||||
public function Array<class<KFPawn_Monster> > GetNonSpawnAIClassList()
|
||||
{
|
||||
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(E_LogLevel LogLevel)
|
||||
public function Array<class<KFPawn_Monster> > GetAIBossClassList()
|
||||
{
|
||||
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, E_LogLevel LogLevel)
|
||||
public function bool IsCustomZed(class<KFPawn_Monster> KFPM)
|
||||
{
|
||||
if (AIClassList.Find(KFPM) != INDEX_NONE) return false;
|
||||
if (NonSpawnAIClassList.Find(KFPM) != INDEX_NONE) return false;
|
||||
@ -48,12 +42,10 @@ public function bool IsCustomZed(class<KFPawn_Monster> KFPM, E_LogLevel LogLevel
|
||||
return true;
|
||||
}
|
||||
|
||||
public function bool IsOriginalAI(class<KFPawn_Monster> KFPM, optional out EAIType AIType, optional E_LogLevel LogLevel = LL_None)
|
||||
public function bool IsOriginalAI(class<KFPawn_Monster> KFPM, optional out EAIType AIType)
|
||||
{
|
||||
local int Type;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
Type = AIClassList.Find(KFPM);
|
||||
if (Type != INDEX_NONE)
|
||||
{
|
||||
@ -64,12 +56,10 @@ 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, optional E_LogLevel LogLevel = LL_None)
|
||||
public function bool IsOriginalAIBoss(class<KFPawn_Monster> KFPM, optional out EBossAIType AIType)
|
||||
{
|
||||
local int Type;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
Type = AIBossClassList.Find(KFPM);
|
||||
if (Type != INDEX_NONE)
|
||||
{
|
||||
@ -80,20 +70,16 @@ public function bool IsOriginalAIBoss(class<KFPawn_Monster> KFPM, optional out E
|
||||
return false;
|
||||
}
|
||||
|
||||
public function class<KFPawn_Monster> AITypePawn(EAIType AIType, E_LogLevel LogLevel)
|
||||
public function class<KFPawn_Monster> AITypePawn(EAIType AIType)
|
||||
{
|
||||
`Log_Trace();
|
||||
|
||||
if (AIType < AIClassList.Length)
|
||||
return AIClassList[AIType];
|
||||
else
|
||||
return None;
|
||||
}
|
||||
|
||||
public function class<KFPawn_Monster> BossAITypePawn(EBossAIType AIType, E_LogLevel LogLevel)
|
||||
public function class<KFPawn_Monster> BossAITypePawn(EBossAIType AIType)
|
||||
{
|
||||
`Log_Trace();
|
||||
|
||||
if (AIType < AIBossClassList.Length)
|
||||
return AIBossClassList[AIType];
|
||||
else
|
||||
|
@ -1,61 +0,0 @@
|
||||
class Mut extends KFMutator
|
||||
dependson(ZedSpawner);
|
||||
|
||||
var private ZedSpawner ZS;
|
||||
|
||||
public simulated function bool SafeDestroy()
|
||||
{
|
||||
return (bPendingDelete || bDeleteMe || Destroy());
|
||||
}
|
||||
|
||||
public event PreBeginPlay()
|
||||
{
|
||||
Super.PreBeginPlay();
|
||||
|
||||
if (WorldInfo.NetMode == NM_Client) return;
|
||||
|
||||
foreach WorldInfo.DynamicActors(class'ZedSpawner', ZS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (ZS == None)
|
||||
{
|
||||
ZS = WorldInfo.Spawn(class'ZedSpawner');
|
||||
}
|
||||
|
||||
if (ZS == None)
|
||||
{
|
||||
`Log_Base("FATAL: Can't Spawn 'ZedSpawner'");
|
||||
SafeDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
public function AddMutator(Mutator M)
|
||||
{
|
||||
if (M == Self) return;
|
||||
|
||||
if (M.Class == Class)
|
||||
Mut(M).SafeDestroy();
|
||||
else
|
||||
Super.AddMutator(M);
|
||||
}
|
||||
|
||||
public function NotifyLogin(Controller C)
|
||||
{
|
||||
ZS.NotifyLogin(C);
|
||||
|
||||
Super.NotifyLogin(C);
|
||||
}
|
||||
|
||||
public function NotifyLogout(Controller C)
|
||||
{
|
||||
ZS.NotifyLogout(C);
|
||||
|
||||
Super.NotifyLogout(C);
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
||||
}
|
@ -13,14 +13,12 @@ var public config float SingleSpawnLimitCycleMultiplier;
|
||||
var public config int AliveSpawnLimit;
|
||||
var public config bool bSmoothSpawn;
|
||||
|
||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||
public static function InitConfig(int Version, int LatestVersion)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
ApplyDefault(LogLevel);
|
||||
ApplyDefault();
|
||||
|
||||
case 3:
|
||||
default.bSmoothSpawn = false;
|
||||
@ -34,10 +32,8 @@ public static function InitConfig(int Version, int LatestVersion, E_LogLevel Log
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault(E_LogLevel LogLevel)
|
||||
private static function ApplyDefault()
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
default.bCyclicalSpawn = true;
|
||||
default.bShadowSpawn = true;
|
||||
default.bSmoothSpawn = true;
|
||||
@ -54,8 +50,6 @@ 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,15 +5,13 @@ class SpawnAtPlayerStart extends Object
|
||||
var private config Array<String> ZedClass;
|
||||
var public config Array<String> Map;
|
||||
|
||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||
public static function InitConfig(int Version, int LatestVersion)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
case 2:
|
||||
ApplyDefault(LogLevel);
|
||||
ApplyDefault();
|
||||
|
||||
default: break;
|
||||
}
|
||||
@ -24,10 +22,8 @@ public static function InitConfig(int Version, int LatestVersion, E_LogLevel Log
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault(E_LogLevel LogLevel)
|
||||
private static function ApplyDefault()
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
default.ZedClass.Length = 0;
|
||||
default.ZedClass.AddItem("HL2Monsters.Combine_Strider");
|
||||
default.ZedClass.AddItem("HL2Monsters.Combine_Gunship");
|
||||
@ -45,8 +41,6 @@ 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,14 +15,12 @@ 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, E_LogLevel LogLevel)
|
||||
public static function InitConfig(int Version, int LatestVersion, KFGI_Access KFGIA)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
ApplyDefault(KFGIA, LogLevel);
|
||||
ApplyDefault(KFGIA);
|
||||
|
||||
default: break;
|
||||
}
|
||||
@ -33,14 +31,12 @@ public static function InitConfig(int Version, int LatestVersion, KFGI_Access KF
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault(KFGI_Access KFGIA, E_LogLevel LogLevel)
|
||||
private static function ApplyDefault(KFGI_Access KFGIA)
|
||||
{
|
||||
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;
|
||||
@ -50,7 +46,7 @@ private static function ApplyDefault(KFGI_Access KFGIA, E_LogLevel LogLevel)
|
||||
SpawnEntry.SingleSpawnLimit = 1;
|
||||
SpawnEntry.Delay = 30;
|
||||
SpawnEntry.Probability = 100;
|
||||
KFPM_Bosses = KFGIA.GetAIBossClassList(LogLevel);
|
||||
KFPM_Bosses = KFGIA.GetAIBossClassList();
|
||||
foreach KFPM_Bosses(KFPMC)
|
||||
{
|
||||
SpawnEntry.BossClass = "KFGameContent." $ String(KFPMC);
|
||||
@ -66,8 +62,6 @@ 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,14 +20,12 @@ 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, E_LogLevel LogLevel)
|
||||
public static function InitConfig(int Version, int LatestVersion, KFGI_Access KFGIA)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
ApplyDefault(KFGIA, LogLevel);
|
||||
ApplyDefault(KFGIA);
|
||||
|
||||
default: break;
|
||||
}
|
||||
@ -38,14 +36,12 @@ public static function InitConfig(int Version, int LatestVersion, KFGI_Access KF
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault(KFGI_Access KFGIA, E_LogLevel LogLevel)
|
||||
private static function ApplyDefault(KFGI_Access KFGIA)
|
||||
{
|
||||
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;
|
||||
@ -55,7 +51,7 @@ private static function ApplyDefault(KFGI_Access KFGIA, E_LogLevel LogLevel)
|
||||
SpawnEntry.Delay = 60;
|
||||
SpawnEntry.Probability = 100;
|
||||
|
||||
KFPM_Zeds = KFGIA.GetAIClassList(LogLevel);
|
||||
KFPM_Zeds = KFGIA.GetAIClassList();
|
||||
foreach KFPM_Zeds(KFPMC)
|
||||
{
|
||||
++SpawnEntry.Wave;
|
||||
@ -72,8 +68,6 @@ 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,14 +16,12 @@ struct S_SpawnEntryCfg
|
||||
var public config bool bStopRegularSpawn;
|
||||
var private config Array<S_SpawnEntryCfg> Spawn;
|
||||
|
||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||
public static function InitConfig(int Version, int LatestVersion)
|
||||
{
|
||||
`Log_TraceStatic();
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
case `NO_CONFIG:
|
||||
ApplyDefault(LogLevel);
|
||||
ApplyDefault();
|
||||
|
||||
default: break;
|
||||
}
|
||||
@ -34,13 +32,11 @@ public static function InitConfig(int Version, int LatestVersion, E_LogLevel Log
|
||||
}
|
||||
}
|
||||
|
||||
private static function ApplyDefault(E_LogLevel LogLevel)
|
||||
private static function ApplyDefault()
|
||||
{
|
||||
local S_SpawnEntryCfg SpawnEntry;
|
||||
local EAIType AIType;
|
||||
|
||||
`Log_TraceStatic();
|
||||
|
||||
default.bStopRegularSpawn = true;
|
||||
default.Spawn.Length = 0;
|
||||
SpawnEntry.ZedClass = "SomePackage.SomeClass";
|
||||
@ -64,8 +60,6 @@ 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");
|
||||
|
@ -1,7 +1,7 @@
|
||||
class ZedSpawner extends Info
|
||||
config(ZedSpawner);
|
||||
|
||||
const LatestVersion = 5;
|
||||
const LatestVersion = 4;
|
||||
|
||||
const CfgSpawn = class'Spawn';
|
||||
const CfgSpawnAtPlayerStart = class'SpawnAtPlayerStart';
|
||||
@ -32,8 +32,6 @@ struct S_SpawnEntry
|
||||
var private config int Version;
|
||||
var private config E_LogLevel LogLevel;
|
||||
var private config float Tickrate;
|
||||
var private config bool bPreloadContentServer;
|
||||
var private config bool bPreloadContentClient;
|
||||
|
||||
var private float dt;
|
||||
|
||||
@ -66,7 +64,7 @@ var private Array<class<KFPawn_Monster> > SpawnAtPlayerStartZeds;
|
||||
var private bool SpawnActive;
|
||||
var private String SpawnListsComment;
|
||||
|
||||
var private Array<ZedSpawnerRepInfo> RepInfos;
|
||||
var private Array<ZedSpawnerRepLink> RepLinks;
|
||||
|
||||
public simulated function bool SafeDestroy()
|
||||
{
|
||||
@ -75,7 +73,7 @@ public simulated function bool SafeDestroy()
|
||||
|
||||
public event PreBeginPlay()
|
||||
{
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (WorldInfo.NetMode == NM_Client)
|
||||
{
|
||||
@ -85,11 +83,20 @@ public event PreBeginPlay()
|
||||
}
|
||||
|
||||
Super.PreBeginPlay();
|
||||
|
||||
PreInit();
|
||||
}
|
||||
|
||||
private function PreInit()
|
||||
public event PostBeginPlay()
|
||||
{
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (bPendingDelete || bDeleteMe) return;
|
||||
|
||||
Super.PostBeginPlay();
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
private function InitConfig()
|
||||
{
|
||||
if (Version == `NO_CONFIG)
|
||||
{
|
||||
@ -97,11 +104,11 @@ private function PreInit()
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
switch (Version)
|
||||
{
|
||||
@ -113,9 +120,6 @@ private function PreInit()
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
bPreloadContentServer = true;
|
||||
bPreloadContentClient = true;
|
||||
|
||||
case MaxInt:
|
||||
`Log_Info("Config updated to version"@LatestVersion);
|
||||
@ -137,6 +141,27 @@ private function PreInit()
|
||||
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)
|
||||
{
|
||||
@ -149,6 +174,10 @@ private function PreInit()
|
||||
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;
|
||||
@ -157,55 +186,10 @@ private function PreInit()
|
||||
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);
|
||||
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);
|
||||
SpawnAtPlayerStartZeds = CfgSpawnAtPlayerStart.static.Load(LogLevel);
|
||||
|
||||
CurrentMap = String(WorldInfo.GetPackageName());
|
||||
GlobalSpawnAtPlayerStart = (CfgSpawnAtPlayerStart.default.Map.Find(CurrentMap) != INDEX_NONE);
|
||||
@ -227,17 +211,7 @@ private function PostInit()
|
||||
CycleWaveSize = CycleWaveSize - CycleWaveShift + 1;
|
||||
}
|
||||
|
||||
if (bPreloadContentServer || bPreloadContentClient)
|
||||
{
|
||||
ExtractCustomZedsFromSpawnList(SpawnListRW, CustomZeds);
|
||||
ExtractCustomZedsFromSpawnList(SpawnListBW, CustomZeds);
|
||||
ExtractCustomZedsFromSpawnList(SpawnListSW, CustomZeds);
|
||||
}
|
||||
|
||||
if (bPreloadContentServer)
|
||||
{
|
||||
PreloadContent();
|
||||
}
|
||||
|
||||
SetTimer(dt, true, nameof(SpawnTimer));
|
||||
}
|
||||
@ -246,7 +220,9 @@ private function PreloadContent()
|
||||
{
|
||||
local class<KFPawn_Monster> PawnClass;
|
||||
|
||||
`Log_Trace();
|
||||
ExtractCustomZedsFromSpawnList(SpawnListRW, CustomZeds);
|
||||
ExtractCustomZedsFromSpawnList(SpawnListBW, CustomZeds);
|
||||
ExtractCustomZedsFromSpawnList(SpawnListSW, CustomZeds);
|
||||
|
||||
foreach CustomZeds(PawnClass)
|
||||
{
|
||||
@ -255,16 +231,14 @@ private function PreloadContent()
|
||||
}
|
||||
}
|
||||
|
||||
private function ExtractCustomZedsFromSpawnList(const out Array<S_SpawnEntry> SpawnList, out Array<class<KFPawn_Monster> > Out)
|
||||
private function ExtractCustomZedsFromSpawnList(Array<S_SpawnEntry> SpawnList, out Array<class<KFPawn_Monster> > Out)
|
||||
{
|
||||
local S_SpawnEntry SE;
|
||||
|
||||
`Log_Trace();
|
||||
|
||||
foreach SpawnList(SE)
|
||||
{
|
||||
if (Out.Find(SE.ZedClass) == INDEX_NONE
|
||||
&& KFGIA.IsCustomZed(SE.ZedClass, LogLevel))
|
||||
&& KFGIA.IsCustomZed(SE.ZedClass))
|
||||
{
|
||||
Out.AddItem(SE.ZedClass);
|
||||
}
|
||||
@ -277,9 +251,9 @@ private function SpawnTimer()
|
||||
local int Index;
|
||||
local float Threshold;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (KFGIS.WaveNum != 0 && CurrentWave != KFGIS.WaveNum)
|
||||
if (KFGIS.WaveNum != 0 && CurrentWave < KFGIS.WaveNum)
|
||||
{
|
||||
SetupWave();
|
||||
}
|
||||
@ -349,7 +323,7 @@ private function SetupWave()
|
||||
local S_SpawnEntry SE;
|
||||
local EAIType SWType;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (CfgSpawn.default.bCyclicalSpawn && KFGIS.WaveNum > 1 && KFGIS.WaveNum == CycleWaveShift + CycleWaveSize * CurrentCycle)
|
||||
{
|
||||
@ -376,7 +350,7 @@ private function SetupWave()
|
||||
|
||||
if (KFGIS.MyKFGRI.IsBossWave())
|
||||
{
|
||||
CurrentBossClass = KFGIA.BossAITypePawn(EBossAIType(KFGIS.MyKFGRI.BossIndex), LogLevel);
|
||||
CurrentBossClass = KFGIA.BossAITypePawn(EBossAIType(KFGIS.MyKFGRI.BossIndex));
|
||||
if (CurrentBossClass == None)
|
||||
{
|
||||
`Log_Error("Can't determine boss class. Boss index:" @ KFGIS.MyKFGRI.BossIndex);
|
||||
@ -458,7 +432,7 @@ private function AdjustSpawnList(out Array<S_SpawnEntry> List)
|
||||
local float PawnTotalF, PawnLimitF;
|
||||
local int ZedNameMaxLength;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
Cycle = float(CurrentCycle);
|
||||
Players = float(PlayerCount());
|
||||
@ -513,7 +487,7 @@ private function SpawnTimerLogger(bool Stop, optional String Comment)
|
||||
{
|
||||
local String Message;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (Stop)
|
||||
Message = "Stop spawn";
|
||||
@ -537,7 +511,7 @@ private function SpawnEntry(out Array<S_SpawnEntry> SpawnList, int Index)
|
||||
local String Action, Comment, NextSpawn;
|
||||
local bool SpawnAtPlayerStart;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
SE = SpawnList[Index];
|
||||
|
||||
@ -654,7 +628,7 @@ private function int PlayerCount()
|
||||
local int HumanPlayers;
|
||||
local KFOnlineGameSettings KFGameSettings;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (KFGIS.PlayfabInter != None && KFGIS.PlayfabInter.GetGameSettings() != None)
|
||||
{
|
||||
@ -679,7 +653,7 @@ private function Vector PlayerStartLocation()
|
||||
{
|
||||
local PlayerController PC;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
foreach WorldInfo.AllControllers(class'PlayerController', PC)
|
||||
return KFGIS.FindPlayerStart(PC, 0).Location;
|
||||
@ -698,7 +672,7 @@ private function int SpawnZed(class<KFPawn_Monster> ZedClass, int PawnCount, opt
|
||||
local int Failed, Spawned;
|
||||
local int Index;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
PlayerStart = PlayerStartLocation();
|
||||
if (SpawnAtPlayerStart)
|
||||
@ -776,62 +750,55 @@ private function int SpawnZed(class<KFPawn_Monster> ZedClass, int PawnCount, opt
|
||||
|
||||
public function NotifyLogin(Controller C)
|
||||
{
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (!bPreloadContentClient) return;
|
||||
|
||||
if (!CreateRepInfo(C))
|
||||
{
|
||||
`Log_Error("Can't create RepInfo for:" @ C);
|
||||
}
|
||||
CreateRepLink(C);
|
||||
}
|
||||
|
||||
public function NotifyLogout(Controller C)
|
||||
{
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (!bPreloadContentClient) return;
|
||||
|
||||
DestroyRepInfo(C);
|
||||
DestroyRepLink(C);
|
||||
}
|
||||
|
||||
public function bool CreateRepInfo(Controller C)
|
||||
public function bool CreateRepLink(Controller C)
|
||||
{
|
||||
local ZedSpawnerRepInfo RepInfo;
|
||||
local ZedSpawnerRepLink RepLink;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (C == None) return false;
|
||||
|
||||
RepInfo = Spawn(class'ZedSpawnerRepInfo', C);
|
||||
RepLink = Spawn(class'ZedSpawnerRepLink', C);
|
||||
|
||||
if (RepInfo == None) return false;
|
||||
if (RepLink == None) return false;
|
||||
|
||||
RepInfo.LogLevel = LogLevel;
|
||||
RepInfo.CustomZeds = CustomZeds;
|
||||
RepInfo.ZS = Self;
|
||||
RepLink.LogLevel = LogLevel;
|
||||
RepLink.CustomZeds = CustomZeds;
|
||||
RepLink.ZS = Self;
|
||||
|
||||
RepInfos.AddItem(RepInfo);
|
||||
RepLinks.AddItem(RepLink);
|
||||
|
||||
RepInfo.ServerSync();
|
||||
RepLink.ServerSync();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function bool DestroyRepInfo(Controller C)
|
||||
public function bool DestroyRepLink(Controller C)
|
||||
{
|
||||
local ZedSpawnerRepInfo RepInfo;
|
||||
local ZedSpawnerRepLink RepLink;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (C == None) return false;
|
||||
|
||||
foreach RepInfos(RepInfo)
|
||||
foreach RepLinks(RepLink)
|
||||
{
|
||||
if (RepInfo.Owner == C)
|
||||
if (RepLink.Owner == C)
|
||||
{
|
||||
RepInfos.RemoveItem(RepInfo);
|
||||
RepInfo.SafeDestroy();
|
||||
RepLink.SafeDestroy();
|
||||
RepLinks.RemoveItem(RepLink);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -839,7 +806,7 @@ public function bool DestroyRepInfo(Controller C)
|
||||
return false;
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
DefaultProperties
|
||||
{
|
||||
|
||||
}
|
@ -1 +1,58 @@
|
||||
class ZedSpawnerMut extends Mut; // backward compatibility
|
||||
class ZedSpawnerMut extends KFMutator
|
||||
dependson(ZedSpawner);
|
||||
|
||||
var private ZedSpawner ZS;
|
||||
|
||||
public event 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...");
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
public function AddMutator(Mutator Mut)
|
||||
{
|
||||
if (Mut == Self) return;
|
||||
|
||||
if (Mut.Class == Class)
|
||||
Mut.Destroy();
|
||||
else
|
||||
Super.AddMutator(Mut);
|
||||
}
|
||||
|
||||
public function NotifyLogin(Controller C)
|
||||
{
|
||||
Super.NotifyLogin(C);
|
||||
|
||||
ZS.NotifyLogin(C);
|
||||
}
|
||||
|
||||
public function NotifyLogout(Controller C)
|
||||
{
|
||||
Super.NotifyLogout(C);
|
||||
|
||||
ZS.NotifyLogout(C);
|
||||
}
|
||||
|
||||
DefaultProperties
|
||||
{
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
class ZedSpawnerRepInfo extends ReplicationInfo;
|
||||
class ZedSpawnerRepLink 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();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
`Log_Debug("Received:" @ CustomZed);
|
||||
CustomZeds.AddItem(CustomZed);
|
||||
@ -29,7 +29,7 @@ public reliable client function SyncFinished()
|
||||
{
|
||||
local class<KFPawn_Monster> CustomZed;
|
||||
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
foreach CustomZeds(CustomZed)
|
||||
{
|
||||
@ -42,7 +42,7 @@ public reliable client function SyncFinished()
|
||||
|
||||
public reliable server function ServerSync()
|
||||
{
|
||||
`Log_Trace();
|
||||
`Log_Trace(`Location);
|
||||
|
||||
if (bPendingDelete || bDeleteMe) return;
|
||||
|
||||
@ -50,7 +50,7 @@ public reliable server function ServerSync()
|
||||
{
|
||||
`Log_Debug("Sync finished");
|
||||
SyncFinished();
|
||||
if (!ZS.DestroyRepInfo(Controller(Owner)))
|
||||
if (!ZS.DestroyRepLink(Controller(Owner)))
|
||||
{
|
||||
SafeDestroy();
|
||||
}
|
@ -4,7 +4,6 @@ class _Logger extends Object
|
||||
enum E_LogLevel
|
||||
{
|
||||
LL_WrongLevel,
|
||||
LL_None,
|
||||
LL_Fatal,
|
||||
LL_Error,
|
||||
LL_Warning,
|
||||
|
@ -1,8 +1,6 @@
|
||||
// Logger
|
||||
`define Log_Tag 'ZedSpawner'
|
||||
|
||||
`define LocationStatic "`{ClassName}::" $ GetFuncName()
|
||||
|
||||
`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)
|
||||
@ -10,6 +8,4 @@
|
||||
`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)
|
||||
`define Log_Trace(msg) `log("TRACE:" @ `msg, (LogLevel >= LL_Trace), `Log_Tag)
|
||||
|
@ -11,15 +11,6 @@ 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
@ -1 +1 @@
|
||||
Subproject commit fb458ac61f7e6c6426b8dff366dd5e7499e0d95f
|
||||
Subproject commit 2f173aad7a6f4578574764801136a0d86e830653
|
Loading…
x
Reference in New Issue
Block a user