Context:
Prompted by my work for: https://github.com/CleverRaven/Cataclysm-DDA/issues/26183, I am working on expanding my script to read in and perform the inheritence for all json objects (starting w/ ter, furn and will go from there. Not planning to include buildings). I plan to subsequently load this information into a MySQL database and host it on one of the computers lying around my house. Mainly this is for practice working with databases and learning how to set up a server but hopefully it will be useful as well.
Questions
-
What do optional members default to / is there an easier way to find out than looking through their factory code? json_info.md isn’t very helpful here. (Currently I assume numeric values to be zero)
i. Some items use
proportional
and/orrelative
to inherit and modify values that haven’t been explicitly set. Currently in these cases I assume that the inherited value is zero.ii. Can someone explain this bit of the item category defaulting code:
item_factory.cpp Lines 2537-2341
bool weap = std::any_of( obj.melee.begin(), obj.melee.end(), []( int qty ) {
return qty > MELEE_STAT;
} );
return weap ? "weapons" : "other";
-
Some member values can be given using different units (e.g. volume -> 1/4L, L, ml). Presumably the game converts them into one standard unit; what is it / are they?
i. What besides volume and the newly updated duration members allow multiple units?
-
Are the json objects separated into different files purely for organization or is their location used in some way. (Not asking about load order hierarchies but within a dir level)
-
Are there any values generated by the game other than armor and moves per attack?
-
Are IDs globally unique or could one say give the same id to an item and a martial art?