Author Topic: Separate rul files within one mod  (Read 2655 times)

Offline Kzer-Za

  • Colonel
  • ****
  • Posts: 140
    • View Profile
Separate rul files within one mod
« on: August 10, 2019, 07:26:54 am »
What are the rules for organizing them? I tried to split different parameters of my mod into separate files but it sometimes leads to the changes not applying. Example: I gave all human armors melee attacks by adding to armors "specialWeapon". But I also wanted to tweak some other armor parameters, so I created 2 rul files: one that just adds specialWeapon and contains an "item" section describing that weapon, the other file contains tweaks to other armor parameters. But as soon as I moved these tweaks into a separate file, they stopped affecting the game. Also after creating two files with "item" section, some parameters in one of these files also stopped affecting the game. If I keep all changes pertaining to one section within one file, all the changes are applied.

So, does it mean that one section, such as "armor", "items", or "units" should be only within one file? Or is there a way to organize them in separate files (apart from splitting them into separate mods)?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Separate rul files within one mod
« Reply #1 on: August 10, 2019, 10:22:20 am »
Attach your mod.
The one that is not working.

Offline Kzer-Za

  • Colonel
  • ****
  • Posts: 140
    • View Profile
Re: Separate rul files within one mod
« Reply #2 on: August 10, 2019, 11:07:26 am »
In the power_armors.rul I try to increase the power suit thickness and decrease it for the flying suit. In unarmed_humans.rul also there's an "armor" section for giving them unarmed attacks. In my installation the attack is added but the thickness remains original. If I combine "armor" sections into one file, the thickness also changes as specified.

Also in items_my.rul I added "blockBothHands: true" to all large weapons (anything bigger than rifle). But in game I can give my soldiers any item into their "free" hand, even in the main hand they are holding a large weapon. And I could not while all "item" sections were in one file.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Separate rul files within one mod
« Reply #3 on: August 10, 2019, 06:15:44 pm »
In the power_armors.rul I try to increase the power suit thickness and decrease it for the flying suit. In unarmed_humans.rul also there's an "armor" section for giving them unarmed attacks. In my installation the attack is added but the thickness remains original. If I combine "armor" sections into one file, the thickness also changes as specified.

In one file you are modifying
  - type: STR_POWER_SUIT_UC
  - type: STR_FLYING_SUIT_UC
and in the other file
  - type: STR_POWER_SUIT
  - type: STR_FLYING_SUIT

either one of them is wrong or you are modifying different armors...

Also in items_my.rul I added "blockBothHands: true" to all large weapons (anything bigger than rifle). But in game I can give my soldiers any item into their "free" hand, even in the main hand they are holding a large weapon. And I could not while all "item" sections were in one file.

you can always give them weapons in both hands and carry them, you just can't use the weapon that needs 2 hands...
« Last Edit: August 10, 2019, 06:18:05 pm by Meridian »

Offline Kzer-Za

  • Colonel
  • ****
  • Posts: 140
    • View Profile
Re: Separate rul files within one mod
« Reply #4 on: August 10, 2019, 07:09:40 pm »
Oh, must be false memory, about blockBothHands. And it was a stupid mistake about armors :-[ Thanks, and sorry to disturb you!