Ukill Posted January 7, 2017 Share Posted January 7, 2017 (edited) View File Rx_Mutator_AllSoldiers_Shotgun * This Mutator gives all soldiers a shotgun. * .... Version 1.1.0 Compatible with Renegade X v5.281 Mutator : Rx_Mutator_AllSoldiers_Shotguns.u (Download) Source : Spoiler Rx_Mutator_AllSoldiers_Shotguns.uc (Download) Spoiler /* ** This will not replace the default weapons, only add it to their current inventory. */ class Rx_Mutator_AllSoldiers_Shotgun extends UTMutator; function bool CheckReplacement(Actor Other) { if (Rx_InventoryManager(Other) != None) { if (Rx_InventoryManager_Nod_Shotgunner(Other) == None && Rx_InventoryManager_GDI_Shotgunner(Other) == None) Rx_InventoryManager(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } return true; } Version 1.0.0 Compatible with Renegade X v5.271 Mutator : Rx_Mutator_AllSoldiers_Shotguns.u (Download) Source : Spoiler Rx_Mutator_AllSoldiers_Shotguns.uc (Download) Spoiler /* ** This will not replace the default weapons, only add it to their current inventory. */ class Rx_Mutator_AllSoldiers_Shotgun extends UTMutator; function bool CheckReplacement(Actor Other) { /*** NAME - Rx_InventoryManager ***/ /*** NAME - Rx_InventoryManager_Adv_GDI ***/ /*** NAME - Rx_InventoryManager_Adv_NOD ***/ /*** NAME - Rx_InventoryManager_Basic ***/ if (Other.IsA('Rx_InventoryManager_GDI_Deadeye')) { Rx_InventoryManager_GDI_Deadeye(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Engineer')) { Rx_InventoryManager_GDI_Engineer(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Grenadier')) { Rx_InventoryManager_GDI_Grenadier(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Gunner')) { Rx_InventoryManager_GDI_Gunner(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Havoc')) { Rx_InventoryManager_GDI_Havoc(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Hotwire')) { Rx_InventoryManager_GDI_Hotwire(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Marksman')) { Rx_InventoryManager_GDI_Marksman(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_McFarland')) { Rx_InventoryManager_GDI_McFarland(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Mobius')) { Rx_InventoryManager_GDI_Mobius(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Officer')) { Rx_InventoryManager_GDI_Officer(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Patch')) { Rx_InventoryManager_GDI_Patch(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_RocketSoldier')) { Rx_InventoryManager_GDI_RocketSoldier(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } /* if (Other.IsA('Rx_InventoryManager_GDI_Shotgunner')) { Rx_InventoryManager_GDI_Shotgunner(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } */ if (Other.IsA('Rx_InventoryManager_GDI_Soldier')) { Rx_InventoryManager_GDI_Soldier(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_GDI_Sydney')) { Rx_InventoryManager_GDI_Sydney(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_BlackHandSniper')) { Rx_InventoryManager_Nod_BlackHandSniper(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_ChemicalTrooper')) { Rx_InventoryManager_Nod_ChemicalTrooper(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_Engineer')) { Rx_InventoryManager_Nod_Engineer(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_FlameTrooper')) { Rx_InventoryManager_Nod_FlameTrooper(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_LaserChainGunner')) { Rx_InventoryManager_Nod_LaserChainGunner(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_Marksman')) { Rx_InventoryManager_Nod_Marksman(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_Mendoza')) { Rx_InventoryManager_Nod_Mendoza(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_Officer')) { Rx_InventoryManager_Nod_Officer(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_Raveshaw')) { Rx_InventoryManager_Nod_Raveshaw(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_RocketSoldier')) { Rx_InventoryManager_Nod_RocketSoldier(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_Sakura')) { Rx_InventoryManager_Nod_Sakura(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } /* if (Other.IsA('Rx_InventoryManager_Nod_Shotgunner')) { Rx_InventoryManager_Nod_Shotgunner(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } */ if (Other.IsA('Rx_InventoryManager_Nod_Soldier')) { Rx_InventoryManager_Nod_Soldier(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_StealthBlackHand')) { Rx_InventoryManager_Nod_StealthBlackHand(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } if (Other.IsA('Rx_InventoryManager_Nod_Technician')) { Rx_InventoryManager_Nod_Technician(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } return true; } Submitter ukilleddanny Submitted 01/07/2017 Category Modifications Edited January 9, 2017 by ukilleddanny Quote Link to comment Share on other sites More sharing options...
Agent Posted January 7, 2017 Share Posted January 7, 2017 Would be much shorter to just do: if (Rx_InventoryManager(Other) != None) { if (Rx_InventoryManager_Nod_Shotgunner(Other) == None && Rx_InventoryManager_Nod_Shotgunner(Other) == None) Rx_InventoryManager(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } Instead of your extremely long if chain. 1 Quote Link to comment Share on other sites More sharing options...
KrypTheBear Posted January 8, 2017 Share Posted January 8, 2017 (edited) 17 hours ago, Agent said: Would be much shorter to just do: if (Rx_InventoryManager(Other) != None) { if (Rx_InventoryManager_Nod_Shotgunner(Other) == None && Rx_InventoryManager_Nod_Shotgunner(Other) == None) Rx_InventoryManager(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun'; } Instead of your extremely long if chain. Twice the same check? Instead of: if (Rx_InventoryManager_Nod_Shotgunner(Other) == None && Rx_InventoryManager_Nod_Shotgunner(Other) == None) Should be: if (Rx_InventoryManager_Nod_Shotgunner(Other) == None && Rx_InventoryManager_GDI_Shotgunner(Other) == None) Edited January 8, 2017 by KrypTheBear Touchpads are pain 1 Quote Link to comment Share on other sites More sharing options...
Agent Posted January 8, 2017 Share Posted January 8, 2017 It's funny because I caught that typo immediately after posting and thought I edited my post. I must have forgot to save it. 1 Quote Link to comment Share on other sites More sharing options...
Ukill Posted January 9, 2017 Author Share Posted January 9, 2017 Thanks !!, will edit this later today. Quote Link to comment Share on other sites More sharing options...
Ukill Posted January 9, 2017 Author Share Posted January 9, 2017 I have just uploaded a new version, the code is shorter now then it was before. I'd still also like the old code, because it gives an example how you can use all kinds of soldiers. Thanks for your feedback, more is better . Quote Link to comment Share on other sites More sharing options...
Axesor Posted January 9, 2017 Share Posted January 9, 2017 Little addition to this weapon replacement mutator example(?): If you want to edit the values of the weapon, just: open any weapon file. For example Rx_Weapon_Shotgun then edit anything you'd like to (damage, spread, range, ammo, dmg_type, or even model and sound etc.) Save this file as Rx_Weapon_Shotgun_edited (...or anyhow you want). Move this file in the same folder as main mutator is (Rx_Mutator_AllSoldiers_Shotgun). Open the main mutator (Rx_Mutator_AllSoldiers_Shotgun) and change this part of code: Rx_InventoryManager(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun' Into this: Rx_InventoryManager(Other).SecondaryWeapons[0] = class'Rx_Weapon_Shotgun_edited' If you want to play more with the damage of the weapon (edit damage done to the buildings, heavy armor, flak armor etc.), you gotta follow the similar steps as before: Find the original dmg_type of the weapon in the game folder (Rx_dmgtype_shotgun ...iam not sure if its correct) Open it, and edit any values you want Save it and rename it Move this file in the same folder as main mutator is. Find the dmg_type part of the code in the mutated weapon (..._shotgun_edited), and write the name that you gave to your mutated dmgtype in there. Enjoy your mutated weapon. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.