Author Topic: [DONE][Suggestion] Allowed soldier groups per craft  (Read 4282 times)

Offline Yankes

  • Commander
  • *****
  • Posts: 3246
    • View Profile
Re: [Suggestion] allowedSoldierType function for craft
« Reply #15 on: July 25, 2022, 02:23:34 am »
Question if better option would be limit by armor type?
Image XFiles where you have submarine and only armors for underwater are allowed.
Or car where you can't fit power armor.

@Delian

Unique new tag have benefits, it make easier to maintain Cartesian cross of all crafts and solders/armors.
With simple list of types when you add new solder you need visit all crafts to update one where it could use it.
With new tag you only copy paste config from other unit.

I think it could be implemented similarly to base functions where you can create new types on the fly.

Offline thusky

  • Sergeant
  • **
  • Posts: 29
    • View Profile
Re: [Suggestion] allowedSoldierType function for craft
« Reply #16 on: July 25, 2022, 07:40:15 am »
Question if better option would be limit by armor type?
Image XFiles where you have submarine and only armors for underwater are allowed.
Or car where you can't fit power armor.

------

I think it could be implemented similarly to base functions where you can create new types on the fly.

That's very good news! Of course I imagine more people would need to vouch for the suggestion before it gets on the waitlist? Would that be correct?

And yes! Armor type could also be the answer as mentionned in the presentation thread, it could really be either soldier/armor or both I think.
« Last Edit: July 25, 2022, 07:42:27 am by thusky »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8711
    • View Profile
Re: [Suggestion] allowedSoldierType function for craft
« Reply #17 on: July 25, 2022, 11:01:40 am »
That's very good news! Of course I imagine more people would need to vouch for the suggestion before it gets on the waitlist? Would that be correct?

I have enough good examples already.
Todolisted.

Offline Delian

  • Colonel
  • ****
  • Posts: 278
    • View Profile
Re: [Suggestion] allowedSoldierType function for craft
« Reply #18 on: July 25, 2022, 11:57:08 am »
it make easier to maintain Cartesian cross of all crafts and solders/armors

Maintaining it with YAML anchors is just as easy. You don't need to correct all the craft, just correct the anchor.

As for armors vs soldier types... each serve their own purpose, so I'm not sure. Deployments already have startingCondition with allowedArmors and allowedSoldierTypes. So maybe crafts could have both as well.

Offline Yankes

  • Commander
  • *****
  • Posts: 3246
    • View Profile
Re: [Suggestion] allowedSoldierType function for craft
« Reply #19 on: July 25, 2022, 12:59:13 pm »
Maintaining it with YAML anchors is just as easy. You don't need to correct all the craft, just correct the anchor.

As for armors vs soldier types... each serve their own purpose, so I'm not sure. Deployments already have startingCondition with allowedArmors and allowedSoldierTypes. So maybe crafts could have both as well.
Between mods and files? Yes anchors are useful in this case but this is more a workaround for problem than solution.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8711
    • View Profile
Re: [DONE][Suggestion] Allowed soldier groups per craft
« Reply #20 on: February 10, 2024, 03:11:21 pm »
Done.

https://github.com/MeridianOXC/OpenXcom/commit/3743d8e3c7e5b5408a0d5133ca6140a904a24656
Fix: https://github.com/MeridianOXC/OpenXcom/commit/1024a16db5a499f2e60f5a1cf7e9fb08a65005b9

I've been making a "Play as the aliens" mod for the past 3 weeks or so, as such I would like to force the player to only be able to have 1 alien race per craft, the feature would work like this:
Go to craft loadouts -> craft crew -> load 1 aquatoid soldier (now craft will only accept aquatoid units (soldiers/terror units)). -> Throw error message when trying to load a different race. -> Unload all  soldiers (empty craft) to accept other races again.

Sample ruleset:

crafts:
  - type: STR_TRITON
    onlyOneSoldierGroupAllowed: true

soldiers:
  - type: STR_SOLDIER_AQUATOID
    group: 10
  - type: STR_SOLDIER_GILLMAN
    group: 20
  - type: STR_SOLDIER_LOBSTERMAN
    group: 30


I would love also that addition, to have  craft by soldier type, meaning that i have issue making loyalist use heretical crafts(40k mod)

Sample ruleset:

crafts:
  - type: STR_HERETIC_CRAFT
    allowedSoldierGroups: [40, 42]

soldiers:
  - type: STR_SOLDIER_HERETIC_1
    group: 40
  - type: STR_SOLDIER_HERETIC_2
    group: 40
  - type: STR_SOLDIER_HERETIC_3
    group: 42
  - type: STR_SOLDIER_LOYALIST_1
    group: 70
  - type: STR_SOLDIER_LOYALIST_2
    group: 71

Translations:

Code: [Select]
  STR_SOLDIER_GROUP_NOT_ALLOWED: "This soldier type is not allowed onboard."
  STR_SOLDIER_GROUP_NOT_SAME: "This soldier type is not compatible with other soldiers onboard."
« Last Edit: February 11, 2024, 09:52:09 pm by Meridian »