Skip to content

Commit fbaf89d

Browse files
committed
[release] v2.1 Public Release
1 parent 3f0f504 commit fbaf89d

File tree

4 files changed

+83
-56
lines changed

4 files changed

+83
-56
lines changed

MutLoader/Classes/MutLoader.uc

Lines changed: 79 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,91 @@
77

88
class MutLoader extends Mutator Config(MutLoaderV2);
99

10-
var config bool bDebug;
10+
// Normal Vars
1111
var string sServerName;
12+
var bool bKeepServerNameDefault;
13+
var KFGameType KF;
1214

1315
function PreBeginPlay()
1416
{
15-
// Vars
16-
local array<MutLoaderObject> MutLoaderRecords;
17-
local array<string> MutatorList;
18-
local array<string> Names;
19-
local int i;
17+
// Vars
18+
local array<MutLoaderObject> MutLoaderRecords;
19+
local array<string> MutatorList;
20+
local array<string> Names;
21+
local int i;
2022

21-
Super.PreBeginPlay();
23+
//////////////////// Essence & Vel-San ///////////
24+
Names=Class'MutLoaderObject'.Static.GetPerObjectNames("MutLoaderV2");
25+
for(i=0; i<Names.Length; i++) MutLoaderRecords[i]=New(None, Names[i]) Class'MutLoaderObject';
26+
for(i=0; i<MutLoaderRecords.Length; i++)
27+
{
28+
if (
29+
MutLoaderRecords[i].GameTypeName==string(Level.Game.Class.Name)
30+
&& MutLoaderRecords[i].GameDifficulty==Level.Game.GameDifficulty
31+
)
32+
{
33+
MutLog("-----|| Using MutLoader Config # [" $i$ "]; Total Configs Found: " $MutLoaderRecords.Length$ " ||-----");
34+
MutatorList=MutLoaderRecords[i].Mutator;
35+
if (MutLoaderRecords[i].ServerName != "") sServerName = MutLoaderRecords[i].ServerName;
36+
else bKeepServerNameDefault = True;
37+
Break;
38+
}
39+
}
40+
//////////////////////////////////////////////////
41+
for(i=0; i<MutatorList.Length; i++)
42+
{
43+
if (
44+
MutatorList[i]==""
45+
|| MutatorList[i]==string(Self.Class)
46+
)
47+
{
48+
Continue;
49+
}
50+
else
51+
{
52+
Level.Game.AddMutator(MutatorList[i], True);
53+
MutLog("-----|| Mutator Added =>"@MutatorList[i]$ " ||-----");
54+
}
55+
}
56+
}
2257

23-
//////////////////// Essence & Vel-San ///////////
24-
Names=Class'MutLoaderObject'.Static.GetPerObjectNames("MutLoaderV2");
25-
for(i=0; i<Names.Length; i++) MutLoaderRecords[i]=New(None, Names[i]) Class'MutLoaderObject';
26-
for(i=0; i<MutLoaderRecords.Length; i++)
27-
{
28-
if (
29-
MutLoaderRecords[i].GameTypeName==string(Level.Game.Class.Name)
30-
&& MutLoaderRecords[i].GameDifficulty==Level.Game.GameDifficulty
31-
)
32-
{
33-
MutLog("-----|| Using MutLoader Config # [" $i$ "]; Total Configs Found: " $MutLoaderRecords.Length$ " ||-----");
34-
MutatorList=MutLoaderRecords[i].Mutator;
35-
if (MutLoaderRecords[i].ServerName != "") sServerName = MutLoaderRecords[i].ServerName;
36-
Break;
37-
}
38-
}
39-
//////////////////////////////////////////////////
40-
for(i=0; i<MutatorList.Length; i++)
41-
{
42-
if (
43-
MutatorList[i]==""
44-
|| MutatorList[i]==string(Self.Class)
45-
)
46-
{
47-
Continue;
48-
}
49-
else
50-
{
51-
Level.Game.AddMutator(MutatorList[i], True);
52-
if(bDebug) MutLog("-----|| Mutator Added =>"@MutatorList[i]$ " ||-----");
53-
}
54-
}
58+
function PostBeginPlay()
59+
{
60+
SetTimer(1, False);
5561
}
5662

57-
function Tick(float DeltaTime)
63+
function Timer()
5864
{
59-
if(bDebug)
60-
{
61-
TimeStampLog("-----|| TICK - Default ServerName: " $Level.GRI.ServerName$ " ||-----");
62-
TimeStampLog("-----|| TICK - 'MutLoader' ServerName: " $sServerName$ " ||-----");
63-
}
64-
Level.GRI.ServerName = sServerName;
65-
if(bDebug) TimeStampLog("-----|| TICK - Updated Default ServerName: " $Level.GRI.ServerName$ " ||-----");
66-
Disable('Tick');
65+
KF = KFGameType(Level.Game);
66+
TimeStampLog("-----|| Default ServerName: " $Level.GRI.ServerName$ " ||-----");
67+
TimeStampLog("-----|| 'MutLoader' ServerName: " $sServerName$ " ||-----");
68+
69+
CheckMutators(sServerName);
70+
71+
if(!bKeepServerNameDefault)
72+
{
73+
Level.GRI.ServerName = sServerName;
74+
TimeStampLog("-----|| New ServerName: " $Level.GRI.ServerName$ " ||-----");
75+
}
76+
else TimeStampLog("-----|| Keeping Default Server Name ||-----");
77+
}
78+
79+
// Special Function to detect Faked Mutator and append XF to ServerName
80+
function CheckMutators(out string ServerName)
81+
{
82+
local Mutator M;
83+
84+
// Do not append anything or change the ServerName, if empty ServerName detected in Config
85+
if(bKeepServerNameDefault) return;
86+
87+
for ( M = KF.BaseMutator; M != None; M = M.NextMutator ) {
88+
if(M.IsA('Faked_1')) ServerName $= " | 1F";
89+
if(M.IsA('Faked_2')) ServerName $= " | 2F";
90+
if(M.IsA('Faked_3')) ServerName $= " | 3F";
91+
if(M.IsA('Faked_4')) ServerName $= " | 4F";
92+
if(M.IsA('Faked_5')) ServerName $= " | 5F";
93+
if(M.IsA('Custom')) ServerName $= " | CustomFaked";
94+
}
6795
}
6896

6997
function TimeStampLog(coerce string s)
@@ -78,8 +106,7 @@ function MutLog(string s)
78106

79107
defaultproperties
80108
{
81-
bDebug=True
82-
GroupName="KF-MutLoaderV2"
83-
FriendlyName="MutLoader - v2.0"
84-
Description="seamlessly load mutators With optimized config (Difficulty, ServerName, Several GameTypes); By Flame, Essence & Vel-San"
109+
GroupName="KF-MutLoaderV2"
110+
FriendlyName="MutLoader - v2.1"
111+
Description="seamlessly load mutators With optimized config (Difficulty, ServerName, Several GameTypes); By Flame, Essence & Vel-San"
85112
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ No need to put any other mutators in the list of MapVoteV2. What's important is
1515

1616
- Better support with MapVoteV2
1717
- ServerName change with every config
18+
- If ServerName is given (not empty), Mutator will also check if you have Faked Mutator installed (1, 2, 3, 4, 5, Custom) and will automatically append XF to your server name

Sample_Config/MutLoaderV2.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[MutLoaderV2.MutLoader]
2-
bDebug=True
32

43
[Settings1 MutLoaderObject]
54
GameTypeName=KFGameType # Can be any gametype you want

Steam_WorkShop_Description/Workshop-text

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Optimized version of 'MutLoader' originally made by Flame &amp; Essence, slightl
66

77
- Better support with MapVoteV2
88
- ServerName change with every config
9+
- If ServerName is given (not empty), Mutator will also check if you have Faked Mutator installed (1, 2, 3, 4, 5, Custom) and will automatically append XF to your server name
910

1011
[h1][b][u]Notes[/u][/b][/h1]
1112

@@ -19,7 +20,6 @@ Optimized version of 'MutLoader' originally made by Flame &amp; Essence, slightl
1920

2021
[code]
2122
[MutLoaderV2.MutLoader]
22-
bDebug=True
2323

2424
[Settings1 MutLoaderObject]
2525
GameTypeName=KFGameType # Can be any gametype you want
@@ -65,8 +65,8 @@ No need to put any other mutators in the list of MapVoteV2. What's important is
6565

6666
[h1][b][u]Manual Download Links (Recommended)[/u][/b][/h1]
6767

68-
You can find it under 'Whitelisted' folder named 'KF-Mutloader-v2.0'
68+
You can find it under 'Whitelisted' folder named 'KF-Mutloader-v2.1'
6969

7070
- MEGA Link: https://mega DOT nz/folder/YDoEmKiC#s6FGAtgh40-TvB4bHsLaMQ
7171

72-
- Github: https://github.com/Vel-San/KF-Mutloader/releases/tag/v2.0
72+
- Github: https://github.com/Vel-San/KF-Mutloader/releases/tag/v2.1

0 commit comments

Comments
 (0)