How to CDO edit a complex data type?

I'm trying to patch the rifle ammo descriptor file using ContentLib. I successfully modified simple fields like mMagazineSize, but the damage field is inside of mDamageTypesOnImpact field, which is an array of something that has a value selected from a dropdown and without a property name, and then inside of that there's a list of fields and mDamageAmount is one of those. How do i write a JSON patch to mod the damage field? I can do it in game using the Content Inspector mod, but i don't know how to do it in JSON patch. In docs there's no examples for such data types.
"Edits": [
{
"Property": "mMagazineSize",
"Value": 100
},
{
"Property": "mDamageTypesOnImpact",
"Value": "???"
}
]
"Edits": [
{
"Property": "mMagazineSize",
"Value": 100
},
{
"Property": "mDamageTypesOnImpact",
"Value": "???"
}
]
No description
Solution:
Ha, what a coincidence! I was just browsing all mods at ficsit.app and found a mod that does exactly what i was trying to do yesterday here: https://ficsit.app/mod/UsefulTurboAmmo Turns out the correct way to patch that object inside of mDamageTypesOnImpact array is to patch that file separately. The name of that class can be seen from the editor, and after that you go and create another CDO patch and target class /Game/FactoryGame/Equipment/Rifle/Ammo/Desc_CartridgeChaos.Default__Desc_CartridgeChaos_C:BP_PointDamageType_Physical_C_0 and its property mDamageAmount....
Useful Turbo Ammo - SMR
Make Turbo Rifle Ammo actually useful
No description
Jump to solution
20 Replies
Robb
Robb3w ago
I don't think ContentLib CDO edits work on arbitrary structs; I haven't looked into exactly how Nog implemented it
Rex
Rex3w ago
I think that's not a struct, but an object
Robb
Robb3w ago
oh, good point, that picker on the index means it's probably one of those inline created objects...
Rex
Rex3w ago
I guess it would work similarly to schematic unlocks Thing is, I believe schematic unlocks have special handling?
Robb
Robb3w ago
yeah CL does schematic unlocks in a separate system
SerGreen
SerGreenOP3w ago
So can i create such object in JSON patch and replicate all of its fields?
Robb
Robb3w ago
unsure ideally you do not want to replicate all of its fields and only specify the one you want to change
Robb
Robb3w ago
GitHub
ContentLib/Source/ContentLib/Private/CLCDOBPFLib.cpp at master · No...
Contribute to Nogg-aholic/ContentLib development by creating an account on GitHub.
SerGreen
SerGreenOP3w ago
I was able to change it in ContentInspector though
Robb
Robb3w ago
it is doing more unreal reflection stuff than I personally understand, but it does have some kind of handling for FObjectProperty, FClassProperty, and FStructProperty, so... maybe? but I don't know what the syntax would be. you might be able to infer it from the code content inspector works on a different system that goes directly through unreal reflection stuff with no middleman content lib may not have the stuff in the middle to go from json -> nested property on an object
SerGreen
SerGreenOP3w ago
I see, thanks
Robb
Robb3w ago
if you are planning to make equipment edits, you should probably make a full mod, because there is also some weird behavior with equipment ignoring CDO edits Digby and Drew worked around it recently by using SCS Hooks on the equipment actors to apply the property changes when the equipment actors spawn >docsearch SCS hook
FICSIT-Fred
FICSIT-Fred3w ago
Simple Construction Script (SCS) Hooks :: Satisfactory Modding Docu...
Introduced in SML3.5, Blueprint Simple Construction Script hooks allow adding modded Components to any blueprint-based actor. Mods can def...
Robb
Robb3w ago
I don't think ammo has that issue, but the rifle for example does
SerGreen
SerGreenOP3w ago
Okay, i decided to start from what looked the simplest way, but i guess i should look into creating proper mods
Robb
Robb3w ago
yeahhh, sorry CL isn't capable of doing this yet. there's a lot on my list and extending CL is not very high up on it right now
SerGreen
SerGreenOP3w ago
For ammo it did change rate of fire, ammo, dispersion with no problems, yes
Rex
Rex3w ago
I even had issues when changing the damage parameters in the equipment (in my case, a subclass of the Xeno-Basher). I had to make a subclass of whatever damage type I wanted to tweak, change the parameters in there, and use that class in the equipment
Solution
SerGreen
SerGreen3w ago
Ha, what a coincidence! I was just browsing all mods at ficsit.app and found a mod that does exactly what i was trying to do yesterday here: https://ficsit.app/mod/UsefulTurboAmmo Turns out the correct way to patch that object inside of mDamageTypesOnImpact array is to patch that file separately. The name of that class can be seen from the editor, and after that you go and create another CDO patch and target class /Game/FactoryGame/Equipment/Rifle/Ammo/Desc_CartridgeChaos.Default__Desc_CartridgeChaos_C:BP_PointDamageType_Physical_C_0 and its property mDamageAmount.
Useful Turbo Ammo - SMR
Make Turbo Rifle Ammo actually useful
No description
Rex
Rex3w ago
Hmmm, looks like it's a subobject

Did you find this page helpful?