Author Topic: How to stop aliens from carrying extra equipment?  (Read 2902 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
How to stop aliens from carrying extra equipment?
« on: October 24, 2021, 09:14:09 pm »
(Problem)
The Deep One is carrying extra weapons.

Spoiler:




(Mod Download)
I've attached a version of this mod with the alienRaces: all set to be the Deep One to make testing vs that unit easier:
Deep One Weapon V0-2(Error).zip


(Details)
I've been working on a small mod to give the Deep One a weapon to match its Ufopaedia description.

I think it is almost ready for use however I've run into a snag.

The Deep One is carrying extra weapons and should only be carrying its own special weapon and two ammo items for it.

The Deep One's armor now has [armors:]allowInv: set to true as it wasn't accepting the list of [armors:]builtInWeapons: being assigned to it.

However now it appears to be also carrying the weapons from the [alienDeployments:]itemSets: section.

I thought that [armors:]builtInWeapons: or [units:]builtInWeaponSets: would cancel out the equipment from [alienDeployments:]itemSets: but it appears that is not the case.

How do you make a unit only carry the equipment you assign directly to it?
« Last Edit: November 24, 2021, 08:24:59 am by The Martian »

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: How to stop aliens from carrying extra equipment?
« Reply #1 on: October 25, 2021, 02:05:12 am »
(Edit: I solved why they kept getting equipment even after the itemSets: had been blanked.)


In an attempt to get rid of the default equipment given to the aliens each mission I tried blanking the [alienDeployments:]itemSets: lists but they are still all carrying sonic weapons?

Where else is their equipment assigned?

(Example .rul file)
alienDeployments_Example.rul



(Details)
I've tried using:
Code: [Select]
alienDeployments:
  - delete: STR_SURVEY_SHIP
  - delete: STR_ESCORT
  - delete: STR_CRUISER
  - delete: STR_HEAVY_CRUISER
  - delete: STR_HUNTER
  - delete: STR_BATTLESHIP
  - delete: STR_DREADNOUGHT
  - delete: STR_FLEET_SUPPLY_CRUISER
  - delete: STR_PORT_TERROR
  - delete: STR_ISLAND_TERROR
  - delete: STR_CARGO_SHIP_P1
  - delete: STR_CARGO_SHIP_P2
  - delete: STR_CRUISE_SHIP_P1
  - delete: STR_CRUISE_SHIP_P2
  - delete: STR_ARTIFACT_SITE_P1
  - delete: STR_ARTIFACT_SITE_P2
  - delete: STR_ALIEN_BASE_ASSAULT
  - delete: STR_ALIEN_COLONY_P2
  - delete: STR_BASE_DEFENSE
  - delete: STR_TLETH_P1
  - delete: STR_TLETH_P2
  - delete: STR_TLETH_P3


And then re-adding each of the alienDeployments: entries with blank itemSets: like this:
Code: [Select]
  - type: STR_SURVEY_SHIP
    data:
      - alienRank: 5
        lowQty: 1
        highQty: 1
        dQty: 0
        percentageOutsideUfo: 50
        itemSets:
          -
            []
          -
            []
          -
            []
    width: 50
    length: 50
    height: 4
    briefing:
      palette: 4
      music: GMISPOSH


But the deployments stay deleted and do not show up again in the "New Battle" mission generator's "Mission" tab.



I've attached an example .rul file containing the altered alienDeployments: to better explain what I mean.

Please if anyone knows why the aliens are still holding weapons let me know, as far as I can tell it doesn't make sense.

The deployments are blank, shouldn't that mean an empty alien inventory?
« Last Edit: October 25, 2021, 03:07:32 am by The Martian »

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: How to stop aliens from carrying extra equipment?
« Reply #2 on: October 25, 2021, 02:12:30 am »
I think I got it!

alienDeployments: was placed twice in the same .rul file.

When the second instance was removed the re-added deployment functioned correctly and the alien appeared without any equipment!



This is 'a' solution, but is it the correct way to prevent aliens from having extra equipment?

Is there a way to set a unit to only use equipment as assigned via [armors:]builtInWeapons: or [units:]builtInWeaponSets: or do you have to completely blank the [alienDeployments:]itemSets: if you are going to use the armor or unit method?

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: How to stop aliens from carrying extra equipment?
« Reply #3 on: November 01, 2021, 07:26:14 pm »
Anything with this setting ignores equipment loadouts:
Code: [Select]
    livingWeapon: true
Pro-tip: You can troubleshoot your mods by comparing them with either the vanilla ruleset or other mods which function correctly. You can also check the ruleset reference to find out what each function does.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: How to stop aliens from carrying extra equipment?
« Reply #4 on: November 02, 2021, 10:21:26 am »
Anything with this setting ignores equipment loadouts:
Code: [Select]
    livingWeapon: true

I saw the the livingWeapon: setting but it also lists a secondary effect that I'm worried may be a problem.

Quote
If yes, it ignores any weapon loadout associated with its rank in the alien deployment and only attacks with a weapon derived from its race name (must be marked as fixedWeapon). The weapon's name is the unit's race name without the first 4 letters (STR_) and with a suffix (_WEAPON). For example: STR_REAPER => REAPER_WEAPON.

The units I'm working with are carrying several items they need to be able to attack with not just a unit's fixedWeapon: item and I need them to be able to drop the weapon if they panic or stun.


Pro-tip: You can troubleshoot your mods by comparing them with either the vanilla ruleset or other mods which function correctly. You can also check the ruleset reference to find out what each function does.

I agree 100% and that is exactly how I've been coding.

With the ruleset reference always open in a second window and diving through the larger mods .rul files to find proper syntax when using a new command.

The fact that OXCE keeps .rul files of all the base settings in ../standard/xcom1/ & ../standard/xcom2/ has proven to be invaluable in learning the proper formatting.
« Last Edit: November 02, 2021, 10:23:03 am by The Martian »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: How to stop aliens from carrying extra equipment?
« Reply #5 on: November 02, 2021, 06:40:28 pm »
You can adjust their loadout in alienDeployments. It is done by rank. If you want a specific ship to give a certain rank one loadout sometimes and a different loadout other times, you can make two different ships that look the same and have the same name but have separate entries in alienDeployments. Then you can call the one you want in alienMissions under waves. You can also do it more randomly by using alienItemLevels.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: How to stop aliens from carrying extra equipment?
« Reply #6 on: November 20, 2021, 12:20:58 am »
(Sorry about the long delay in my reply)

I've been experimenting with livingWeapon: and it does not appear to prevent the unit from attacking with non-fixed weapon's or throwing grenades.

That will work perfectly!

Thank you very much for the help.


And thanks for the tip about alienDeployments: & alienMissions: waves. That's definitely an easier way to set it up than I'm currently using.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: How to stop aliens from carrying extra equipment?
« Reply #7 on: November 20, 2021, 08:09:16 am »
Glad to help! Definitely ask for advice on easier methods before you commit to any excessively tedious method.