Originally posted by HsoolienIt should not reitterate infinitly, try logging Recs.Length, and what ever 'i' is each loop, see if it is at least going up the list....

Thanks for the config code, I'll get to it as soon as I can.
class mymut extends mutator config(OptionalFilename); var config bool bStuff; function PreBeginPlay(); { log(bstuff); } static function FillPlayInfo(PlayInfo PlayInfo) { PlayInfo.AddSetting(default.RulesGroup, "Stuff", default."Hello", 0, 1, "Check"); } static event string GetDescriptionText(string PropName) { if (PropName == "bStuff") return default."Stuff"; }
[filename.mymut] bStuff=Whatever
Obj.GiveWeapon(Recs[i].ClassName);
local array<CacheManager.WeaponRecord> Recs; class'CacheManager'.static.GetWeaponList(Recs);
local int i; for (i = 0; i < Recs.Length; i++) { Obj.GiveWeapon(Recs[i]); }
function Timer() { local Controller Obj; for (Obj = Level.ControllerList; Obj != None; Obj = Obj.NextController) { if (Obj.Pawn != None) { Obj.Pawn.Weapon.MaxOutAmmo(); } } }
function bool CheckReplacement(Actor Other, out byte bSuperRelevant) { local int i,arraynum; if(bUseConfig && Other.IsA('Monster')) { for(i=0;i<24;i++) { if(Other.class==LoadMonsterClass[i]) { Other.Acceleration*=MonsterConfigs[i].AccelScale; Monster(Other).groundspeed*=MonsterConfigs[i].SpeedScale; Monster(Other).airspeed*=MonsterConfigs[i].SpeedScale; Monster(Other).waterspeed*=MonsterConfigs[i].SpeedScale; Monster(Other).health*=MonsterConfigs[i].HealthScale; Monster(Other).ScoringValue=MonsterConfigs[i].ScoreValue; Other.SetDrawScale(Other.drawscale*MonsterConfigs[i].SizeScale); Other.SetCollisionSize(Other.CollisionRadius*MonsterConfigs[i].SizeScale,Other.CollisionHeight*MonsterConfigs[i].SizeScale); Pawn(Other).SkillModifier=MonsterConfigs[i].SkillModifier; break; } } } return true; }
// MutLoadout - Player Loadout Mutator // Gives players alternate starting health and shield, all weapons, and infinite ammo. // By Neoflame, 11 June 2004 class MutLoadout extends Mutator; var() config float StartingHealth; // player starting health var() config float StartingArmor; // player starting armor var config bool bInfiniteAmmo; // whether the player has infinite ammo, or just starts with maximum var config bool bGiveONSWeapons; // whether the player gets ONS-specific weapons var config bool bGiveSuperWeapons; // whether the player gets superweapons var localized string GUINameText[5]; var localized string GUIDescText[5]; event PreBeginPlay() { if (bInfiniteAmmo) { SetTimer(0.25, true); } } function GiveAmmo(Pawn Obj) { // Check if infinite ammo is on if (bInfiniteAmmo) { // Give 999 ammo // Give basic weapon ammo Weapon(Obj.FindInventoryType(class'AssaultRifle')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'BioRifle')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ClassicSniperRifle')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'FlakCannon')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'LinkGun')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'Minigun')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'RocketLauncher')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ShockRifle')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'SniperRifle')).SuperMaxOutAmmo(); // Give ONS weapon ammo (if applicable) if (bGiveONSWeapons) { Weapon(Obj.FindInventoryType(class'ONSAVRiL')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ONSGrenadeLauncher')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ONSMineLayer')).SuperMaxOutAmmo(); } // Give superweapon ammo (if applicable) if (bGiveSuperWeapons) { Weapon(Obj.FindInventoryType(class'Redeemer')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'Painter')).SuperMaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ONSPainter')).SuperMaxOutAmmo(); } } else { // Give maximum ammo // Give basic weapon ammo Weapon(Obj.FindInventoryType(class'AssaultRifle')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'BioRifle')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ClassicSniperRifle')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'FlakCannon')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'LinkGun')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'Minigun')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'RocketLauncher')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ShockRifle')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'SniperRifle')).MaxOutAmmo(); // Give ONS weapon ammo (if applicable) if (bGiveONSWeapons) { Weapon(Obj.FindInventoryType(class'ONSAVRiL')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ONSGrenadeLauncher')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ONSMineLayer')).MaxOutAmmo(); } // Give superweapon ammo (if applicable) if (bGiveSuperWeapons) { Weapon(Obj.FindInventoryType(class'Redeemer')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'Painter')).MaxOutAmmo(); Weapon(Obj.FindInventoryType(class'ONSPainter')).MaxOutAmmo(); } } } function Timer() { local Controller Obj; for (Obj = Level.ControllerList; Obj != None; Obj = Obj.NextController) { if (Obj.Pawn != None) { GiveAmmo(Obj.Pawn); } } } function ModifyPlayer(Pawn Obj) { Obj.Health = StartingHealth; Obj.ShieldStrength = StartingArmor; Obj.GiveWeapon("XWeapons.BioRifle"); Obj.GiveWeapon("XWeapons.FlakCannon"); Obj.GiveWeapon("XWeapons.LinkGun"); Obj.GiveWeapon("XWeapons.Minigun"); Obj.GiveWeapon("XWeapons.RocketLauncher"); Obj.GiveWeapon("XWeapons.ShockRifle"); Obj.GiveWeapon("XWeapons.SniperRifle"); Obj.GiveWeapon("UTClassic.ClassicSniperRifle"); // Give ONS weapons if applicable if (bGiveONSWeapons) { Obj.GiveWeapon("Onslaught.ONSAVRiL"); Obj.GiveWeapon("Onslaught.ONSGrenadeLauncher"); Obj.GiveWeapon("Onslaught.ONSMineLayer"); } // Give superweapons if applicable if (bGiveSuperWeapons) { Obj.GiveWeapon("XWeapons.Redeemer"); Obj.GiveWeapon("XWeapons.Painter"); Obj.GiveWeapon("OnslaughtFull.ONSPainter"); } GiveAmmo(Obj); Super.ModifyPlayer(Obj); } static function FillPlayInfo(PlayInfo PlayInfo) { Super.FillPlayInfo(PlayInfo); PlayInfo.AddSetting(default.RulesGroup, "StartingHealth", default.GUINameText[0], 0, 0, "Text", "3;1:199"); PlayInfo.AddSetting(default.RulesGroup, "StartingArmor", default.GUINameText[1], 0, 0, "Text", "3;0:150"); PlayInfo.AddSetting(default.RulesGroup, "bInfiniteAmmo", default.GUINameText[2], 0, 0, "Check"); PlayInfo.AddSetting(default.RulesGroup, "bGiveONSWeapons", default.GUINameText[3], 0, 0, "Check"); PlayInfo.AddSetting(default.RulesGroup, "bGiveSuperWeapons", default.GUINameText[4], 0, 0, "Check"); } static event string GetDisplayText(string PropName) { switch (PropName) { case "StartingHealth": return default.GUINameText[0]; case "StartingArmor": return default.GUINameText[1]; case "bInfiniteAmmo": return default.GUINameText[2]; case "bGiveONSWeapons": return default.GUINameText[3]; case "bGiveSuperWeapons": return default.GUINameText[4]; } } static event string GetDescriptionText(string PropName) { switch (PropName) { case "StartingHealth": return default.GUIDescText[0]; case "StartingArmor": return default.GUIDescText[1]; case "bInfiniteAmmo": return default.GUIDescText[2]; case "bGiveONSWeapons": return default.GUIDescText[3]; case "bGiveSuperWeapons": return default.GUIDescText[4]; default: return Super.GetDescriptionText(PropName); } } defaultproperties { StartingHealth=100 StartingArmor=100 bInfiniteAmmo=true bGiveONSWeapons=true bGiveSuperWeapons=false GUINameText[0]="Starting Health" GUINameText[1]="Starting Shield" GUINameText[2]="Infinite Ammo" GUINameText[3]="Onslaught Weapons" GUINameText[4]="Superweapons" GUIDescText[0]="Amount of health players start with." GUIDescText[1]="Amount of shield players start with." GUIDescText[2]="If this box is checked, all weapons will have infinite ammo. If not, all players will start off with the maximum amount of ammo for their weapons, but ammo will be finite." GUIDescText[3]="If this box is checked, Onslaught weapons will be included in the loadout." GUIDescText[4]="If this box is checked, superweapons will be included in the loadout." GroupName="Loadout" FriendlyName="Player Loadout" Description="Starts players off with a configurable amount of health and shield, as well as every weapon and full ammo." }
Leave a comment: