Jump to content

Any way to edit the ammount of upgrade slots a weapon can have.


hunydo1255

Recommended Posts

This is set in unrealscript, not in config files, unfortunately (except for the SMG mod weapons, which I made the value a config value).

 

If you look in X2Item_DefaultWeapons.uc, in each of the weapon template functions you'll see something like :

Template.NumUpgradeSlots = 1;

The value is generally 0 (for secondary weapons), 1 (for conventional), or 2 (for magnetic or beam).

 

For SMGs I made it a config value, for example :

Template.NumUpgradeSlots = default.SMG_MAGNETIC_UPGRADESLOTS;

To make a mod for this, you'll have to write unrealscript that overrides the base-game templates. To make matters a bit worse, you have to deal with the difficulty variants of the weapon, which is handled in native code in the current build. However, it MAY work to simply copy the base-game template code to a new mod template class, and try to overrwrite the original template in the template manager.

Link to comment
Share on other sites

I'm going to bump this because I'm also interested in this as are I imagine many people. It figures that something that would obviously be in high demand is one the things that is not easily editable in the ini files. I'm also interested in being able to remove reuse attachments and PCS chips. Both of these have a continent bonus that enables them, but guess what? The continent bonus for these particular ones are also not editable in the ini files. WTF Firaxis?

 

If anyone goes to the effort to make a mod for this I would love to hear about asap.

Edited by Delta7
Link to comment
Share on other sites

Guys, a quick fix is to go to DefaultGameData_WeaponData.ini in xcomgame/config folder, add a line below the core properties and variables, IE for ballistic Assault rifles AssaultRifle_Conventional_upgradeslots = X and bingo, next time you start that tier will have it ready to go, and some continent is supposed to have a reusable attachment/PCS bonus, so that may be worth looking into

 

Disregard that, that happens to only work with the text based SMG mod INI files

Edited by BAIT1Czer1
Link to comment
Share on other sites

Guys, a quick fix is to go to DefaultGameData_WeaponData.ini in xcomgame/config folder, add a line below the core properties and variables, IE for ballistic Assault rifles AssaultRifle_Conventional_upgradeslots = X and bingo, next time you start that tier will have it ready to go, and some continent is supposed to have a reusable attachment/PCS bonus, so that may be worth looking into

 

Disregard that, that happens to only work with the text based SMG mod INI files

 

Yeah I know about that, why the hell didn't Firaxis do the base game weapons the same way. This is just really dumb.

Link to comment
Share on other sites

I'm going to bump this because I'm also interested in this as are I imagine many people. It figures that something that would obviously be in high demand is one the things that is not easily editable in the ini files. I'm also interested in being able to remove reuse attachments and PCS chips. Both of these have a continent bonus that enables them, but guess what? The continent bonus for these particular ones are also not editable in the ini files. WTF Firaxis?

 

If anyone goes to the effort to make a mod for this I would love to hear about asap.

 

Someone please make this happen, all of it. Please please PUHLEEEEEASE.

Link to comment
Share on other sites

This is set in unrealscript, not in config files, unfortunately (except for the SMG mod weapons, which I made the value a config value).

 

If you look in X2Item_DefaultWeapons.uc, in each of the weapon template functions you'll see something like :

Template.NumUpgradeSlots = 1;

The value is generally 0 (for secondary weapons), 1 (for conventional), or 2 (for magnetic or beam).

 

For SMGs I made it a config value, for example :

Template.NumUpgradeSlots = default.SMG_MAGNETIC_UPGRADESLOTS;

To make a mod for this, you'll have to write unrealscript that overrides the base-game templates. To make matters a bit worse, you have to deal with the difficulty variants of the weapon, which is handled in native code in the current build. However, it MAY work to simply copy the base-game template code to a new mod template class, and try to overrwrite the original template in the template manager.

 

It doesn't, the game actively rejects overwrites of vanilla (indeed the Redscreen actually notes duplicates and rejects them, instead of overwriting with the new data).. Hence my problem earlier; it seems we physically can't edit the non-ini variables of vanilla weapons, items (?functions?) at the moment, only add new content; at least without the work-around you've suggested.

 

Makes it very difficult to make base gameplay mods :/

Link to comment
Share on other sites

This is set in unrealscript, not in config files, unfortunately (except for the SMG mod weapons, which I made the value a config value).

 

If you look in X2Item_DefaultWeapons.uc, in each of the weapon template functions you'll see something like :

Template.NumUpgradeSlots = 1;

The value is generally 0 (for secondary weapons), 1 (for conventional), or 2 (for magnetic or beam).

 

For SMGs I made it a config value, for example :

Template.NumUpgradeSlots = default.SMG_MAGNETIC_UPGRADESLOTS;

To make a mod for this, you'll have to write unrealscript that overrides the base-game templates. To make matters a bit worse, you have to deal with the difficulty variants of the weapon, which is handled in native code in the current build. However, it MAY work to simply copy the base-game template code to a new mod template class, and try to overrwrite the original template in the template manager.

 

I have a question, this would be for someone like you who builds more complex mods. How much work would it be to take the in game assets of all the base game weapons, and clone them more or less and create a mod like your SMG that could be imported into the game and also editable in the ini like your smg? It's kind of a workaround for sure, you would see a duplicate of weapon types in the equipment screen one with extra mod slots and a different name. Than you don't have to deal with the unreal scripts and its easily removable.Would that be copy paste with a few changes to someone who knows what they are doing or would that be a massive amount of work?

 

I'm just spitballing.

I'm sure that someone will tackle the weapon attachment problem eventually there certainly is a demand for it.

Edited by Delta7
Link to comment
Share on other sites

what about this? someone posted in in steam workshop. Can it work?

Create a new class to extend the X2Item_DefaultWeapons

class <NewClassName> extends X2Item_DefaultWeapons
config(<ConfigFileName>);

Create the config variable

var config int ASSAULTRIFLE_CONVENTIONAL_IUPGRADESLOTS;


override the template creation method

static function X2DataTemplate CreateTemplate_AssaultRifle_Conventional()
{
local X2WeaponTemplate Template;
Template = X2WeaponTemplate(Super.CreateTemplate_AssaultRifle_Conventional());

Template.NumUpgradeSlots = default.ASSAULTRIFLE_CONVENTIONAL_IUPGRADESLOTS;

return Template;
}

In XCom<ConfigFileName>.ini

Add the following config
[<ModName>.<NewClassName>]
;Assault Rifle
ASSAULTRIFLE_CONVENTIONAL_IUPGRADESLOTS = 2

you also need to tell the engine to override the original file by add the following in XComEngine.ini

[Engine.Engine]
+ModClassOverrides=(BaseGameClass="X2Item_DefaultWeapons", ModClass="<NewClassName>")

You only need to override the method / template you want to change.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...