Author Topic: Mission does not spawn... again  (Read 1393 times)

Offline Nord

  • Commander
  • *****
  • Posts: 847
  • The Gate will open... someday.
    • View Profile
Mission does not spawn... again
« on: November 17, 2018, 03:58:51 pm »
Okay. I am surrendering.
Spoiler:
Code: [Select]
missionScripts:
  - type: GameStartHunt
    firstMonth: 0
    executionOdds: 100
    targetBaseOdds: 100
    missionWeights:
      0:
        STR_HUNT_1: 100
    useTable: false
    startDelay: 20
    randomDelay: 100

Code: [Select]
alienMissions:
  - type: STR_HUNT_1
    despawnEvenIfTargeted: true
    objective: 3
    points: 0
    spawnZone: 0
    raceWeights:
      0:
          STR_STALKERS: 100
    waves:
      - ufo: dummy
        count: 1
        trajectory: P_SPAWN
        timer: 9000
        objective: true
Code: [Select]
alienDeployments:
  - type: STR_HUNT_1
    width: 60
    length: 60
    height: 5
    civilians: 3
    alert: STR_MONSTER_HUNT
    alertBackground: BACK03.SCR
    alertDescription: STR_MONSTERS_HUNT_DESCRIPTION
    briefing:
      palette: 2
      background: BACK03.SCR
      desc: STR_MONSTERS_HUNT_BRIEFING
    markerName: STR_MONSTER_HUNT
    duration: [72, 144]
    despawnPenalty: 150
    data:
      - alienRank: 5
        lowQty: 2
        highQty: 4
        dQty: 1
        percentageOutsideUfo: 100
        itemSets:
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
Code: [Select]
ufoTrajectories:
  - id: P_SPAWN
    groundTimer: 0
    waypoints:
      - [0, 0, 0]
What do i do wrong? Because nothing happens, nothing spawns.  :'(

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 500
    • View Profile
Re: Mission does not spawn... again
« Reply #1 on: November 17, 2018, 04:12:50 pm »
I have the same question was you some time ago, the answer is... the globe ruleset need to be used to create site missions

Offline Nord

  • Commander
  • *****
  • Posts: 847
  • The Gate will open... someday.
    • View Profile
Re: Mission does not spawn... again
« Reply #2 on: November 17, 2018, 04:34:14 pm »
Globe ruleset defines possible deployements, for that missions which use specific zones. Like "only in this exact point", or "only in cities of asia".

Offline Hobbes

  • Commander
  • *****
  • Posts: 3441
  • Infiltration subroutine in progress
    • View Profile
Re: Mission does not spawn... again
« Reply #3 on: November 17, 2018, 05:10:32 pm »
Okay. I am surrendering.
Spoiler:
Code: [Select]
missionScripts:
  - type: GameStartHunt
    firstMonth: 0
    executionOdds: 100
    targetBaseOdds: 100
    missionWeights:
      0:
        STR_HUNT_1: 100
    useTable: false
    startDelay: 20
    randomDelay: 100

Code: [Select]
alienMissions:
  - type: STR_HUNT_1
    despawnEvenIfTargeted: true
    objective: 3
    points: 0
    spawnZone: 0
    raceWeights:
      0:
          STR_STALKERS: 100
    waves:
      - ufo: dummy
        count: 1
        trajectory: P_SPAWN
        timer: 9000
        objective: true
Code: [Select]
alienDeployments:
  - type: STR_HUNT_1
    width: 60
    length: 60
    height: 5
    civilians: 3
    alert: STR_MONSTER_HUNT
    alertBackground: BACK03.SCR
    alertDescription: STR_MONSTERS_HUNT_DESCRIPTION
    briefing:
      palette: 2
      background: BACK03.SCR
      desc: STR_MONSTERS_HUNT_BRIEFING
    markerName: STR_MONSTER_HUNT
    duration: [72, 144]
    despawnPenalty: 150
    data:
      - alienRank: 5
        lowQty: 2
        highQty: 4
        dQty: 1
        percentageOutsideUfo: 100
        itemSets:
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
Code: [Select]
ufoTrajectories:
  - id: P_SPAWN
    groundTimer: 0
    waypoints:
      - [0, 0, 0]
What do i do wrong? Because nothing happens, nothing spawns.  :'(

1) There's no region defined that contains a valid missionZone for the mission to spawn.

AlienMissions with objective: 3 require a spawnZone that contains only single locations such as cities, eg. [91, 91, -22.366, -22.366]. On the vanilla regions, missionZone 3 is set specifically for this propose.

Thus, your mission is assigned to spawnZone 0 of the vanilla regions, and since those define large areas like [60, 83, -70, -67] and not single locations, will never spawn.

2) But if you assign spawnZone: 3, it will use the vanilla alienDeployment instead of your STR_HUNT.

For the game to use your modded alienDeployment, it needs to be assigned a texture in globe.rul, and then the texture needs to be assigned to a region on regions.rul.
« Last Edit: November 17, 2018, 05:16:34 pm by Hobbes »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4909
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Mission does not spawn... again
« Reply #4 on: November 17, 2018, 05:21:56 pm »
As Hobbes says, you need zone with just "points"/cities.

Code: [Select]
alienMissions:
  - type: STR_HUNT_1
    spawnZone: 3

And your mission script is also missing a race:

Code: [Select]
missionScripts:
  - type: GameStartHunt
    raceWeights:
      0:
        STR_AQUATOID: 100

After that a mission like this is generated:

Code: [Select]
alienMissions:
  - type: STR_HUNT_1
    region: STR_CARRIBEAN
    race: STR_AQUATOID
    nextWave: 0
    nextUfoCounter: 0
    spawnCountdown: 91
    liveUfos: 0
    uniqueID: 4
    missionSiteZone: 2

And after a moment a mission site like this is generated:

Code: [Select]
missionSites:
  - lon: 4.8607419668042082
    lat: -0.47123889803846897
    id: 1
    type: STR_HUNT_1
    deployment: STR_PORT_TERROR
    texture: -1
    secondsRemaining: 30600
    race: STR_AQUATOID
    detected: true

As for the deployment... I think there is an easier way than bulletdesigner/Hobbes are saying, but maybe I'm wrong, let me check.

Offline Nord

  • Commander
  • *****
  • Posts: 847
  • The Gate will open... someday.
    • View Profile
Re: Mission does not spawn... again
« Reply #5 on: November 17, 2018, 05:23:27 pm »
1) There's no region defined that contains a valid missionZone for the mission to spawn.

AlienMissions with objective: 3 require a spawnZone that contains only single locations such as cities, eg. [91, 91, -22.366, -22.366]. On the vanilla regions, missionZone 3 is set specifically for this propose.

Thus, your mission is assigned to spawnZone 0 of the vanilla regions, and since those define large areas like [60, 83, -70, -67] and not single locations, will never spawn.

2) But if you assign spawnZone: 3, it will use the vanilla alienDeployment instead of your STR_HUNT.

For the game to use your modded alienDeployment, it needs to be assigned a texture in globe.rul, and then the texture needs to be assigned to a region on regions.rul.
Great! In that case i can use missionZone 0 as well as spawnZone 0, and then use deployement name instead of "dummy".
Thanks!
At the same moment. :)
About race in missionscripts - i think it is overriding of alienmissions race?

Upd: not missionZone: 0, but objective: 0 !
« Last Edit: November 17, 2018, 05:36:56 pm by Nord »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4909
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Mission does not spawn... again
« Reply #6 on: November 17, 2018, 05:32:19 pm »
Yeah, there is an easier way to define the deployment than to mess with the globe.
You can just define siteType directly on alienMission ruleset like this:

Code: [Select]
alienMissions:
  - type: STR_HUNT_1
    spawnZone: 3
    siteType: STR_HUNT_1

And here's the full corrected ruleset:

Code: [Select]
missionScripts:
  - type: GameStartHunt
    firstMonth: 0
    executionOdds: 100
    targetBaseOdds: 100
    missionWeights:
      0:
        STR_HUNT_1: 100
    useTable: false
    startDelay: 20
    randomDelay: 100
    raceWeights:
      0:
        STR_AQUATOID: 100

alienMissions:
  - type: STR_HUNT_1
    despawnEvenIfTargeted: true
    objective: 3
    points: 0
    spawnZone: 3
    siteType: STR_HUNT_1
    raceWeights:
      0:
          STR_STALKERS: 100
    waves:
      - ufo: dummy
        count: 1
        trajectory: P_SPAWN
        timer: 9000
        objective: true

alienDeployments:
  - type: STR_HUNT_1
    width: 60
    length: 60
    height: 5
    civilians: 3
    alert: STR_MONSTER_HUNT
    alertBackground: BACK03.SCR
    alertDescription: STR_MONSTERS_HUNT_DESCRIPTION
    briefing:
      palette: 2
      background: BACK03.SCR
      desc: STR_MONSTERS_HUNT_BRIEFING
    markerName: STR_MONSTER_HUNT
    duration: [72, 144]
    despawnPenalty: 150
    data:
      - alienRank: 5
        lowQty: 2
        highQty: 4
        dQty: 1
        percentageOutsideUfo: 100
        itemSets:
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []
          -
            []

ufoTrajectories:
  - id: P_SPAWN
    groundTimer: 0
    waypoints:
      - [0, 0, 0]

PS: and I guess, you don't need to add STR_AQUATOID to the mission script... I just didn't have the STR_STALKERS race, so it crashed for me.
« Last Edit: November 17, 2018, 05:38:25 pm by Meridian »

Offline Hobbes

  • Commander
  • *****
  • Posts: 3441
  • Infiltration subroutine in progress
    • View Profile
Re: Mission does not spawn... again
« Reply #7 on: November 17, 2018, 05:33:54 pm »
Great! In that case i can use missionZone 0 as well as spawnZone 0, and then use deployement name instead of "dummy".
Thanks!

No.

MissionZone and spawnZone are the same, they just have different names. If you keep using missionZone 0 of the vanilla regions, it will not spawn

And changing ufo: 'dummy' won't do anything either, if you don't assign your alienDeployment to a texture and then assign that texture to a region. Or use siteType, as Meridian has described on the previous post.
« Last Edit: November 17, 2018, 05:35:50 pm by Hobbes »

Offline Nord

  • Commander
  • *****
  • Posts: 847
  • The Gate will open... someday.
    • View Profile
Re: Mission does not spawn... again
« Reply #8 on: November 17, 2018, 05:37:41 pm »
 not missionZone: 0, but objective: 0.

And it is working now. :)
Quote
  - type: STR_HUNT_1
    despawnEvenIfTargeted: true
    objective: 0
    points: 0
    spawnZone: 0
    raceWeights:
      0:
          STR_STALKERS: 100
    waves:
      - ufo: STR_HUNT_1 #dummy
        count: 1
        trajectory: P_SPAWN
        timer: 1000
        objective: true

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4909
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Mission does not spawn... again
« Reply #9 on: November 17, 2018, 05:48:07 pm »
Yeah, that's a third way to do it.

Offline Nord

  • Commander
  • *****
  • Posts: 847
  • The Gate will open... someday.
    • View Profile
Re: Mission does not spawn... again
« Reply #10 on: November 17, 2018, 05:58:10 pm »
Thanks to all of you.
Stalker preview:

Offline Hobbes

  • Commander
  • *****
  • Posts: 3441
  • Infiltration subroutine in progress
    • View Profile
Re: Mission does not spawn... again
« Reply #11 on: November 17, 2018, 06:03:44 pm »
not missionZone: 0, but objective: 0.

And it is working now. :)

Yeah, but it's not working as you wanted on your original post, because it wont generate the alert or the mission site, just a ufo and it will likely crash if you send a craft after it.

If you want to understand how mission generation works and its requirements, read this: https://www.ufopaedia.org/index.php/Alien_Missions_in_Enemy_Unknown_(OpenXcom)
« Last Edit: November 17, 2018, 06:05:31 pm by Hobbes »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4909
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Mission does not spawn... again
« Reply #12 on: November 17, 2018, 06:07:03 pm »
Yeah, but it's not working as you wanted on your original post, because it wont generate the alert or the mission site, just a ufo and it will likely crash if you send a craft after it.

If you want to understand how mission generation works and its requirements, read this: https://www.ufopaedia.org/index.php/Alien_Missions_in_Enemy_Unknown_(OpenXcom)

Nah, it works just fine.

https://github.com/SupSuper/OpenXcom/blob/master/src/Savegame/AlienMission.cpp#L180

Line 180: is for objective 0 (or any other objective for that matter)
Line 181: is for objective 3
« Last Edit: November 17, 2018, 06:09:35 pm by Meridian »

Offline Hobbes

  • Commander
  • *****
  • Posts: 3441
  • Infiltration subroutine in progress
    • View Profile
Re: Mission does not spawn... again
« Reply #13 on: November 17, 2018, 06:09:27 pm »
Nah, it works just fine.

on Geoscape? I have my doubts it's working as intended, specially when the sites start being generated on the water land (since it's for TFTD)
« Last Edit: November 17, 2018, 06:24:46 pm by Hobbes »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4909
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Mission does not spawn... again
« Reply #14 on: November 17, 2018, 06:19:11 pm »
on Geoscape? I have my doubts it's working as intended, specially when the sites start being generated on the water

It's a tftd mod, he wants them on the water :)

But yeah, jokes aside, this will consider the whole region area and you may get mission sites on land too... which looks weird.
It shouldn't crash though (to be confirmed).