Author Topic: How to give ability to repair things to all who has some repairing tool?  (Read 1366 times)

0 Members and 1 Guest are viewing this topic.

Offline Ivkolya

  • Sergeant Major
  • *
  • Posts: 333
    • View Profile
  • Nick: Ivkolya
  • Side: Neutral
How to give an ability to repair things to all, who has the construction hammer? And it will be better that only sappers can BUILD anything, and other units with hammer can only REPAIR it. Or maybe someone can explain me, how to make another tool, which will repair things instead of delivering damage?

I found in scripts some lines with sapper stuff and changed what I thought can help, but nothing changed - if another unit holds the construction hammer, he destroys everything instead of repairing. But it will be interesting and more realistic, if engineer will place some props accordingly to fortification science, and common soldiers will build what he says. So I really hope someone can help me with this and maybe other modders can use this idea :)
« Last Edit: August 09, 2018, 12:22:57 pm by Shadow »

Offline Ivkolya

  • Sergeant Major
  • *
  • Posts: 333
    • View Profile
  • Nick: Ivkolya
  • Side: Neutral
After a lot of trials and errors I found easy solution, which is OK for me. In module_scene_props.py instead of
Code
        # we has a sappeur :3
        (troop_slot_eq,":troop_id",slot_troop_class,multi_troop_class_mm_sapper),

paste

Code
        # we has a sappeur :3
        (this_or_next|troop_slot_eq,":troop_id",slot_troop_class,multi_troop_class_mm_sapper),
                           (troop_slot_eq,":troop_id",slot_troop_class,multi_troop_class_mm_infantry),

Or add all troop_classes you want (copy first line, of this code, paste it over last line, and instead of multi_troop_class_mm_sapper write your troop class)

I hope, it will help somebody and save time :)