Jump to content

[Mod] Rx_Mutator_AllSoldiers_Shotgun


Ukill

Recommended Posts

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;
}
 


 

 

 


 

Edited by ukilleddanny
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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 by KrypTheBear
Touchpads are pain
  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...