budak7273 / ArmorModules

Satisfactory mod. Expansive yet balanced modular equipment system.
https://ficsit.app/mod/ArmorModules
Mozilla Public License 2.0
4 stars 1 forks source link

Powersuit Module/Inventory Slot modification via ContentLib Question #34

Closed afewvowels closed 10 months ago

afewvowels commented 10 months ago

Hello, I'm attempting to alter the number of slots in the power armors with a ContentLib json file.

So far I'm dialed in on this property/reference in /ArmorModules/Suits/[SUIT]/Equip_[SUIT] using the Content Inspector mod:

"Module":
{
    "JS_Class": "/Script/PowerSuit.EquipmentModuleComponent",
    "JS_Object": "/ArmorModules/Suits/Mk1/Equip_PowerSuitMK1.Default__Equip_PowerSuitMK1_C:EquipmentModule"
},

This seems to refer to a script or constructor or something and when I check the EquipmentModuleComponent in /Scripts/Powersuit/EquipmentModuleComponent I see that there is an "InventorySlots" property (the tooltips in-game refer to the module slots as inventory slots?) so it looks like that would be the value to modify. I'm seeing suit specific properties and values like fuel type in the "mCostToUse" property however I cannot seem to find specific module/inventory counts in the Equip_Powersuit files to modify.

Anyways thanks for your assistance!

EDIT: I notice a lot of the properties in the Equip_Powersuit file are listed in the PowerSuit UI Stats tab under Details in a list however the total inventory slots for modules is listed separately below the suit-specific flags.

afewvowels commented 10 months ago

So I have figured out how successfully use ContentLib to modify the name and description of the BioSuit!

contentlibexample

The trick for me was to figure out that the path at the top of a patch needs to refer to the directory structure as revealed by ContentInspector which is somewhat loosely based off the literal file structure from Windows.

However I am still unable to understand the property or correct file that would allow for patching the module/inventory slots for the suits.

So a json file with the contents below, when placed in [Game Directory]/FactoryGame/Configs/ContentLib/ItemPatches, correctly modifies the name and description of the BioSuit to what's contained in the example below:

//ArmorModules/Suits/BiofuelSuit/Desc_BiofuelSuit.Desc_BiofuelSuit_C
{
  "$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_Item.json",
  "Name": "Biofuel Suit - Modified",
  "Description": "Testing ContentLib Modification",
  "EquipmentStats": {
    "InventorySlots": 10
  }
}

It's the bit after the name/description that's throwing me. Anyways, thanks again!

budak7273 commented 10 months ago

All suit and module properties on the FEquipmentStats struct, this property value is inventory.

You've written a working item patch, but item patches can only modify the fields described in the schema. Your editor should be (rightfully) complaining that EquipmentStats is not a valid entry in the JSON, because it's not a supported item patch field.

You'll need to use a ContentLib CDO to modify the properties of the stats struct, because it's not in the item patch, but since it's a custom struct type, I'm not certain if CL can modify it - you'll have to experiment some.

I suggest trying to also implement a name change via CDO to make sure you're pointing at the right thing as practice. But you may need to point to another layer into the suit to actually modify the equipment data struct. Nog might have some insight on this, I'll ask him about it later

afewvowels commented 10 months ago

Alright, thanks for the tips! I was wondering why name and description were working fine but I was getting the squiggly lines about other properties not being allowed so thanks for explaining that. I'll try modifying the struct and see what all can be done from within ContentLib's framework in the morning.

afewvowels commented 10 months ago

After working with your suggestions I've found that using this property does add addtional inventory slots for modules for the Debug Module Additional Slots:

{
  "$schema": "https://raw.githubusercontent.com/budak7273/ContentLib_Documentation/main/JsonSchemas/CL_CDO.json",
  "Class": "/ArmorModules/Debug/Module_AdditionalSlots.Module_AdditionalSlots_C",
  "Edits" : [
    {
      "Property": "EquipmentStats",
      "Value": {
        "InventorySlots": 7
      }
    }
  ]
}

However I'm not sure as to which class I should be modifying for the suits.

Using

"Class": "/ArmorModules/Suits/BiofuelSuit/Equip_BiofuelSuit.Equip_BiofuelSuit_C"

and

"Class": "/ArmorModules/Suits/BiofuelSuit/Desc_BiofuelSuit.Desc_BiofuelSuit_C"

With the aforementioned EquipmentStats changes doesn't result in the suit having more inventory slots. I'm very very new to modding with Satisfactory so I'm unsure as to what class I should be modifying. Desc seems to contain the properties for the items as it appears in the players inventory and it looks like the Equip classes contain more specifics about suit functionality and properties.

Anyways thanks for your help!

budak7273 commented 10 months ago

The properties for modules are on the descriptors as you've already found out, but the suits are a bit different, they are on a subcomponent of the equipment actor. ContentInspector should be able to tell you what the "path" of that is. Here's a screenshot from my editor: image

afewvowels commented 10 months ago

Lol I'm coming off a pretty long stint of Zomboid/Factorio lua scripting/modding so I've been trying to avoid getting into Visual Studio/Unreal Editor hence the emphasis on ContentLib and CDOs. I'm working on getting the plugin built and installed. Before I posted this thread I got the plugin and it's dependencies downloaded (ArmorModules, PowerSuit, SML and MAMTips, yes?) however I got a very unhelpful "failed to build plugins" popup and nothing else.

Right now I've got Visual Studio up and running and the error I'm trying to resolve is why Visual Studio can't open standard/vanilla header files like stdarg.

This could take awhile lol.

afewvowels commented 10 months ago

For posterity and those who may come later here is an update. I followed the directions on setting up the Satisfactory Unreal Development Environment which are comprehensive but there are quite a few steps. I stumbled at the build/rebuild development/shipping stages and had to delete my project directory for about a day before everything compiled and the project opened. Now I am looking at nodes and trying to puzzle out what is going on.

Status: progress??

Equip_PowerSuit_Parent 12_2_2023 3_50_02 PM

afewvowels commented 10 months ago

Lol well that didn't take long for progress. I've isolated the variable I want to modify and it looks like the fastest path to it (just watched a Verisatum Youtube about the MicroMouse competitions, highly recommend btws) is File > Open Asset and then to make sure the "Show Plugin Content" is selected in the gear icon/menu in the top left of the window and then to search Equip_BiofuelSuit. Scrolling down through the asset will reveal the Power Suit > EMC Module that budak mentioned earlier and the Inventory Slots is located under the EquipmentModule.

I'm going to try and use ContentInspector to see how this interlocks in the game so I can write a simple CDO file to modify these values rather than try and do a full mod/plugin export so I'll post updates soon-ish.

Equip_BiofuelSuit 12_2_2023 3_57_47 PM

afewvowels commented 10 months ago

I'm going to close this since I ended up compiling the mod with new inventory values for the different suits. I'd like to return to this and make the modifications with ContentLib and CDO modifications because a few simple JSON files seems like a better more shareable solution than having to download a custom Unreal Engine and building a ton of files and exporting a custom mod.

Anyways thanks so much for making your source files available as this has been a wonderful learning opportunity, cheers!

budak7273 commented 10 months ago

@afewvowels Whoops, I had typed up a response to your Nov 29th message but never sent it... the gist was "you don't need the editor for CL CDOs but it helps understanding stuff." Glad you got the mod building with your desired changes. Maybe next up is your own modules 👀?

Heads up, you may have some visual glitches with GUIs because of how they are packaged (if you don't have all the correct image assets at packaging time it will sometimes mess things up)

I check my Discord more often than my github notifications, so if you have any further questions, please either open another issue (which pings me on discord) or message me there.