Author Topic: Limiting Artifact Site mission spawn rate in TFTD  (Read 2258 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Limiting Artifact Site mission spawn rate in TFTD
« on: May 14, 2022, 01:27:25 pm »
I just finished the 12th Artifact Site in my current Terror From The Deep playthrough with no Port Attack, Island Attack or Shipping Lane Mission appearing in between the constant stream of Artifact Site missions.

In an effort to add some variety to missions I've been trying to break up the rate that Artifact Sites can be generated to allow for some standard alien terror missions to spawn as well.


For my first attempt I tried deleting the "artifacts" entry in missionScripts: and replacing it with twelve similar entries named:
artifacts_1
artifacts_2
artifacts_3
artifacts_4
artifacts_5
artifacts_6
artifacts_7
artifacts_8
artifacts_9
artifacts_10
artifacts_11
artifacts_12


Each of these new entries have a maxRuns: of 1 instead of 12 and are setup through firstMonth: to generate an Artifact Site every two months which will hopefully give the aliens a chance to spawn alternate missions in the month between the guaranteed Artifact spawns.

Unfortunately only artifacts_1 seems to run so this isn't working currently. I suspect it may have something to do with label: but I do not understand missionScripts: well enough to do more than guess.



Here is the code I'm working with:
Code: [Select]
missionScripts:

# [=] Remove old Artifact Site mission [=]
  - delete: artifacts


# [=] Artifacts Site #1 of #12 [=]
  - type: artifacts_1
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 6
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #2 of #12 [=]
  - type: artifacts_2
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 8
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #3 of #12 [=]
  - type: artifacts_3
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 10
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #4 of #12 [=]
  - type: artifacts_4
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 12
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #5 of #12 [=]
  - type: artifacts_5
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 14
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #6 of #12 [=]
  - type: artifacts_6
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 16
    executionOdds: 100
    startDelay: 0

# [=] Artifacts Site #7 of #12 [=]
  - type: artifacts_7
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 18
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #8 of #12 [=]
  - type: artifacts_8
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 20
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #9 of #12 [=]
  - type: artifacts_9
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 22
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #10 of #12 [=]
  - type: artifacts_10
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 24
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #11 of #12 [=]
  - type: artifacts_11
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 26
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #12 of #12 [=]
  - type: artifacts_12
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts
    useTable: false
    firstMonth: 28
    executionOdds: 100
    startDelay: 0

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9103
    • View Profile
Re: Limiting Artifact Site mission spawn rate in TFTD
« Reply #1 on: May 14, 2022, 02:01:08 pm »
I just finished the 12th Artifact Site in my current Terror From The Deep playthrough with no Port Attack, Island Attack or Shipping Lane Mission appearing in between the constant stream of Artifact Site missions.

In an effort to add some variety to missions I've been trying to break up the rate that Artifact Sites can be generated to allow for some standard alien terror missions to spawn as well.

The chance of that happening is 0.02% (or 1 in 4000).
Not even worth a discussion, just start a new campaign.

Each of these new entries have a maxRuns: of 1 instead of 12 and are setup through firstMonth: to generate an Artifact Site every two months which will hopefully give the aliens a chance to spawn alternate missions in the month between the guaranteed Artifact spawns.

Unfortunately only artifacts_1 seems to run so this isn't working currently. I suspect it may have something to do with label: but I do not understand missionScripts: well enough to do more than guess.

You have maxRuns=1 and the same varName for all items; so the first run already turns them all off.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Limiting Artifact Site mission spawn rate in TFTD
« Reply #2 on: May 14, 2022, 05:59:50 pm »
The chance of that happening is 0.02% (or 1 in 4000).
Not even worth a discussion, just start a new campaign.

I've already finished the 12 Artifact Sites so its clear sailing for me during my run, this mod was going to be more for other players to keep them from potentially living through that gruelling 12 in a row.

It sounds like I just got really unlucky though. (Or really lucky if you like Artifact Site missions.)


You have maxRuns=1 and the same varName for all items; so the first run already turns them all off.

Thank you for the help.

I can see the utility in them being able to share the same variable like that.

Different missionScripts: entries can all share the same varName: allowing for a random combination of these missions to spawn with each contributing to their combined set exceeding the maxRuns: value.


To make the code I was working with correct I see two methods:

(Method #1)
Change varName: artifacts to something unique for each entry.

Example:
Code: [Select]
missionScripts:

# [=] Remove old Artifact Site mission [=]
  - delete: artifacts


# [=] Artifacts Site #1 of #12 [=]
  - type: artifacts_1
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_1
    useTable: false
    firstMonth: 6
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #2 of #12 [=]
  - type: artifacts_2
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_2
    useTable: false
    firstMonth: 8
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #3 of #12 [=]
  - type: artifacts_3
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_3
    useTable: false
    firstMonth: 10
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #4 of #12 [=]
  - type: artifacts_4
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_4
    useTable: false
    firstMonth: 12
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #5 of #12 [=]
  - type: artifacts_5
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_5
    useTable: false
    firstMonth: 14
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #6 of #12 [=]
  - type: artifacts_6
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_6
    useTable: false
    firstMonth: 16
    executionOdds: 100
    startDelay: 0

# [=] Artifacts Site #7 of #12 [=]
  - type: artifacts_7
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_7
    useTable: false
    firstMonth: 18
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #8 of #12 [=]
  - type: artifacts_8
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_8
    useTable: false
    firstMonth: 20
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #9 of #12 [=]
  - type: artifacts_9
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_9
    useTable: false
    firstMonth: 22
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #10 of #12 [=]
  - type: artifacts_10
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_10
    useTable: false
    firstMonth: 24
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #11 of #12 [=]
  - type: artifacts_11
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_11
    useTable: false
    firstMonth: 26
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #12 of #12 [=]
  - type: artifacts_12
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 1
    varName: artifacts_12
    useTable: false
    firstMonth: 28
    executionOdds: 100
    startDelay: 0



(Method #2)
Keep each of the twelve artifact entries using the same varName: but raise their maxRuns: back to 12 and limit each entry to only run on the same month that firstMonth: is set for by also configuring an end date with lastMonth:

Example:
Code: [Select]
missionScripts:

# [=] Remove old Artifact Site mission [=]
  - delete: artifacts


# [=] Artifacts Site #1 of #12 [=]
  - type: artifacts_1
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 6
    lastMonth: 6
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #2 of #12 [=]
  - type: artifacts_2
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 8
    lastMonth: 8
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #3 of #12 [=]
  - type: artifacts_3
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 10
    lastMonth: 10
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #4 of #12 [=]
  - type: artifacts_4
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 12
    lastMonth: 12
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #5 of #12 [=]
  - type: artifacts_5
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 14
    lastMonth: 14
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #6 of #12 [=]
  - type: artifacts_6
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 16
    lastMonth: 16
    executionOdds: 100
    startDelay: 0

# [=] Artifacts Site #7 of #12 [=]
  - type: artifacts_7
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 18
    lastMonth: 18
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #8 of #12 [=]
  - type: artifacts_8
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 20
    lastMonth: 20
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #9 of #12 [=]
  - type: artifacts_9
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 22
    lastMonth: 22
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #10 of #12 [=]
  - type: artifacts_10
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 24
    lastMonth: 24
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #11 of #12 [=]
  - type: artifacts_11
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 26
    lastMonth: 26
    executionOdds: 100
    startDelay: 0


# [=] Artifacts Site #12 of #12 [=]
  - type: artifacts_12
    label: 1
    missionWeights:
      0:
        STR_ALIEN_ARTIFACT: 100
    regionWeights:
      0:
        ARTIFACT_SITES: 100
    avoidRepeats: 1
    maxRuns: 12
    varName: artifacts
    useTable: false
    firstMonth: 28
    lastMonth: 28
    executionOdds: 100
    startDelay: 0