df-structures icon indicating copy to clipboard operation
df-structures copied to clipboard

Enum df.world_data.world_region_type same as df.world.worldgen_region_type

Open PatrikLundell opened this issue 8 years ago • 4 comments

The title refers to the .XML files the enums reside in. The enums have the "same" values in the same order. The mixed case enums in the former type have different names with broadly the same meaning in some cases ('Jungle' vs 'FOREST', 'Steppe' vs 'GRASSLAND'). Since the latter enum's values match what's used by DF itself through the world generation files, that is probably the type that should remain.

PatrikLundell avatar Oct 10 '16 07:10 PatrikLundell

'forest' (lowercase) also features in df.units.xml - https://github.com/DFHack/df-structures/blob/0e8313dc86617796b7145a306df274a882474175/df.units.xml#L13

comment='used for units no longer linked to merchant/diplomacy, they just try to leave mostly'/>

FantasticFwoosh avatar Oct 28 '16 23:10 FantasticFwoosh

@FantasticFwoosh that instance of "forest" has absolutely nothing to do with biomes or region types - it just means they want to "return to the forest".

quietust avatar Oct 28 '16 23:10 quietust

world_region_type is an int16_t and worldgen_region_type is an int32_t. Is that a problem?

dscorbett avatar Jun 20 '17 19:06 dscorbett

Somewhat. Currently, only fields of an enum type whose size matches the size of the enum's base type are treated as enum fields in Lua. For example, building_screw_pumpst.direction will be displayed as a screw_pump_direction in gui/gm-editor (with fancy names), but building_rollersst.direction will not (because its type, int32_t, does not match the enum's base type, int8_t).

lethosor avatar Jun 20 '17 19:06 lethosor