aliens

Author Topic: Base site with random race different from UFO waves races?  (Read 4482 times)

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
Base site with random race different from UFO waves races?
« on: April 05, 2019, 12:19:07 am »
In my mod aliens do the usual alien infiltration, but after succeeding a "subverted headquarters" is spawned instead of the normal alien base (it is a base-like kind of site, and if you beat that mission you can win the country back).
The subverted HQ is populated by mixture of humans and aliens, so it uses a different race from the infiltration UFOs (which is a aliens-only race); this can be obtained straightforwardly using the "race" parameter of the alienDeployment.
My problem is that I'd like the subverted HQ to have a bit of variation in that department, but the "race" parameter only takes one race which means a fixed race for all the subverted HQs ever.

So far the only turnaround I thought of is to duplicate everything: multiple identical alien missions, each with its identical subverted HQ, each with its own race. This would give me the result I want but it is quite inelegant with all that duplication. Is it my only option?

Thanks.
« Last Edit: April 05, 2019, 12:23:37 am by robin »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9144
    • View Profile
Re: Base site with random race different from UFO waves races?
« Reply #1 on: April 05, 2019, 12:51:24 am »
1/ A race can have random members: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Alien_Races

2/ I could easily add random race selection (from a list) to alien deployment too

Which one is better?

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
Re: Base site with random race different from UFO waves races?
« Reply #2 on: April 05, 2019, 09:55:21 pm »
1/ I already use the random members feature (IIRC I was the one that first requested it :P). But it is not what I'm looking for in this case.

2/ This is the ideal solution. But.... are other modders interested in this too? Because I personally only need a random selection among few races, so the duplication is far from massive (I actually already duplicated everything). I don't really want to waste your time having you code for trivial stuff like this.



Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9144
    • View Profile
Re: Base site with random race different from UFO waves races?
« Reply #3 on: April 05, 2019, 10:31:36 pm »
2/ This is the ideal solution. But.... are other modders interested in this too? Because I personally only need a random selection among few races, so the duplication is far from massive (I actually already duplicated everything). I don't really want to waste your time having you code for trivial stuff like this.

Done.
This was really just 10 minutes work.

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
Re: Base site with random race different from UFO waves races?
« Reply #4 on: April 05, 2019, 10:51:05 pm »
Oh.
Thank you a lot.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9144
    • View Profile
Re: Base site with random race different from UFO waves races?
« Reply #5 on: April 06, 2019, 12:57:06 am »
Code: [Select]
alienDeployments:
  - type: STR_TEST
    randomRace: [STR_SECCTOID, STR_FLOATER, STR_MUTON]

"randomRace" overrides "race" if both attributes are used.

https://lxnt.wtf/oxem/builds//Extended/Extended-5.3.2-bb54b8678-2019-04-05-win32.7z

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: Base site with random race different from UFO waves races?
« Reply #6 on: April 18, 2019, 01:44:15 am »
You can do it with the baseCustomMission setting. Example:

Code: [Select]
alienRaces:
  - id: STR_ANTHROPOD
    baseCustomMission: STR_SUBVERTED_HEADQUARTERS
  - id: STR_SPITTER
    baseCustomMission: STR_SUBVERTED_HEADQUARTERS
  - id: STR_PSIMORPH
    baseCustomMission: STR_SUBVERTED_HEADQUARTERS
  - id: STR_SKELETOR
    baseCustomMission: STR_SUBVERTED_HEADQUARTERS
  - id: STR_MICRONOID
    baseCustomMission: STR_SUBVERTED_HEADQUARTERS


As an addition to what Meridian said, you can also put random members into a race. Example:

Code: [Select]
alienRaces:
  - id: STR_EARLY_INTRUSION
    members:
      - STR_PSIMORPH
      - STR_CHRYSALIS
      - STR_CHRYSALIS
      - STR_ALIEN_EGG
      - STR_ANTHROPOD
      - STR_SPITTER
      - STR_POPPER
      - STR_POPPER
    membersRandom:
      - [STR_PSIMORPH,STR_PSIMORPH,STR_REAVER]
      - [STR_CHRYSALIS,STR_ALIEN_EGG]
      - [STR_CHRYSALIS]
      - [STR_ALIEN_EGG]
      - [STR_ANTHROPOD]
      - [STR_SPITTER,STR_SPITTER,STR_ANTHROPOD]
      - [STR_POPPER]
      - [STR_POPPER,STR_BRAINSUCKER]


You can also use membersRandom to make rare encounters:
Code: [Select]
    membersRandom:
      - [STR_TURTLE,STR_TURTLE,STR_TURTLE,STR_TURTLE,STR_TURTLE,STR_TURTLE,STR_TURTLE,STR_TURTLE,STR_TURTLE,STR_GIL_TURTLE]
      - [STR_GOBLIN,STR_GOBLIN,STR_GOBLIN,STR_GOBLIN,STR_GOBLIN,STR_GOBLIN,STR_GOBLIN,STR_GOBLIN,STR_GOBLIN,STR_TREASURE_GOBLIN]
      - [STR_DUCK,STR_DUCK,STR_DUCK,STR_DUCK,STR_DUCK,STR_DUCK,STR_DUCK,STR_DUCK,STR_DUCK,STR_GOOSE]
      - [STR_CACTUS,STR_CACTUS,STR_CACTUS,STR_CACTUS,STR_CACTUS,STR_CACTUS,STR_CACTUS,STR_CACTUS,STR_CACTUS,STR_CACTUAR]
      - [STR_BLUE_DRAGON,STR_BLUE_DRAGON,STR_BLUE_DRAGON,STR_BLUE_DRAGON,STR_RED_DRAGON,STR_RED_DRAGON,STR_RED_DRAGON,STR_HEXADRAGON_DRAGON,STR_HEXADRAGON_DRAGON,STR_MALBORO]
      - [STR_EXCALIPOOR,STR_EXCALIPOOR,STR_EXCALIPOOR,STR_EXCALIPOOR,STR_EXCALIBUR,STR_EXCALIBUR,STR_EXCALIBUR,STR_MASAMUNE,STR_MASAMUNE,STR_ZANMATO]
      - [STR_MUTON_SOLDIER,STR_MUTON_SOLDIER,STR_MUTON_SOLDIER,STR_MUTON_SOLDIER,STR_MUTON_SOLDIER,STR_MUTON_SOLDIER,STR_MUTON_SOLDIER,STR_MUTON_SOLDIER,STR_MUTON_SOLDIER,STR_MUTON_COMMANDER]
      - [STR_LOSING_LOTTERY_TICKET,STR_LOSING_LOTTERY_TICKET,STR_LOSING_LOTTERY_TICKET,STR_LOSING_LOTTERY_TICKET,STR_LOSING_LOTTERY_TICKET,STR_LOSING_LOTTERY_TICKET,STR_LOSING_LOTTERY_TICKET,STR_LOSING_LOTTERY_TICKET,STR_LOSING_LOTTERY_TICKET,STR_LOSING_LOTTERY_TICKET]
« Last Edit: April 18, 2019, 05:51:27 am by The Reaver of Darkness »