Closed TSlam1993 closed 1 year ago
Modding State of Decay 2.
If i try to add data that is of ArrayProperty or StructProperty it shows the error (attached image).
Other types add without errors - for example, ObjectProperty, BoolProperty etc.
To reproduce error:
- Open: _StateOfDecay2\Content\GameSystems\Facility\FacilityTypes\Armory\CategoryActions_Explosives\Armory_SubAction_CraftExplosiveGrenade
- Navigate: Code Blocks - Block 2 - UnlockRequirements
- Try to "add data" with property type set as "ArrayProperty".
Using header references instead of typing/pasting "ArrayProperty" doesn't work (says "type doesn't exist"), importing blocks from other files doesn't work (saving gives "address" error). Editor is set on 4.13 version.
Yes, like the error says you can only add certain properties, array properties are more complex and require you to import an already existing one instead of adding it. I don't know the particulars as to why this is exactly but I do know it's not a bug or anything. Maybe Helios will chime in explain a bit further.
I haven't ever had a situation where I needed to add an array property, what are you trying to do? Also I recommend using the SoD2 Modding discord for other questions like this, you'll find many people there who can help out.
Thank you!
At least you confirm that this works as "intended" and not my personal bug.
Regarding what i am doing to cause it - just simply trying to add some simple general elements to facility actions - like skill requirement or additional cost of chemicals for (for some reason parts and resources are added like "resourceCost", while chemicals and other crafting resources are in "itemCost", which means they are in completely different code blocks).
For example: i have a CraftGrenade action (took it from Armory facility), it has no skill requirement, so i want to add a data field with skill requirement info to the UnlockRequirements block. In the CraftC4 file (that also belongs to Armory facility) there is a skill requirement block in the UnlockRequirements block - so i try to export it and import in CraftGrenade, but it cannot save after importing (some weird "address" error). Same thing for ItemCostLevels - if i want to add a chemical cost for grenade - i can't do that, because there is no existing ItemCost (only ResourceCost), so another important part of creating action is not working.
Is this because there are different headers in both files, so importing is incompatible? Importing-exporting works when it is done to the same file, so adding new functionality is simply impossible?
I am trying to figure out a proper approach and i guess i'll have to use CraftC4 as a template for every CraftAction, because it has both skill requirement and ItemCost blocks, which means i can just import-export them.
Modding discord have not been succesfull at addressing this issue.
EDIT: Exporting-reimporting works only for some code blocks. I mentioned two in the post:
FacilityItemCostLevel exports and reimports into ItemCostLevels without issues.
But CommunityStatValueRequirements form UnlockRequirements do not - editor can't save even if export-import is done to the same file. I suspect the reason is weird behavior of "Value1" field - it reimports incorrectly and shows header index on mouse hover, but it doesn't transform header indexes - the value seems to behave like a string. It's extremely confusing.
Not in front of my PC, but a bit later I can go take a look at the asset you're talking about. I haven't modded SoD2 in a good while but do use editor regularly still.
That would be very nice if you could check this problem out.
I SOLVED IT!
Apparently - when you export and import CommunityStatValueRequirements (that is a struct that holds CommunityStatValueRequirement blocks) from UnlockRequirements and import them the Value1 field will for some reason be set as "CommunityStatValueRequirement" instead of "StructProperty" - because of that attempting to save will result in weird "Address" error.
Solution to this problem is to import the CommunityStatValueRequirements and before saving manually change Value1 from "CommunityStatValueRequirement" to "StructProperty" - then you can save and it will work fine!
Took me a lot of time to figure out.
Glad you figured it out, I just sat down to take a look and realized you were actually Modding the Armory lol. I made an armory mod if you wanted to take a look there are a few out there, you can just unpack them and look what other Modders did, that's how I learned when I had issues.
Here is the modding discord I was talking about. I definitely recommend you join as this is where asset editor is discussed in much more detail as well as engine and texture modding. https://discord.gg/Cw2V4w9tVd
Thanks!
I actually also posted this issue on discord, but ironically it have been almost completely ignored.
By the way, i'm going to use this chance - since you have modded armory, do you know if there is a way to replicate armory's "ability" to hold more than 5 acitons in a subcategory?
It is a common knowledge in community that facility actions should be added in subcategories limited up to 5 actions each, but Armory has ten actions grouped together without an issue (explosives crafting, ammo crafting).
Would like to hear if you know anything about that.
Hey, Tenoz!
I'm writing here because Github doesn't support sending personal messages and I have left the modding discord:
I have finished the mod I was making and have mentioned you in the "special thanks" section!
You can check it out here: https://www.nexusmods.com/stateofdecay2/mods/950
Again - thanks for helping with the issue :)
Modding State of Decay 2.
If i try to add data that is of ArrayProperty or StructProperty it shows the error (attached image).
Other types add without errors - for example, ObjectProperty, BoolProperty etc.
To reproduce error:
Open: _StateOfDecay2\Content\GameSystems\Facility\FacilityTypes\Armory\CategoryActions_Explosives\Armory_SubAction_CraftExplosiveGrenade
Navigate: Code Blocks - Block 2 - UnlockRequirements
Try to "add data" with property type set as "ArrayProperty".
Using header references instead of typing/pasting "ArrayProperty" doesn't work (says "type doesn't exist"), importing blocks from other files doesn't work (saving gives "address" error). Editor is set on 4.13 version.