OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Support => Topic started by: The Reaver of Darkness on September 17, 2018, 10:19:45 am
-
In a mod I made a change to the itemSets on one particular rank on one deployment, and the mod ran fine but attempting to get into a mission with that UFO caused the game to hang. With some trial and error I discovered that if I provide data for the itemSets without providing data for the rank quantity, the game hangs.
This code will cause the game to hang:
alienDeployments:
- type: STR_MEDIUM_SCOUT
data:
- alienRank: 4
itemSets:
-
- STR_PLASMA_PISTOL
- STR_PLASMA_PISTOL_CLIP
- STR_MIND_PROBE
-
- STR_PLASMA_RIFLE
- STR_PLASMA_RIFLE_CLIP
- STR_MIND_PROBE
-
- STR_HEAVY_PLASMA
- STR_HEAVY_PLASMA_CLIP
- STR_MIND_PROBE
This code will not cause the game to hang:
alienDeployments:
- type: STR_MEDIUM_SCOUT
data:
- alienRank: 4
lowQty: 1
highQty: 2
dQty: 1
itemSets:
-
- STR_PLASMA_PISTOL
- STR_PLASMA_PISTOL_CLIP
- STR_MIND_PROBE
-
- STR_PLASMA_RIFLE
- STR_PLASMA_RIFLE_CLIP
- STR_MIND_PROBE
-
- STR_HEAVY_PLASMA
- STR_HEAVY_PLASMA_CLIP
- STR_MIND_PROBE
Am I just supposed to include all of the data that I'm not making changes to? How much do I need to include to avoid resetting values to defaults?
I'm not sure if this relates to OXCE+ or OXC.
-
Difficult question, because there are exceptions for everything.
But in general:
1. Top-level single-value attributes get inherited from parent
Example: you don't have to redefine a cost of a research topic
2. Going deeper than top-level (e.g. by specifying an array of values) usually removes all old values before new values are loaded by a mod
Example: when you want to add a research dependency, you cannot just add the one missing... you need to specify all of them in the mod... because they get deleted and reloaded...
... same for your deployment question... the "data" attribute is an array that gets deleted and reloaded
PS: same in OXC and OXCE+
-
Okay I get it, thanks!