|
| 1 | +/////////////////////////////////////////////////// |
| 2 | +// Modified version of MutLoader with multiple |
| 3 | +// Settings support, GameTypes, GameDifficulty & |
| 4 | +// Server Name change |
| 5 | +// By Flame, Essence & Vel-San |
| 6 | +/////////////////////////////////////////////////// |
| 7 | + |
| 8 | +class MutLoader extends Mutator Config(MutLoaderV2); |
| 9 | + |
| 10 | +var config bool bDebug; |
| 11 | +var string sServerName; |
| 12 | + |
| 13 | +function PreBeginPlay() |
| 14 | +{ |
| 15 | + // Vars |
| 16 | + local array<MutLoaderObject> MutLoaderRecords; |
| 17 | + local array<string> MutatorList; |
| 18 | + local array<string> Names; |
| 19 | + local int i; |
| 20 | + |
| 21 | + Super.PreBeginPlay(); |
| 22 | + |
| 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 | + } |
| 55 | +} |
| 56 | + |
| 57 | +function Tick(float DeltaTime) |
| 58 | +{ |
| 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'); |
| 67 | +} |
| 68 | +
|
| 69 | +function TimeStampLog(coerce string s) |
| 70 | +{ |
| 71 | + log("["$Level.TimeSeconds$"s]" @ s, 'MutLoaderV2'); |
| 72 | +} |
| 73 | +
|
| 74 | +function MutLog(string s) |
| 75 | +{ |
| 76 | + log(s, 'MutLoaderV2'); |
| 77 | +} |
| 78 | +
|
| 79 | +defaultproperties |
| 80 | +{ |
| 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" |
| 85 | +} |
0 commit comments