Skip to content

Commit

Permalink
[release] v2.1 Public Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vel-San committed Dec 6, 2020
1 parent 3f0f504 commit fbaf89d
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 56 deletions.
131 changes: 79 additions & 52 deletions MutLoader/Classes/MutLoader.uc
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,91 @@

class MutLoader extends Mutator Config(MutLoaderV2);

var config bool bDebug;
// Normal Vars
var string sServerName;
var bool bKeepServerNameDefault;
var KFGameType KF;

function PreBeginPlay()
{
// Vars
local array<MutLoaderObject> MutLoaderRecords;
local array<string> MutatorList;
local array<string> Names;
local int i;
// Vars
local array<MutLoaderObject> MutLoaderRecords;
local array<string> MutatorList;
local array<string> Names;
local int i;

Super.PreBeginPlay();
//////////////////// Essence & Vel-San ///////////
Names=Class'MutLoaderObject'.Static.GetPerObjectNames("MutLoaderV2");
for(i=0; i<Names.Length; i++) MutLoaderRecords[i]=New(None, Names[i]) Class'MutLoaderObject';
for(i=0; i<MutLoaderRecords.Length; i++)
{
if (
MutLoaderRecords[i].GameTypeName==string(Level.Game.Class.Name)
&& MutLoaderRecords[i].GameDifficulty==Level.Game.GameDifficulty
)
{
MutLog("-----|| Using MutLoader Config # [" $i$ "]; Total Configs Found: " $MutLoaderRecords.Length$ " ||-----");
MutatorList=MutLoaderRecords[i].Mutator;
if (MutLoaderRecords[i].ServerName != "") sServerName = MutLoaderRecords[i].ServerName;
else bKeepServerNameDefault = True;
Break;
}
}
//////////////////////////////////////////////////
for(i=0; i<MutatorList.Length; i++)
{
if (
MutatorList[i]==""
|| MutatorList[i]==string(Self.Class)
)
{
Continue;
}
else
{
Level.Game.AddMutator(MutatorList[i], True);
MutLog("-----|| Mutator Added =>"@MutatorList[i]$ " ||-----");
}
}
}

//////////////////// Essence & Vel-San ///////////
Names=Class'MutLoaderObject'.Static.GetPerObjectNames("MutLoaderV2");
for(i=0; i<Names.Length; i++) MutLoaderRecords[i]=New(None, Names[i]) Class'MutLoaderObject';
for(i=0; i<MutLoaderRecords.Length; i++)
{
if (
MutLoaderRecords[i].GameTypeName==string(Level.Game.Class.Name)
&& MutLoaderRecords[i].GameDifficulty==Level.Game.GameDifficulty
)
{
MutLog("-----|| Using MutLoader Config # [" $i$ "]; Total Configs Found: " $MutLoaderRecords.Length$ " ||-----");
MutatorList=MutLoaderRecords[i].Mutator;
if (MutLoaderRecords[i].ServerName != "") sServerName = MutLoaderRecords[i].ServerName;
Break;
}
}
//////////////////////////////////////////////////
for(i=0; i<MutatorList.Length; i++)
{
if (
MutatorList[i]==""
|| MutatorList[i]==string(Self.Class)
)
{
Continue;
}
else
{
Level.Game.AddMutator(MutatorList[i], True);
if(bDebug) MutLog("-----|| Mutator Added =>"@MutatorList[i]$ " ||-----");
}
}
function PostBeginPlay()
{
SetTimer(1, False);
}

function Tick(float DeltaTime)
function Timer()
{
if(bDebug)
{
TimeStampLog("-----|| TICK - Default ServerName: " $Level.GRI.ServerName$ " ||-----");
TimeStampLog("-----|| TICK - 'MutLoader' ServerName: " $sServerName$ " ||-----");
}
Level.GRI.ServerName = sServerName;
if(bDebug) TimeStampLog("-----|| TICK - Updated Default ServerName: " $Level.GRI.ServerName$ " ||-----");
Disable('Tick');
KF = KFGameType(Level.Game);
TimeStampLog("-----|| Default ServerName: " $Level.GRI.ServerName$ " ||-----");
TimeStampLog("-----|| 'MutLoader' ServerName: " $sServerName$ " ||-----");

CheckMutators(sServerName);

if(!bKeepServerNameDefault)
{
Level.GRI.ServerName = sServerName;
TimeStampLog("-----|| New ServerName: " $Level.GRI.ServerName$ " ||-----");
}
else TimeStampLog("-----|| Keeping Default Server Name ||-----");
}

// Special Function to detect Faked Mutator and append XF to ServerName
function CheckMutators(out string ServerName)
{
local Mutator M;

// Do not append anything or change the ServerName, if empty ServerName detected in Config
if(bKeepServerNameDefault) return;

for ( M = KF.BaseMutator; M != None; M = M.NextMutator ) {
if(M.IsA('Faked_1')) ServerName $= " | 1F";
if(M.IsA('Faked_2')) ServerName $= " | 2F";
if(M.IsA('Faked_3')) ServerName $= " | 3F";
if(M.IsA('Faked_4')) ServerName $= " | 4F";
if(M.IsA('Faked_5')) ServerName $= " | 5F";
if(M.IsA('Custom')) ServerName $= " | CustomFaked";
}
}

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

defaultproperties
{
bDebug=True
GroupName="KF-MutLoaderV2"
FriendlyName="MutLoader - v2.0"
Description="seamlessly load mutators With optimized config (Difficulty, ServerName, Several GameTypes); By Flame, Essence & Vel-San"
GroupName="KF-MutLoaderV2"
FriendlyName="MutLoader - v2.1"
Description="seamlessly load mutators With optimized config (Difficulty, ServerName, Several GameTypes); By Flame, Essence & Vel-San"
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ No need to put any other mutators in the list of MapVoteV2. What's important is

- Better support with MapVoteV2
- ServerName change with every config
- 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
1 change: 0 additions & 1 deletion Sample_Config/MutLoaderV2.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[MutLoaderV2.MutLoader]
bDebug=True

[Settings1 MutLoaderObject]
GameTypeName=KFGameType # Can be any gametype you want
Expand Down
6 changes: 3 additions & 3 deletions Steam_WorkShop_Description/Workshop-text
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Optimized version of 'MutLoader' originally made by Flame &amp; Essence, slightl

- Better support with MapVoteV2
- ServerName change with every config
- 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

[h1][b][u]Notes[/u][/b][/h1]

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

[code]
[MutLoaderV2.MutLoader]
bDebug=True

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

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

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

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

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

0 comments on commit fbaf89d

Please sign in to comment.