Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
1722bca158 | |||
e72a9ad77b | |||
c83ab7055d | |||
c667b5fc54 | |||
a3bb56079b | |||
e976dd3647 | |||
b0c7eb7f41 | |||
762499ace1 | |||
176e2b7fd8 | |||
b3897611a1 | |||
db05d95a84 | |||
995f898317 | |||
38424db90e | |||
c86b653e53 | |||
00e95b546e | |||
6bdabb5c62 | |||
172d4881f1 |
33
.editorconfig
Normal file
33
.editorconfig
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
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
|
118
.github/workflows/mega-linter.yml
vendored
Normal file
118
.github/workflows/mega-linter.yml
vendored
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
---
|
||||||
|
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: >-
|
||||||
|
${{
|
||||||
|
github.event_name == 'push' &&
|
||||||
|
contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref)
|
||||||
|
}}
|
||||||
|
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"
|
@ -19,58 +19,58 @@ var private config E_LogLevel LogLevel;
|
|||||||
public simulated function bool SafeDestroy()
|
public simulated function bool SafeDestroy()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
return (bPendingDelete || bDeleteMe || Destroy());
|
return (bPendingDelete || bDeleteMe || Destroy());
|
||||||
}
|
}
|
||||||
|
|
||||||
public event PreBeginPlay()
|
public event PreBeginPlay()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (WorldInfo.NetMode == NM_Client)
|
if (WorldInfo.NetMode == NM_Client)
|
||||||
{
|
{
|
||||||
`Log_Fatal("NetMode:" @ WorldInfo.NetMode);
|
`Log_Fatal("NetMode:" @ WorldInfo.NetMode);
|
||||||
SafeDestroy();
|
SafeDestroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Super.PreBeginPlay();
|
Super.PreBeginPlay();
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function Init()
|
private function Init()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (Version == `NO_CONFIG)
|
if (Version == `NO_CONFIG)
|
||||||
{
|
{
|
||||||
LogLevel = LL_Info;
|
LogLevel = LL_Info;
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
CfgLifespan.static.InitConfig(Version, LatestVersion, LogLevel);
|
CfgLifespan.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||||
|
|
||||||
switch (Version)
|
switch (Version)
|
||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
`Log_Info("Config created");
|
`Log_Info("Config created");
|
||||||
|
|
||||||
case MaxInt:
|
case MaxInt:
|
||||||
`Log_Info("Config updated to version" @ LatestVersion);
|
`Log_Info("Config updated to version" @ LatestVersion);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LatestVersion:
|
case LatestVersion:
|
||||||
`Log_Info("Config is up-to-date");
|
`Log_Info("Config is up-to-date");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
`Log_Warn("The config version is higher than the current version (are you using an old mutator?)");
|
`Log_Warn("The config version is higher than the current version (are you using an old mutator?)");
|
||||||
`Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion);
|
`Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion);
|
||||||
`Log_Warn("The config version will be changed to" @ LatestVersion);
|
`Log_Warn("The config version will be changed to" @ LatestVersion);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LatestVersion != Version)
|
if (LatestVersion != Version)
|
||||||
{
|
{
|
||||||
Version = LatestVersion;
|
Version = LatestVersion;
|
||||||
@ -84,16 +84,16 @@ private function Init()
|
|||||||
SaveConfig();
|
SaveConfig();
|
||||||
}
|
}
|
||||||
`Log_Base("LogLevel:" @ LogLevel);
|
`Log_Base("LogLevel:" @ LogLevel);
|
||||||
|
|
||||||
CfgLifespan.static.Load(LogLevel);
|
CfgLifespan.static.Load(LogLevel);
|
||||||
|
|
||||||
`Log_Info("Initialized");
|
`Log_Info("Initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ModifyLifespan(Actor A)
|
public function ModifyLifespan(Actor A)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
switch (PickupType(A))
|
switch (PickupType(A))
|
||||||
{
|
{
|
||||||
case PT_Dosh:
|
case PT_Dosh:
|
||||||
@ -107,7 +107,7 @@ public function ModifyLifespan(Actor A)
|
|||||||
`Log_Debug("Skip modify dosh lifespan");
|
`Log_Debug("Skip modify dosh lifespan");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PT_Weapon:
|
case PT_Weapon:
|
||||||
if (CfgLifespan.default.Weap > 0)
|
if (CfgLifespan.default.Weap > 0)
|
||||||
{
|
{
|
||||||
@ -119,7 +119,7 @@ public function ModifyLifespan(Actor A)
|
|||||||
`Log_Debug("Skip modify weapon lifespan");
|
`Log_Debug("Skip modify weapon lifespan");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PT_Carryable:
|
case PT_Carryable:
|
||||||
case PT_NotPickup:
|
case PT_NotPickup:
|
||||||
default:
|
default:
|
||||||
@ -130,7 +130,7 @@ public function ModifyLifespan(Actor A)
|
|||||||
private function E_PickupType PickupType(Actor A)
|
private function E_PickupType PickupType(Actor A)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (KFDroppedPickup_Cash(A) != None)
|
if (KFDroppedPickup_Cash(A) != None)
|
||||||
{
|
{
|
||||||
return PT_Dosh;
|
return PT_Dosh;
|
||||||
@ -143,7 +143,7 @@ private function E_PickupType PickupType(Actor A)
|
|||||||
{
|
{
|
||||||
return PT_Weapon;
|
return PT_Weapon;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PT_NotPickup;
|
return PT_NotPickup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[Flags]
|
[Flags]
|
||||||
AllowDownload=False
|
AllowDownload=False
|
||||||
ClientOptional=False
|
ClientOptional=False
|
||||||
ServerSideOnly=True
|
ServerSideOnly=True
|
||||||
|
@ -1,59 +1 @@
|
|||||||
class DPLMut extends KFMutator;
|
class DPLMut extends Mut; // backward compatibility
|
||||||
|
|
||||||
var private DPL DPL;
|
|
||||||
|
|
||||||
public simulated function bool SafeDestroy()
|
|
||||||
{
|
|
||||||
return (bPendingDelete || bDeleteMe || Destroy());
|
|
||||||
}
|
|
||||||
|
|
||||||
public event PreBeginPlay()
|
|
||||||
{
|
|
||||||
Super.PreBeginPlay();
|
|
||||||
|
|
||||||
if (WorldInfo.NetMode == NM_Client) return;
|
|
||||||
|
|
||||||
foreach WorldInfo.DynamicActors(class'DPL', DPL)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DPL == None)
|
|
||||||
{
|
|
||||||
DPL = WorldInfo.Spawn(class'DPL');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DPL == None)
|
|
||||||
{
|
|
||||||
`Log_Base("FATAL: Can't Spawn 'DPL'");
|
|
||||||
SafeDestroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function AddMutator(Mutator Mut)
|
|
||||||
{
|
|
||||||
if (Mut == Self) return;
|
|
||||||
|
|
||||||
if (Mut.Class == Class)
|
|
||||||
Mut.Destroy();
|
|
||||||
else
|
|
||||||
Super.AddMutator(Mut);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function bool CheckRelevance(Actor A)
|
|
||||||
{
|
|
||||||
local bool Relevance;
|
|
||||||
|
|
||||||
Relevance = Super.CheckRelevance(A);
|
|
||||||
if (Relevance)
|
|
||||||
{
|
|
||||||
DPL.ModifyLifespan(A);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Relevance;
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultproperties
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
class Lifespan extends Object
|
class Lifespan extends Object
|
||||||
config(DPL)
|
config(DPL)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
var public config int Weap;
|
var public config int Weap;
|
||||||
var public config int Dosh;
|
var public config int Dosh;
|
||||||
|
|
||||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (Version)
|
switch (Version)
|
||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
ApplyDefault(LogLevel);
|
ApplyDefault(LogLevel);
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LatestVersion != Version)
|
if (LatestVersion != Version)
|
||||||
{
|
{
|
||||||
StaticSaveConfig();
|
StaticSaveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Load(E_LogLevel LogLevel)
|
public static function Load(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function ApplyDefault(E_LogLevel LogLevel)
|
protected static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
default.Weap = int(class'KFDroppedPickup'.default.Lifespan);
|
default.Weap = int(class'KFDroppedPickup'.default.Lifespan);
|
||||||
default.Dosh = int(class'KFDroppedPickup_Cash'.default.Lifespan);
|
default.Dosh = int(class'KFDroppedPickup_Cash'.default.Lifespan);
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
59
DPL/Classes/Mut.uc
Normal file
59
DPL/Classes/Mut.uc
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
class Mut extends KFMutator;
|
||||||
|
|
||||||
|
var private DPL DPL;
|
||||||
|
|
||||||
|
public simulated function bool SafeDestroy()
|
||||||
|
{
|
||||||
|
return (bPendingDelete || bDeleteMe || Destroy());
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PreBeginPlay()
|
||||||
|
{
|
||||||
|
Super.PreBeginPlay();
|
||||||
|
|
||||||
|
if (WorldInfo.NetMode == NM_Client) return;
|
||||||
|
|
||||||
|
foreach WorldInfo.DynamicActors(class'DPL', DPL)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DPL == None)
|
||||||
|
{
|
||||||
|
DPL = WorldInfo.Spawn(class'DPL');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DPL == None)
|
||||||
|
{
|
||||||
|
`Log_Base("FATAL: Can't Spawn 'DPL'");
|
||||||
|
SafeDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function AddMutator(Mutator M)
|
||||||
|
{
|
||||||
|
if (M == Self) return;
|
||||||
|
|
||||||
|
if (M.Class == Class)
|
||||||
|
Mut(M).SafeDestroy();
|
||||||
|
else
|
||||||
|
Super.AddMutator(M);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function bool CheckRelevance(Actor A)
|
||||||
|
{
|
||||||
|
local bool Relevance;
|
||||||
|
|
||||||
|
Relevance = Super.CheckRelevance(A);
|
||||||
|
if (Relevance)
|
||||||
|
{
|
||||||
|
DPL.ModifyLifespan(A);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Relevance;
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -1,20 +1,20 @@
|
|||||||
class _Logger extends Object
|
class _Logger extends Object
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
enum E_LogLevel
|
enum E_LogLevel
|
||||||
{
|
{
|
||||||
LL_WrongLevel,
|
LL_WrongLevel,
|
||||||
LL_None,
|
LL_None,
|
||||||
LL_Fatal,
|
LL_Fatal,
|
||||||
LL_Error,
|
LL_Error,
|
||||||
LL_Warning,
|
LL_Warning,
|
||||||
LL_Info,
|
LL_Info,
|
||||||
LL_Debug,
|
LL_Debug,
|
||||||
LL_Trace,
|
LL_Trace,
|
||||||
LL_All
|
LL_All
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
// Constants
|
// Constants
|
||||||
`define NO_CONFIG 0
|
`define NO_CONFIG 0
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// Imports
|
// Imports
|
||||||
`include(Logger.uci)
|
`include(Logger.uci)
|
||||||
`include(Constants.uci)
|
`include(Constants.uci)
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
// Logger
|
// Logger
|
||||||
`define Log_Tag 'DPL'
|
`define Log_Tag 'DPL'
|
||||||
|
|
||||||
`define LocationStatic "`{ClassName}::" $ GetFuncName()
|
`define LocationStatic "`{ClassName}::" $ GetFuncName()
|
||||||
|
|
||||||
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
|
`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_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
|
||||||
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `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_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
|
||||||
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `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_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_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_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
||||||
|
@ -1,17 +1,20 @@
|
|||||||
[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-DroppedPickupLifespan[/img] [img]https://img.shields.io/steam/downloads/2864944858[/img] [img]https://img.shields.io/steam/favorites/2864944858[/img] [img]https://img.shields.io/steam/update-date/2864944858[/img] [url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2864944858][img]https://img.shields.io/github/v/tag/GenZmeY/KF2-DroppedPickupLifespan[/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-DroppedPickupLifespan[/img] [img]https://img.shields.io/steam/downloads/2864944858[/img] [img]https://img.shields.io/steam/favorites/2864944858[/img] [img]https://img.shields.io/steam/update-date/2864944858[/img] [url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2864944858][img]https://img.shields.io/github/v/tag/GenZmeY/KF2-DroppedPickupLifespan[/img][/url]
|
||||||
|
|
||||||
[h1]Description[/h1]
|
[h1]Description[/h1]
|
||||||
Small server-side mutator that changes the lifespan of dropped weapons and dosh.
|
Small server-side mutator that changes the lifespan of thrown weapons and dosh.
|
||||||
|
|
||||||
[h1]Whitelisted?[/h1]
|
[h1]Whitelisted?[/h1]
|
||||||
No. This mod is not whitelisted and will de-rank your server. Any XP gained will not be saved.
|
[b]No.[/b] But I really hope that it will be whitelisted.
|
||||||
|
|
||||||
|
[b]⚠️ I submitted whitelist request here:[/b]
|
||||||
|
https://forums.tripwireinteractive.com/index.php?threads/whitelisting-mods-and-mutators.120340/post-2353663
|
||||||
|
|
||||||
[h1]Usage (single player)[/h1]
|
[h1]Usage (single player)[/h1]
|
||||||
[olist]
|
[olist]
|
||||||
[*]Subscribe to this mutator;
|
[*]Subscribe to this mutator;
|
||||||
[*]Start KF2;
|
[*]Start KF2;
|
||||||
[*]Open console (`) and input:
|
[*]Open console (~) and input:
|
||||||
[b]open KF-BioticsLab?Mutator=DPL.DPLMut[/b]
|
[b]open KF-BioticsLab?Mutator=DPL.Mut[/b]
|
||||||
(replace the map and add the parameters you need)
|
(replace the map and add the parameters you need)
|
||||||
[*]<Enter>.
|
[*]<Enter>.
|
||||||
[/olist]
|
[/olist]
|
||||||
@ -25,28 +28,34 @@ No. This mod is not whitelisted and will de-rank your server. Any XP gained will
|
|||||||
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
|
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
|
||||||
[b]ServerSubscribedWorkshopItems=2864944858[/b]
|
[b]ServerSubscribedWorkshopItems=2864944858[/b]
|
||||||
[*]Start the server and wait while the mutator is downloading;
|
[*]Start the server and wait while the mutator is downloading;
|
||||||
[*]Add mutator to server start parameters: [b]?Mutator=DPL.DPLMut[/b] and restart the server.
|
[*]Add mutator to server start parameters: [b]?Mutator=DPL.Mut[/b] and restart the server.
|
||||||
[/olist]
|
[/olist]
|
||||||
|
|
||||||
|
[h1]Important setup information[/h1]
|
||||||
|
The config should be created on first start, but now the game contains a bug that initializes the config values randomly if they are not explicitly set. Thus, the config may have incorrect values or not be created at all.
|
||||||
|
So if you are using this mutator for the first time, I highly recommend doing the following:
|
||||||
|
[olist]
|
||||||
|
[*]Create (modify) [b]KFDPL.ini[/b] manually. Put the following content there:
|
||||||
|
[b][DPL.DPL]
|
||||||
|
Version=0[/b]
|
||||||
|
[*]Start the game/server with DPL to generate the contents of the config
|
||||||
|
[*]Close the game/server
|
||||||
|
[/olist]
|
||||||
|
[b]Right now this is the only way to correctly create the default config.[/b]
|
||||||
|
Unfortunately I can't do anything about it because it's a game problem (not mutator). I hope TWI fixes this someday.
|
||||||
|
|
||||||
[h1]Setup (KFDPL.ini)[/h1]
|
[h1]Setup (KFDPL.ini)[/h1]
|
||||||
Config will be created at the first start[b]*[/b].
|
|
||||||
[list]
|
[list]
|
||||||
[*][b]Weap[/b] - time in seconds after which weapon disappears. If zero or less the default value is used.
|
[*][b]Weap[/b] - time in seconds after which weapon disappears. If zero or less the default value is used.
|
||||||
[*][b]Dosh[/b] - time in seconds after which dosh disappears. If zero or less the default value is used.
|
[*][b]Dosh[/b] - time in seconds after which dosh disappears. If zero or less the default value is used.
|
||||||
[/list]
|
[/list]
|
||||||
|
|
||||||
Do not use too large values because a large number of objects on the map can cause lags.
|
❗️ Note that a large number of objects on the map can cause lags.
|
||||||
|
Some unscrupulous players can use this to harm your server: for example, they can throw a lot of money or weapons in a place inaccessible to other players (for example, in the pool on [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1210703659]KF-KillingPool[/url]).
|
||||||
|
So do not use too large values when you configure the mutator.
|
||||||
|
|
||||||
[h1]Notes[/h1]
|
[h1]Notes[/h1]
|
||||||
📌 Unfortunately there is no way to change ammo lifespan for technical reasons (the CheckRelevance() function is never called on Projectile objects). Ammo will disappear within a minute.
|
📌 Unfortunately there is no way to change ammo lifespan for technical reasons (the CheckRelevance() function is never called on Projectile objects). Ammo will disappear within 1-3 minutes depending on the type of projectile..
|
||||||
|
|
||||||
[h1]Troubleshooting[/h1]
|
|
||||||
[b](*)[/b] If your config is not created for some reason, create it manually with the following content:
|
|
||||||
[b][DPL.DPL]
|
|
||||||
Version=0
|
|
||||||
[/b]
|
|
||||||
|
|
||||||
Then start the server and check the file again - config content should be generated.
|
|
||||||
|
|
||||||
[h1]Sources[/h1]
|
[h1]Sources[/h1]
|
||||||
[url=https://github.com/GenZmeY/KF2-DroppedPickupLifespan]https://github.com/GenZmeY/KF2-DroppedPickupLifespan[/url] [b](GNU GPLv3)[/b]
|
[url=https://github.com/GenZmeY/KF2-DroppedPickupLifespan]https://github.com/GenZmeY/KF2-DroppedPickupLifespan[/url] [b](GNU GPLv3)[/b]
|
14
README.md
14
README.md
@ -3,17 +3,17 @@
|
|||||||
[![Steam Workshop](https://img.shields.io/static/v1?message=workshop&logo=steam&labelColor=gray&color=blue&logoColor=white&label=steam%20)](https://steamcommunity.com/sharedfiles/filedetails/?id=2864944858)
|
[![Steam Workshop](https://img.shields.io/static/v1?message=workshop&logo=steam&labelColor=gray&color=blue&logoColor=white&label=steam%20)](https://steamcommunity.com/sharedfiles/filedetails/?id=2864944858)
|
||||||
[![Steam Downloads](https://img.shields.io/steam/downloads/2864944858)](https://steamcommunity.com/sharedfiles/filedetails/?id=2864944858)
|
[![Steam Downloads](https://img.shields.io/steam/downloads/2864944858)](https://steamcommunity.com/sharedfiles/filedetails/?id=2864944858)
|
||||||
[![Steam Favorites](https://img.shields.io/steam/favorites/2864944858)](https://steamcommunity.com/sharedfiles/filedetails/?id=2864944858)
|
[![Steam Favorites](https://img.shields.io/steam/favorites/2864944858)](https://steamcommunity.com/sharedfiles/filedetails/?id=2864944858)
|
||||||
[![Steam Update Date](https://img.shields.io/steam/update-date/2864944858)](https://steamcommunity.com/sharedfiles/filedetails/?id=2864944858)
|
[![MegaLinter](https://github.com/GenZmeY/KF2-DroppedPickupLifespan/actions/workflows/mega-linter.yml/badge.svg?branch=master)](https://github.com/GenZmeY/KF2-DroppedPickupLifespan/actions/workflows/mega-linter.yml)
|
||||||
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-CustomTraderInventory)](https://github.com/GenZmeY/KF2-CustomTraderInventory/tags)
|
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-CustomTraderInventory)](https://github.com/GenZmeY/KF2-CustomTraderInventory/tags)
|
||||||
[![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-CustomTraderInventory)](LICENSE)
|
[![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-CustomTraderInventory)](LICENSE)
|
||||||
|
|
||||||
# Description
|
## Description
|
||||||
Small server-side mutator that changes the lifespan of thrown weapons and dosh.
|
Small server-side mutator that changes the lifespan of dropped weapons and dosh.
|
||||||
|
|
||||||
# Usage & Setup
|
## Usage & Setup
|
||||||
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2864944858)
|
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2864944858)
|
||||||
|
|
||||||
# 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.
|
**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);
|
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:
|
2. open git-bash and go to any folder where you want to store sources:
|
||||||
@ -27,5 +27,5 @@ Small server-side mutator that changes the lifespan of thrown weapons and dosh.
|
|||||||
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\`
|
||||||
|
|
||||||
# License
|
## License
|
||||||
[GNU GPLv3](LICENSE)
|
[![license](https://www.gnu.org/graphics/gplv3-with-text-136x68.png)](LICENSE)
|
||||||
|
@ -7,7 +7,7 @@ StripSource="True"
|
|||||||
|
|
||||||
# Mutators to be compiled
|
# Mutators to be compiled
|
||||||
# Specify them with a space as a separator,
|
# Specify them with a space as a separator,
|
||||||
# Mutators will be compiled in the specified order
|
# Mutators will be compiled in the specified order
|
||||||
PackageBuildOrder="DPL"
|
PackageBuildOrder="DPL"
|
||||||
|
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ PackageBuildOrder="DPL"
|
|||||||
# Packages you want to brew using @peelz's patched KFEditor.
|
# Packages you want to brew using @peelz's patched KFEditor.
|
||||||
# Useful for cases where regular brew doesn't put *.upk inside the package.
|
# Useful for cases where regular brew doesn't put *.upk inside the package.
|
||||||
# Specify them with a space as a separator,
|
# Specify them with a space as a separator,
|
||||||
# The order doesn't matter
|
# The order doesn't matter
|
||||||
PackagePeelzBrew=""
|
PackagePeelzBrew=""
|
||||||
|
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ PackagePeelzBrew=""
|
|||||||
|
|
||||||
# Mutators that will be uploaded to the workshop
|
# Mutators that will be uploaded to the workshop
|
||||||
# Specify them with a space as a separator,
|
# Specify them with a space as a separator,
|
||||||
# The order doesn't matter
|
# The order doesn't matter
|
||||||
PackageUpload="DPL"
|
PackageUpload="DPL"
|
||||||
|
|
||||||
|
|
||||||
|
2
tools
2
tools
@ -1 +1 @@
|
|||||||
Subproject commit 0e821f3dbbc6b3528f2028b0060d3b6f7f1c4b93
|
Subproject commit fb458ac61f7e6c6426b8dff366dd5e7499e0d95f
|
Loading…
Reference in New Issue
Block a user