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.

Solution:
Jump to 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

20 Replies
I don't think ContentLib CDO edits work on arbitrary structs; I haven't looked into exactly how Nog implemented it
I think that's not a struct, but an object
oh, good point, that picker on the index means it's probably one of those inline created objects...
I guess it would work similarly to schematic unlocks
Thing is, I believe schematic unlocks have special handling?
yeah CL does schematic unlocks in a separate system
So can i create such object in JSON patch and replicate all of its fields?
unsure
ideally you do not want to replicate all of its fields and only specify the one you want to change
this is the code that implements the CDO edit feature https://github.com/Nogg-aholic/ContentLib/blob/master/Source/ContentLib/Private/CLCDOBPFLib.cpp#L95
GitHub
ContentLib/Source/ContentLib/Private/CLCDOBPFLib.cpp at master · No...
Contribute to Nogg-aholic/ContentLib development by creating an account on GitHub.
I was able to change it in ContentInspector though
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
I see, thanks
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
This is the best result I got from the SMD :
https://docs.ficsit.app/satisfactory-modding/latest/Development/ModLoader/SimpleConstructionScript.html
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...
I don't think ammo has that issue, but the rifle for example does
Okay, i decided to start from what looked the simplest way, but i guess i should look into creating proper mods
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
For ammo it did change rate of fire, ammo, dispersion with no problems, yes
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
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

Hmmm, looks like it's a subobject