Amour Mods

Post Reply
foreverdead
Posts: 56
Joined: Sat Jan 21, 2017 11:01 am

Amour Mods

Post by foreverdead »

I've tried to increase the number of mod slots on armour in the LW_Overhaul ini but it doesn't seem to increase in game. I'm using 'Mod Everything' and 'Grimy's Loot Mod'.
User avatar
warbrand2
Posts: 105
Joined: Thu Jul 14, 2016 5:55 am

Re: Amour Mods

Post by warbrand2 »

you have to increase it in grimmys mod and mod everything as well. both have .ini files with the options somewhere.
User avatar
Arcalane
Posts: 339
Joined: Thu Jan 19, 2017 10:42 pm

Re: Amour Mods

Post by Arcalane »

warbrand2 wrote:you have to increase it in grimmys mod and mod everything as well. both have .ini files with the options somewhere.
Except they don't. I just checked and neither of them define the number of slots available for armours.
foreverdead
Posts: 56
Joined: Sat Jan 21, 2017 11:01 am

Re: Amour Mods

Post by foreverdead »

Yeah nothing in those mods config folders, the stuff from the lock boxes have multiple slots but lose them if I strip the armour, and the armour I build doesn't have more than 1 slot.
TyreT
Posts: 23
Joined: Thu Jan 26, 2017 11:30 am

Re: Amour Mods

Post by TyreT »

What exactly do you mean by "number of mod slots on armour"?
Do you mean the number of utility slots(where you can place grenades, medkits, the pistol and armor plates)?

If thats what you mean, I found a few possible places where that might be set:

In LW_Overhaul.ini :

Code: Select all

+ItemTable=(ItemTemplateName="LightPlatedArmor",	Slots=0 ....
But I assume that's the one you already tried?

In XComGameData_CharacterStats:

Code: Select all

CharacterBaseStats[eStat_UtilityItems]=3
All Soldier and Soldier_Diff templates in that files have this code, so that might be what sets it to 3 ingame. Changing things here likely will not affect already created Soldiers however. Thats also the likely reason why I found something else related to slots.

If you looked at your log-files, you might have noticed this line:

Code: Select all

LWTrace: GetNumUtilitySlotsOverride Override : working. Set to 3
I counted 20 of thoose lines, one after the other. This seems to be the amount of soldiers i have in my character-pool.

The code resonsible for theese lines is in X2DownloadedableContentInfo_LW_Overhaul.uc.
In conjunction with XComGameState_Unit.uc 's GetNumUtilitySlots function, this seems to set all units with a template name of 'soldier' to have the untility-slot numer defined in class'XComGameState_LWListenerManager'.default.OverrideNumUtilitySlots, which is defined in XComGameState_LWListenerManager.uc with

Code: Select all

OverrideNumUtilitySlots = 3;
So this might mean that already created Soldiers get their utility-slot set to the hard-coded value of 3. Which would mean that the slot amount is not configureable in the .ini-files.

TLDR:
The slot amount we see ingame is affected by the ini file XComGameData_CharacterStats but changes there might be overwritten by code in X2DownloadedableContentInfo_LW_Overhaul.uc, XComGameState_Unit.uc and XComGameState_LWListenerManager.uc that defines utility-slot to the hard-coded value of 3.

All this is just going by the content of the ini and script files. I haven't tested changing any ini files, and I have insufficent hard-drive space for the dev tools, so I can't try and recompile the .u file(s) from the .uc files.
User avatar
Arcalane
Posts: 339
Joined: Thu Jan 19, 2017 10:42 pm

Re: Amour Mods

Post by Arcalane »

If you actually read the first post properly you would see the word mod. As in modification. I get that you're trying to help, but slow down for a second, 'cause you've taken a wrong turn and run with it way too far.

Here's the deal; Grimy's Loot Mod adds a bunch of armour modifications, like the Mag Deflector that reduces damage taken from ADVENT units using Magnetic Weapons, or Hardpoints which reduce your chances of being critically hit.

Now, a suit of armour you get from the Loot Mod can have up to three modifications on it.

However, if you strip out those modifications, only one of them can be put back on because the game/UI thinks that armours only have one mod slot.

Both OP and I have tried increasing the Slots value in XComLW_Overhaul.ini to 3 to match other weapons (this works for SPARK weapons, Gremlins, and all other secondary/etc. options incidentally) but the UI still insists that only one slot is available for armours.

Got it?
TyreT
Posts: 23
Joined: Thu Jan 26, 2017 11:30 am

Re: Amour Mods

Post by TyreT »

I see, thanks for the clarification.

I'll see if i can find anything related to this in the code then.
TyreT
Posts: 23
Joined: Thu Jan 26, 2017 11:30 am

Re: Amour Mods

Post by TyreT »

Ok, I have something more relevant now. I looked at the code responsible for parsing the +ItemTable entries. It is in LWTemplateMods.uc , specifically in the ReconfigGear function there.
This code

Code: Select all

for (i=0; i < ItemTable.Length; ++i)
		{
			if (WeaponTemplate.DataName == ItemTable[i].ItemTemplateName)
			{
				WeaponTemplate.NumUpgradeSlots = ItemTable[i].Slots;
			}
		}
is locked behind this:

Code: Select all

WeaponTemplate = X2WeaponTemplate(Template);
	if (WeaponTemplate != none)
Therefore, the 'Slots' values from the ini-table will be used for all weapontemplates.

Armor however, is represented by X2ArmorTemplate, which is-a X2EquipmentTemplate.
So the slots-value for Armor and all other non-Weapons is not actually honored in the code.
Arcalane wrote:Both OP and I have tried increasing the Slots value in XComLW_Overhaul.ini to 3 to match other weapons (this works for SPARK weapons, Gremlins, and all other secondary/etc. options incidentally) but the UI still insists that only one slot is available for armours.
I tried to reproduce the working beheavior, however, my secondaries only ever had 1 slot(I only tried the basic secodaries with infinite supply however).
User avatar
JLtheking
Posts: 105
Joined: Sat Jan 21, 2017 12:11 pm

Re: Amour Mods

Post by JLtheking »

I think GLM mods the number of weapon slots each item that came out of a lockbox dynamically. That's why your tier 1 weapons and armor opened from lockboxes could have 2 slots while generic only had 1.

So while I have no solution to what you are requesting, you could possibly retain the number of slots armors from lockboxes had.

There was a mod that I used to use, before LW2 came out http://steamcommunity.com/sharedfiles/f ... =658977800 that worked with GLM and IIRC it retained the correct number of slots on weapons and armor.

Not sure if its compatible, but you can try it out and report back if it works?
User avatar
Arcalane
Posts: 339
Joined: Thu Jan 19, 2017 10:42 pm

Re: Amour Mods

Post by Arcalane »

The problem then is that at the moment you can only roll kevlar armour from Grimy's Loot Mod, which stays relevant for about the first two months before being outdated. In fact you can only roll 'baseline' gear period.
TyreT wrote:Ok, I have something more relevant now. I looked at the code responsible for parsing the +ItemTable entries. It is in LWTemplateMods.uc , specifically in the ReconfigGear function there.
...
Therefore, the 'Slots' values from the ini-table will be used for all weapontemplates.

Armor however, is represented by X2ArmorTemplate, which is-a X2EquipmentTemplate.
So the slots-value for Armor and all other non-Weapons is not actually honored in the code.
Pretty much what I suspected then. Hopefully someone will be able to patch it up since the most modding I've done was slap together a voicepack -- which is a whole different thing.
TyreT wrote:
Arcalane wrote:Both OP and I have tried increasing the Slots value in XComLW_Overhaul.ini to 3 to match other weapons (this works for SPARK weapons, Gremlins, and all other secondary/etc. options incidentally) but the UI still insists that only one slot is available for armours.
I tried to reproduce the working beheavior, however, my secondaries only ever had 1 slot(I only tried the basic secodaries with infinite supply however).
Weird. All of my secondaries have three slots, but I also have Mod Everything.
TyreT
Posts: 23
Joined: Thu Jan 26, 2017 11:30 am

Re: Amour Mods

Post by TyreT »

JLtheking wrote:I think GLM mods the number of weapon slots each item that came out of a lockbox dynamically. That's why your tier 1 weapons and armor opened from lockboxes could have 2 slots while generic only had 1.
I agree. There is a Tier/Rarity code that grants anything between 1-4 slots of ugrades(but 4 is rare apparently). Or maybe it just grants the upgrades(pre-installed), without really granting the slots?
Arcalane wrote:Weird. All of my secondaries have three slots, but I also have Mod Everything.
Well, since that is a prerequesite for Grimy's Loot Mod, I used it as well.

I also tested only with Mod Everything, where I noticed that by itself(= without Grimy's), it doesn't add any item slots(even without LW2).
User avatar
Arcalane
Posts: 339
Joined: Thu Jan 19, 2017 10:42 pm

Re: Amour Mods

Post by Arcalane »

TyreT wrote:I also tested only with Mod Everything, where I noticed that by itself(= without Grimy's), it doesn't add any item slots(even without LW2).
That's not really a surprise - Mod Everything is more just about unlocking the customization options. There are no secondary/armour mods in the game by default, so it's up to other mods to add them.

Other mods can then just require ME as a dependency instead of everyone replicating the code and having their own potentially outdated/conflicting methods running alongside each other.
TyreT
Posts: 23
Joined: Thu Jan 26, 2017 11:30 am

Re: Amour Mods

Post by TyreT »

Yes it makes sense that it works that way.
I didn't see an easy way to find mods with 'Mod Everything' as a requirement, but maybe there aren't too many using it after all..
User avatar
JLtheking
Posts: 105
Joined: Sat Jan 21, 2017 12:11 pm

Re: Amour Mods

Post by JLtheking »

GLM mods the number of slots weapons and armor get from lock boxes, depending on the rarity of the box.

Rare (green) boxes produce weapons with 2 slots (1 generic), and 1 slot from secondaries (also 1 generic, from Mod Everything).

Epic (purple) boxes produce weapons with 3 slots and upgrades (2 generic), and 2 slots and upgrades for secondaries

Legendary (orange) boxes produce weapons with 4 slots and upgrades (2 generic), and 3 slots and upgrades for secondaries.

You can replace the equipment mods using vanilla lock and load with no issue. Or strip the weapon using the mod I linked, without turning the weapon back into generic. The named, colored weapon(green purple or orange) would be left with 0 upgrades, but the correct number of slots which you could then equip with other upgrades.

The issue I think is because LW2's strip weapon function forces the weapon back into generic form, killing the dynamic mod slots GLM boxes grant weapons.
addorrer
Posts: 1
Joined: Mon Mar 06, 2017 6:59 pm

Re: Amour Mods

Post by addorrer »

might be a long post but in my little time looking into this.... this might help... but i'm not entirely sure...

*sorry if i'm interpretting this wrongly and correct me please, i'm still learning...*

from what I gather from below, looks like grimy is generating the armour templates in his code... and adds the armor mods/attachments here but doesn't "modify the number of slots" it just injects the item with attachments and we are allowed to manually detach the attachments...

**edit: with long war 2

// In GrimyLoot_Research.uc

Code: Select all

static function XComGameState_Item IdentifyLightArmor(XComGameState NewGameState, XComGameState_Tech TechState, int NumSlots) {
	local XComGameStateHistory History;
	local XComGameState_HeadquartersXCom XComHQ;
	local X2ItemTemplateManager ItemTemplateManager;
	local XComGameState_Item ItemState;
	local GrimyLoot_GameState_LootComponent ComponentState;
	local X2ItemTemplate ItemTemplate;
	local name ItemName;

	
	//Create a new item instance
	ItemTemplateManager = class'X2ItemTemplateManager'.static.GetItemTemplateManager();
	XComHQ = `XCOMHQ;




	if ( XComHQ.HasItemByName('MediumPoweredArmor') ) {
		ItemName = default.LA_T3[`SYNC_RAND_STATIC(default.LA_T3.length)];
	}
	else if ( XComHQ.HasItemByName('MediumPlatedArmor') ) {
		ItemName = default.LA_T2[`SYNC_RAND_STATIC(default.LA_T2.length)];
	}
	else {
		ItemName = default.LA_T1[`SYNC_RAND_STATIC(default.LA_T1.length)];
		if ( ItemName == 'KevlarArmor' && XComHQ.HasItemByName('KevlarArmor_DLC_Day0') )
			ItemName = 'KevlarArmor_DLC_Day0';
	}

	ItemTemplate = ItemTemplateManager.FindItemTemplate(ItemName);
	UpdateItemTemplateToHighestAvailableUpgrade(XComHQ, ItemTemplate);
	
	//ItemState = ItemTemplate.CreateInstanceFromTemplate(NewGameState);
	ItemState = XComGameState_Item(NewGameState.CreateStateObject(class'XComGameState_Item'));
	ItemState.OnCreation(ItemTemplate);
	ComponentState = GrimyLoot_GameState_LootComponent(NewGameState.CreateStateObject(class'GrimyLoot_GameState_LootComponent'));
	ItemState.AddComponentObject(ComponentState);
	if ( default.RANDOMIZE_NICKNAMES ) {
		ItemState.Nickname = GenerateNickname(NumSlots-1);
	}
	else {
		ItemState.Nickname = GetRarityPrefix(NumSlots-1) @ ItemTemplate.GetItemFriendlyNameNoStats();
	}
	ComponentState.NumUpgrades = NumSlots;
	ComponentState.TradingPostValue = GetEpicEquipmentPrice();
	if ( default.RANDOMIZE_WEAPON_APPEARANCE ) {
		ItemState.WeaponAppearance.iWeaponTint = `SYNC_RAND_STATIC(`CONTENT.GetColorPalette(ePalette_ArmorTint).Entries.length);
		ItemState.WeaponAppearance.iWeaponDeco = `SYNC_RAND_STATIC(`CONTENT.GetColorPalette(ePalette_ArmorTint).Entries.length);
		ItemState.WeaponAppearance.nmWeaponPattern = GetRandPatternName();
	}
	ApplyNovelUpgrade(ItemState, default.ArmorAffixOne);
	ApplyNovelUpgrade(ItemState, default.ArmorAffixTwo);
	if ( NumSlots >= 3 ) {
		ApplyNovelUpgrade(ItemState, default.ArmorAffixThree);
		ComponentState.TradingPostValue = GetEpicEquipmentPrice();
	}

	if ( NumSlots >= 4 ) {
		ApplyNovelUpgrade(ItemState, default.ArmorAffixFour);
		ComponentState.TradingPostValue = GetLegendaryEquipmentPrice();
	}

	foreach NewGameState.IterateByClassType(class'XComGameState_HeadquartersXCom', XComHQ) { break; }

	if (XComHQ == none) {
		History = `XCOMHISTORY;
		XComHQ = XComGameState_HeadquartersXCom(History.GetSingleGameStateObjectForClass(class'XComGameState_HeadquartersXCom'));
		XComHQ = XComGameState_HeadquartersXCom(NewGameState.CreateStateObject(class'XComGameState_HeadquartersXCom', XComHQ.ObjectID));
		NewGameState.AddStateObject(XComHQ);
	}

	NewGameState.AddStateObject(ItemState);
	NewGameState.AddStateObject(ComponentState);
	ItemState.OnItemBuilt(NewGameState);
	TechState.ItemReward = ItemTemplate; // Needed for UI Alert display info
	TechState.bSeenResearchCompleteScreen = true; // Reset the research report for techs that are repeatable
	XComHQ.PutItemInInventory(NewGameState, ItemState);
	`XEVENTMGR.TriggerEvent('ItemConstructionCompleted', ItemState, ItemState, NewGameState);
	return ItemState;
}
this returns the item and adds it to your item inventory...

now again from what i gather...

primary weapons in lw2 has a procedure to add more slots to primary weapons that overrides the default firaxis weapon attachment... and grimy's also calls this procedure for secondary weapons (gremlins/grenade launcher/etc).

as for armors, only armors generated by glm (the lockboxes) will have multiple sockets (normally 2 and 3 for alien lockboxes etc...) and lw2 doesn't have code that overrides the number of attachments/slots to armors even though configurations are placed in the lw2overhaul.ini i don't actually see code that uses this information and modifies this....

I'm not entirely sure whats a good way to fix this (who to bug/ticket)...
Post Reply