5 Commits

Author SHA1 Message Date
5e0c9a3792 wip 2023-05-14 10:55:38 +03:00
0cb47d2d0c update build tools 2022-09-02 16:13:42 +03:00
8e40a01e48 server-side 2022-08-16 10:56:43 +03:00
466a49fc22 update description 2022-07-11 09:06:30 +03:00
e72c2ddc4c update build tools 2022-07-11 09:06:18 +03:00
12 changed files with 148 additions and 34 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
testing.ini *.psd
3rd-party-bin /ignore

View File

@ -1,20 +1,23 @@
[img]https://raw.githubusercontent.com/GenZmeY/KF2-TAWOD/master/PublicationContent/mutbanner.png[/img] [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-TAWOD[/img] [img]https://img.shields.io/steam/favorites/2379769040[/img] [img]https://img.shields.io/steam/update-date/2379769040[/img] [url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2379769040][img]https://img.shields.io/github/v/tag/GenZmeY/KF2-TAWOD[/img][/url]
[h1]Description:[/h1] [h1]Description:[/h1]
[i]A small mutator that forces players to throw all their weapons on death (not just the current weapon as in the game by default). [/i] [i]A small server-side mutator that forces players to throw all their weapons on death (not just the current weapon as in the game by default).[/i]
[h1]The mutator is not whitelisted![/h1] [h1]Whitelisted?[/h1]
You will not gain experience for playing with this mutator. No. This mod is not whitelisted and will de-rank your server. Any XP gained will not be saved.
[h1]Usage (server):[/h1] [h1]Usage (server)[/h1]
[b]Note:[/b] 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. [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]
1. Open your PCServer-KFEngine.ini / LinuxServer-KFEngine.ini; [*]Open your [b]PCServer-KFEngine.ini[/b] / [b]LinuxServer-KFEngine.ini[/b];
2. Add the following string to the [OnlineSubsystemSteamworks.KFWorkshopSteamworks] section: [*]Find the [b][IpDrv.TcpNetDriver][/b] section and make sure that there is a line (add if not):
[code]ServerSubscribedWorkshopItems=2379769040[/code] [b]DownloadManagers=OnlineSubsystemSteamworks.SteamWorkshopDownload[/b]
3. Start the server and wait while the mutator is downloading; ❗️ If there are several [b]DownloadManagers=[/b] then the line above should be the first ❗️
4. Add the following line to the startup parameters and restart the server: [*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
[code]?Mutator=TAWOD.TAWODMut[/code] [b]ServerSubscribedWorkshopItems=2379769040[/b]
[*]Start the server and wait while the mutator is downloading;
[*]Add mutator to server start parameters: [b]?Mutator=TAWOD.TAWODMut[/b] and restart the server.
[/olist]
[h1]Sources:[/h1] [h1]Sources:[/h1]
[url=https://github.com/GenZmeY/KF2-TAWOD]https://github.com/GenZmeY/KF2-TAWOD[/url] (GNU GPLv3) [url=https://github.com/GenZmeY/KF2-TAWOD]https://github.com/GenZmeY/KF2-TAWOD[/url] [b](GNU GPLv3)[/b]

View File

@ -22,13 +22,8 @@ A small mutator that forces players to throw all their weapons on death (not jus
5. The compiled files will be here: 5. The compiled files will be here:
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\` `C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
# Usage (Server) # Usage
1. Open your PCServer-KFEngine.ini / LinuxServer-KFEngine.ini; [See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2379769040)
2. Add the following string to the [OnlineSubsystemSteamworks.KFWorkshopSteamworks] section (create one if it doesn't exist):
`ServerSubscribedWorkshopItems=2379769040`
3. Start the server and wait while the mutator is downloading;
4. Add the following line to the startup parameters and restart the server:
`?Mutator=TAWOD.TAWODMut`
# Bug reports # Bug reports
If you find a bug, create new issue here: [Issues](https://github.com/GenZmeY/KF2-TAWOD/issues) If you find a bug, create new issue here: [Issues](https://github.com/GenZmeY/KF2-TAWOD/issues)

View File

@ -1,13 +1,45 @@
class TAWODMut extends KFMutator; class TAWODMut extends KFMutator;
var const E_LogLevel LogLevel;
var private TAWOD TAWOD;
public simulated function bool SafeDestroy()
{
`Log_Trace();
return (bPendingDelete || bDeleteMe || Destroy());
}
public event PreBeginPlay() public event PreBeginPlay()
{ {
`Log_Trace();
Super.PreBeginPlay(); Super.PreBeginPlay();
`log("Loaded.", true, 'TAWOD');
if (WorldInfo.Game.DefaultPawnClass != WorldInfo.Game.default.DefaultPawnClass)
{
`Log_Warn("Custom 'DefaultPawnClass' (" $ WorldInfo.Game.DefaultPawnClass $ ") detected, possible compatibility issues. Turn off TAWOD if there are problems");
}
if (ClassIsChildOf(WorldInfo.Game.DefaultPawnClass, class'KFGameInfo_VersusSurvival'.default.DefaultPawnClass))
{
WorldInfo.Game.DefaultPawnClass = class'TAWOD_PawnHuman_Versus';
`Log_Info("TAWOD_PawnHuman_Versus");
}
else
{
WorldInfo.Game.DefaultPawnClass = class'TAWOD_PawnHuman';
`Log_Info("TAWOD_PawnHuman");
}
`Log_Info("Loaded.");
} }
public function AddMutator(Mutator Mut) public function AddMutator(Mutator Mut)
{ {
`Log_Trace();
if (Mut == Self) return; if (Mut == Self) return;
if (Mut.Class == Class) if (Mut.Class == Class)
@ -18,20 +50,33 @@ public function AddMutator(Mutator Mut)
public function bool PreventDeath(Pawn Killed, Controller Killer, class<DamageType> damageType, vector HitLocation) public function bool PreventDeath(Pawn Killed, Controller Killer, class<DamageType> damageType, vector HitLocation)
{ {
local KFWeapon TempWeapon; `Log_Trace();
local KFPawn_Human KFP;
KFP = KFPawn_Human(Killed); if (Role >= ROLE_Authority)
{
if (Role >= ROLE_Authority && KFP != None && KFP.InvManager != None) DropAllWeapons(KFPawn_Human(Killed));
foreach KFP.InvManager.InventoryActors(class'KFWeapon', TempWeapon) }
if (TempWeapon != None && TempWeapon.bDropOnDeath && TempWeapon.CanThrow())
KFP.TossInventory(TempWeapon);
return Super.PreventDeath(Killed, Killer, damageType, HitLocation); return Super.PreventDeath(Killed, Killer, damageType, HitLocation);
} }
public static function DropAllWeapons(KFPawn_Human KFP)
{
local KFWeapon KFW;
if (KFP != None && KFP.InvManager != None)
{
foreach KFP.InvManager.InventoryActors(class'KFWeapon', KFW)
{
if (KFW != None && KFW.bDropOnDeath && KFW.CanThrow())
{
KFP.TossInventory(KFW);
}
}
}
}
defaultproperties defaultproperties
{ {
LogLevel = LL_Info
} }

View File

@ -0,0 +1,11 @@
class TAWOD_PawnHuman extends KFPawn_Human;
public function ThrowWeaponOnDeath()
{
class'TAWODMut'.static.DropAllWeapons(Self);
}
defaultproperties
{
}

View File

@ -0,0 +1,11 @@
class TAWOD_PawnHuman_Versus extends KFPawn_Human_Versus;
public function ThrowWeaponOnDeath()
{
class'TAWODMut'.static.DropAllWeapons(Self);
}
defaultproperties
{
}

20
TAWOD/Classes/_Logger.uc Normal file
View File

@ -0,0 +1,20 @@
class _Logger extends Object
abstract;
enum E_LogLevel
{
LL_WrongLevel,
LL_None,
LL_Fatal,
LL_Error,
LL_Warning,
LL_Info,
LL_Debug,
LL_Trace,
LL_All
};
defaultproperties
{
}

2
TAWOD/Constants.uci Normal file
View File

@ -0,0 +1,2 @@
// Constants
`define NO_CONFIG 0

3
TAWOD/Globals.uci Normal file
View File

@ -0,0 +1,3 @@
// Imports
`include(Logger.uci)
`include(Constants.uci)

15
TAWOD/Logger.uci Normal file
View File

@ -0,0 +1,15 @@
// Logger
`define Log_Tag 'TAWOD'
`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)
`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)

View File

@ -11,6 +11,15 @@ StripSource="True"
PackageBuildOrder="TAWOD" PackageBuildOrder="TAWOD"
### 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 ### ### Steam Workshop upload parameters ###
# Mutators that will be uploaded to the workshop # Mutators that will be uploaded to the workshop

2
tools

Submodule tools updated: 02222cf453...cd658d9af9