Author Topic: Help create a mission from the base  (Read 514 times)

Offline Kronos913

  • Colonel
  • ****
  • Posts: 122
    • View Profile
Help create a mission from the base
« on: October 04, 2024, 02:05:03 pm »
Please help create a mission that will start every month from each alien base. That is, how many bases - so many mission starts. As usual, a mission of several UFOs - from scouts to target UFOs

For example, STR_ALIEN_HARVEST. Then, I will try to create the rest myself by analogy

Offline Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
Re: Help create a mission from the base
« Reply #1 on: October 04, 2024, 02:19:48 pm »
Not exactly one mission per month per base, but very close to it:

Code: [Select]
alienDeployments:
  - type: STR_ALIEN_BASE_ASSAULT
...
    genMission:
      STR_ALIEN_HARVEST: 100
    genMissionFreq: 3

Offline Kronos913

  • Colonel
  • ****
  • Posts: 122
    • View Profile
Re: Help create a mission from the base
« Reply #2 on: October 05, 2024, 01:43:35 am »
If it's not too much trouble, please help me make the full code.

As far as I understand, I need to write something in other sections, not just in alienDeployments?

And what should be in place...?

Offline Kozinsky

  • Colonel
  • ****
  • Posts: 125
  • Sorry for my bEd English
    • View Profile
Re: Help create a mission from the base
« Reply #3 on: October 05, 2024, 10:50:40 am »
Examples of the alien missions themselves can be seen in the original game's rule set “...\OpenXCom\standard\xcom1\alienMissions.rul”, including STR_ALIEN_HARVEST.
And the alienDeployments.rul file contains the full code of alien base behavior, you just need to edit it as you need it.
For example, for your task in your submod you should write something like this:

Code: [Select]
alienDeployments:
  - update: STR_ALIEN_BASE_ASSAULT
    genMission:
      STR_ALIEN_SUPPLY: 50
      STR_ALIEN_HARVEST: 50
    genMissionFreq: 6

Offline Kronos913

  • Colonel
  • ****
  • Posts: 122
    • View Profile
Re: Help create a mission from the base
« Reply #4 on: October 09, 2024, 02:50:22 pm »
I tried to do something similar. It seems like the number of missions has increased. BUT. They still start from space. And I would like to make it so that the UFO starts from the alien base and returns there.

Online CrazedHarpooner

  • Captain
  • ***
  • Posts: 91
    • View Profile
Re: Help create a mission from the base
« Reply #5 on: October 09, 2024, 05:05:35 pm »
By default, all missions start from space, even base generated ones. If you want it to start from a base you'll need to specify an operationType in the alienMission itself. You probably should check out this particular thread about the topic here (https://openxcom.org/forum/index.php/topic,6557.msg104669.html#msg104669). Note that if in the example code provided by Kozinsky you also update the mission for STR_ALIEN_HARVEST to use, let's say:
Code: [Select]
alienMissions:
  - update: STR_ALIEN_HARVEST
    operationType: 1
It will work, but now, ALL of these instances of the mission will be earth-based ONLY and in this particular example case, require at least 1 alien base present in the region to function or it will be aborted. If your idea is to have bases generate already defined missions but not alter the vanilla "from space" behaviour, you'll have to duplicate those missions to a different name (STR_ALIEN_HARVEST_FROM_BASE for example) and give them an operationType. Also, depending on the type you specify, you might have to set other properties too, all of that is explained in the thread linked earlier.