How to change what engineers can build in mods?

As the title says. How do I do it?

you may be interested in this thread:

( particular by it’s replies of our lord and savior Devenddar ).

it’s a bit outdated. as the entities were not working.

but yeah, i suggest you to try with the entities as now those do work unlike before.

1 Like

If you want to unlock structures (anti-tank/anti-air cannon, machineguns and e.t.c.) for custom profile squad then you need to add "engineerUnlocks" : [ X ], or "engineerUnlocks" : [ X, X ] to squad (X is building slot that locked. IIRC it can be between 1 and 5) and engineer tool to any soldier in squad.

If you want to just give new structures for old squads and e.t.c. Then you will need to code it. Need to edit entities.blk file. Need to change …_tool_gun /…_tool_award_gun entities and buildingLimits and previewTemplate properties.

Code example:

ussr_moon_building_tool_gun{
  _override:b=yes

  "buildingLimits:list<i>"{
    item:i=100
    item:i=300
    item:i=600
  }

  "previewTemplate:list<t>"{
    item:t="ger_rallypoint_preview"
    item:t="sandbags_wall_1_preview"
    item:t="sandbags_wall_3_preview"
  }
}

This code changes engineer tools from moon event.

If you want to add new template that don’t contains preview template then for some reasons better to add this preview entity.

New building structure code example:

ri_entity__normandy_bunker_a102_walls_preview{
  _extends:t="base_rendinst_builder_preview"
  instantiateTemplate:t="ri_entity__normandy_bunker_a102_walls"
  ri_preview__name:t="normandy_bunker_a102_walls"
  buildingSoundTag:t="fortification"
  building_builder__maxTimeToBuild:r=10.0
  building_menu__text:t="Bunker"
  building_menu__image:t="bunker"
}

ri_entity__normandy_bunker_a102_walls{
  _extends:t="game_rendinst_decor"
  ri_extra__name:t="normandy_bunker_a102_walls"
}

New gameplay feature code? In other words ability to build vehicles:

gaz_67_preview{
  _extends:t="base_animchar_builder_preview"
  animchar__res:t="pv_gaz_67_char"
  collres__res:t="pv_gaz_67_collision"
  instantiateTemplate:t="gaz_67"
  buildingSoundTag:t="fortification"
  building_builder__maxTimeToBuild:r=5.0
  building_menu__text:t="gaz_67"
  building_menu__image:t="map_icon_car"
  buildingDistance:r=12.5
  additionalHeight:r=1.0
  avaliableAngles:p2=-30.0, 30.0
}

You can add gaz_67_preview and ri_entity__normandy_bunker_a102_walls_preview inside previewTemplate property.

2 Likes

tommy have done this a lot he can help