61
DF Modding / Re: [MODDING] CREATURE & ENTITY QUESTIONS THREAD
« on: May 29, 2020, 04:12:34 pm »How do I restrict entities to producing say bronze or iron weaponry? I'm making a CIV-inspired mod where eras (entries in this case) are limited by weapon-grade metals. modifying inorganic_metal.txt might be enough, but I want specific entities, not all of them. I'm using HAS_ITEM_REACTION_PRODUCT to limit them.Code: [Select]
[REACTION:MAKE_IRON_DAGGER]
[NAME:make iron dagger]
[BUILDING:METALSMITH:CUSTOM_T]
[REAGENT:A:1:BAR:INORGANIC:NONE:NONE]
[HAS_ITEM_REACTION_PRODUCT:IRON_AGE_WEAPONRY_DAGGER]
In the product, if you want to use the reagent's material itself, use NONE instead of a reaction product class (TAN_MAT in this example).
[PRODUCT:100:1:GET_ITEM_DATA_FROM_REAGENT:A:IRON_AGE_WEAPONRY_DAGGER]
[FUEL]
[SKILL:FORGE_WEAPON]
What you have to do is remove all the [PERMITTED_REACTION:metal_MAKING] tags from the entity. so only [PERMITTED_REACTION:BRONZE_MAKING] remains. that way the civ will be restricted to bronze and copper.
A different, but similar trick I've figured out is to try making specific metals which are that-civ-only (say, maybe something like [ANCIENT_BRONZE] or [IRON_AGE].) Here are the related changes for the elf metal I made for my elf civ using this method.
In entity_default I added:
[PERMITTED_REACTION:ELF_METAL_MAKING] to the elf civ. (Do NOT add it to any other civs.)
In inorganic_metal:Spoiler (click to show/hide)
In reaction_other:
[REACTION:ELF_METAL_MAKING]
[NAME:make elfblade]
[PRODUCT:100:9:BAR:NO_SUBTYPE:ELF_METAL][PRODUCT_DIMENSION:150]
[SKILL:CARPENTRY]
The only bugs I'm working out is the fact that somehow elfblade appears as a metal in the metalsmith's forge menu, and you can make stuff out of it by melting elf weapons (doesn't happen in worldgen, though.)
Just change the name from [ELF_METAL] to something like [ANCIENT_BRONZE] and it should work, so long as you add everything mentioned here. No need to go too in-depth with the reaction system so long as you know what you're doing!
Ok. Now another one. How do you get civs to make stone weapons only/make non-metallic weaponry? Again, I'm using HAS_ITEM_REACTION_PRODUCT. I'm inspired by a mod by the name of Tribal Fortress.
reaction_civ0.txt
Code: [Select]
[REACTION:MAKE_STONE_AXE]
[NAME:make stone axe]
[BUILDING:CRAFTSMAN:CUSTOM_T]
[REAGENT:A:1:NONE:INORGANIC:NONE:NONE]
[b][HAS_ITEM_REACTION_PRODUCT:STONE_WEAPONRY][/b]
[REAGENT:B:1:WOOD:NONE:NONE:NONE]
In the product, if you want to use the reagent's material itself, use NONE instead of a reaction product class (TAN_MAT in this example).
[PRODUCT:100:1:GET_ITEM_DATA_FROM_REAGENT:A:STONE_WEAPONRY]
[SKILL:STONECRAFT]
inorganic_stone_layer.txt:
Code: [Select]
[INORGANIC:CHERT]
[USE_MATERIAL_TEMPLATE:STONE_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:chert][DISPLAY_COLOR:6:7:0][TILE:'=']
[SEDIMENTARY]
[IS_STONE]
[MELTING_POINT:13101]
[SOLID_DENSITY:2650]
[b][ITEM_REACTION_PRODUCT:STONE_WEAPONRY:WEAPON:ITEM_WEAPON_AXE_BATTLE:STONE_TEMPLATE:BOULDER][/b]
[ITEM_REACTION_PRODUCT:STONE_WEAPONRY2:WEAPON:ITEM_WEAPON_SPEAR:STONE_TEMPLATE:BOULDER]
[ITEM_REACTION_PRODUCT:STONE_WEAPONRY3:WEAPON:ITEM_WEAPON_MACE:STONE_TEMPLATE:BOULDER]
[ITEM_REACTION_PRODUCT:STONE_WEAPONRY4:AMMO:ITEM_AMMO_ARROWS:STONE_TEMPLATE:BOULDER]







































