Author Topic: Need help with a fatal error.  (Read 6241 times)

wcho035

  • Guest
Need help with a fatal error.
« on: February 03, 2020, 01:16:36 pm »

[03-02-2020_22-09-00]   [FATAL]   A fatal error has occurred: vector::_M_range_check: __n (which is 3) >= this->size() (which is 1)

Hi, can someone tell me what this fatal error means?

Thanks.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11727
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Need help with a fatal error.
« Reply #1 on: February 03, 2020, 01:54:04 pm »
This can mean anything, as it only says that a value is outside of the expected range.

wcho035

  • Guest
Re: Need help with a fatal error.
« Reply #2 on: February 03, 2020, 03:26:29 pm »
I have narrow down the problem. The new terror mission in the mod is causing the crash.

Here is a code example.

Code: [Select]
alienMissions:
  - type: STR_ISLANDATTACKBANDIT
    points: 10
    objective: 3
    retaliationOdds: 20
    spawnZone: 0 #Mission zone for terror missions
    raceWeights:
      0:
        STR_BANDIT_REGIMENT: 100
    waves:
      - ufo: STR_CONQUERORBATTLESHIPBANDIT
        count: 1
        trajectory: P20
        timer: 5000
        interruptPercentage: 50
      - ufo: STR_ENZEPPELINBANDIT
        count: 1
        trajectory: P27
        timer: 7000
        objective: true
        escort: true
        interruptPercentage: 100
      - ufo: STR_ENEMYMIG
        count: 1
        trajectory: P21
        timer: 9600
        hunterKillerPercentage: 70
        huntMode: 2
        huntBehavior: 2
        escort: true
        interruptPercentage: 5
      - ufo: STR_ENEMYSABRE
        count: 1
        trajectory: P21
        timer: 9600
        hunterKillerPercentage: 70
        huntMode: 2
        huntBehavior: 2
        escort: true
        interruptPercentage: 5
      - ufo: STR_ENEMYMIG
        count: 1
        trajectory: P21
        timer: 9600
        hunterKillerPercentage: 70
        huntMode: 2
        huntBehavior: 2
        escort: true
        interruptPercentage: 5
      - ufo: STR_ENEMYSABRE
        count: 1
        trajectory: P21
        timer: 9600
        hunterKillerPercentage: 70
        huntMode: 2
        huntBehavior: 2
        escort: true
        interruptPercentage: 5
missionScripts:
  - type: recurringTerrorislandbandit
    missionWeights:
      0:
        STR_ISLANDATTACKBANDIT: 100
    regionWeights:
      0:
        ISLANDBANDIT: 100
    varName: banditterrorisland
    useTable: false
    startDelay: 150
    firstMonth: 0
    maxRuns: -1
    executionOdds: 0
regions:
  - type: ISLANDBANDIT
    missionZones:
      -
        - [56, 56, 4.5, 4.5, -30, STR_SAYCHELLES_ISLAND]
        - [73, 73, -6.5, -6.5, -30, STR_MALDIVE_ISLAND]
        - [79.75, 79.75, -7, -7, -30, STR_SRI_LANKA]
        - [53, 53, 20.5, 20.5, -30, STR_MAURITIUS]
        - [353, 353, -58.25, -58.25, -30, STR_FAEROE_ISLAND]
        - [336, 336, -37, -37, -30, STR_AZORES]
        - [337, 337, -61.25, -61.25, -30, STR_REYKJAVIK]
        - [295.125, 295.125, -34.5, -34.5, -30, STR_BERMUDA]
        - [359.75, 359.75, -4.25, -4.25, -30, STR_ACCRA]
        - [330, 330, 20.5, 20.5, -30, STR_TRINIDADE_ISLAND]
        - [301, 301, 51, 51, -30, STR_FALKLAND_ISLAND]
        - [339, 339, -26, -26, -30, STR_CANARY_ISLANDS]
        - [190, 190, -59.75, -59.75, -30, STR_ST_LAWRENCE_ISLAND]
        - [161.25, 161.25, 9, 9, -30, STR_SOLOMON_ISLAND]
        - [25, 25, -35.125, -35.125, -30, STR_CRETE]
        - [204.5, 204.5, -20.25, -20.25, -30, STR_HAWAII]
        - [178, 178, 17, 17, -30, STR_FIJI]
        - [189, 189, 19, 19, -30, STR_TONGA]
        - [241, 241, 26.5, 26.5, -30, STR_EASTER_ISLAND]
        - [269, 269, 1, 1, -30, STR_GALAPAGOS_ISLAND]
        - [182, 182, -28, -28, -30, STR_MIDWAY_ISLAND]



So why am I keep getting that kind of errors?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Need help with a fatal error.
« Reply #3 on: February 03, 2020, 04:38:23 pm »
As always, a full log, a full mod and a save before the crash is needed.

With one log line and random ruleset, I can do exactly nothing.

Unless you make your mod available, 98% of your support questions will just stay unsolved.

wcho035

  • Guest
Re: Need help with a fatal error.
« Reply #4 on: February 03, 2020, 10:06:05 pm »
Thanks as always Meridian, I am planning a major overhaul of the Hybrid mod I have released. I will uploaded that with the new codes in the near future

wcho035

  • Guest
Re: Need help with a fatal error.
« Reply #5 on: February 04, 2020, 01:32:56 pm »
Hi, I am able to replicate the error with the publish mod of mine.

Please note this mod is an upgraded version of the Hybrid mod. There are bugs with the aliendeployment against the terrains associated with it. However, this is unrelated to the primary bug which I have raised this tread on.

Here is the error log, and the mod. Please load Save game Beta. Please check the date of the save game. It is the 18 of Jan, it will crash the next day.

To others whom are interested downloading this mod. Please note this mod is NOT a release version. I will release a proper version in a few weeks.


wcho035

  • Guest
Re: Need help with a fatal error.
« Reply #6 on: February 04, 2020, 02:07:08 pm »
The mod, itself.

Please note I firmly believe the crash has to do with the new terror missions, relating rul files are alienmission, missionscripts, region rul files and texture.

Edit by Meridian: attachment removed
« Last Edit: February 11, 2020, 02:38:59 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Need help with a fatal error.
« Reply #7 on: February 04, 2020, 02:41:42 pm »
There is an alien mission STR_ALIEN_TERROR in STR_ANTARCTICA, race STR_FLOATER.

This mission has spawned a UFO, which is going to land in the 3rd area (missionSiteZone: 2) of the 4th zone (spawnZone: 3).

Code: [Select]
  - type: STR_ALIEN_TERROR
    region: STR_ANTARCTICA
    race: STR_FLOATER
    nextWave: 3
    nextUfoCounter: 0
    spawnCountdown: 1590
    liveUfos: 0
    uniqueID: 2
    missionSiteZone: 2

Such area however doesn't exist in STR_ANTARCTICA.

Code: [Select]
  - type: STR_ANTARCTICA
    cost: 900000
    areas:
      - [0, 360, 60, 90]
    regionWeight: 4
    missionWeights:
      STR_ALIEN_RESEARCH: 25
      STR_ALIEN_BASE: 35
    missionZones:
      -
        - [77, 108.125, 62.125, 76.125]
        - [340.75, 408.5, 57.25, 72.75]
        - [104.375, 148.875, 49.625, 66.25]
        - [175.75, 257.125, 55.625, 73.625]
        - [0, 359.875, 85, 90]
      -
        - [291.125, 296.25, 68.25, 70.5]
        - [129.625, 152.75, 69.75, 73.625]
        - [6.625, 35.125, 72.875, 77]
        - [148.125, 154.75, 70, 72.75]
        - [0, 359.875, 87.5, 90]
      -
        - [291.125, 296.25, 68.25, 70.5]
        - [129.625, 152.75, 69.75, 73.625]
        - [6.625, 35.125, 72.875, 77]
        - [148.125, 154.75, 70, 72.75]
        - [0, 359.875, 87.5, 90]
      -
        - [291.125, 296.25, 68.25, 70.5]
        - [129.625, 152.75, 69.75, 73.625]     # <----------- has only 2 areas, game is looking for the 3rd one
      -
        - [291.125, 296.25, 68.25, 70.5]
        - [129.625, 152.75, 69.75, 73.625]
        - [6.625, 35.125, 72.875, 77]
        - [148.125, 154.75, 70, 72.75]
        - [0, 359.875, 87.5, 90]
      -
        - [121.625, 176.125, -46.25, -21.75]
        - [195.75, 238, -29, 2]
        - [180, 200, 0, 10]
        - [355, 365, -5, 5]
        - [170, 190, -60, -40]
        - [305, 325, -60, -30]
        - [280, 300, 16.125, 36.125]
        - [4.75, 27.625, -52, -44.375]
        - [75, 89, -39, -34.375]
        - [115, 132.5, 21, 25.5]

In other words, corrupt save.
Either you have modified the save manually; or you have changed the ruleset after the mission was already generated in the save.

wcho035

  • Guest
Re: Need help with a fatal error.
« Reply #8 on: February 04, 2020, 03:14:43 pm »
From what I can understand of the diagnosis. The error is related to the game engine trying to search for more areas than it has available. This makes a lot of sense, however, I did not modify vanilla Alien terror in the code. I only change the negative ref in texture assigned to -7 instead of -1.

I was expecting the bug would come from the OTHER new terror missions I had added.

wcho035

  • Guest
Re: Need help with a fatal error.
« Reply #9 on: February 04, 2020, 03:25:34 pm »
To fix this problem, would this new code helps?

Code: [Select]
regions:
  - type: CITIESUFO
    missionZones:
      -
        - [286.125, 286.125, -40.75, -40.75, -27, STR_NEW_YORK]
        - [282.875, 282.875, -38.75, -38.75, -27, STR_WASHINGTON]
        - [241.75, 241.75, -34.125, -34.125, -27, STR_LOS_ANGELES]
        - [284.25, 284.25, -45.5, -45.5, -27, STR_MONTREAL]
        - [277.625, 277.625, -22.5, -22.5, -27, STR_HAVANA]
        - [260.875, 260.875, -19.375, -19.375, -27, STR_MEXICO_CITY]
        - [272.375, 272.375, -41.875, -41.875, -27, STR_CHICAGO]
        - [236.75, 236.75, -49.375, -49.375, -27, STR_VANCOUVER]
        - [263.375, 263.375, -32.75, -32.75, -27, STR_DALLAS]
        - [312.125, 312.125, 15.75, 15.75, -27, STR_BRASILIA]
        - [285.875, 285.875, -4.5, -4.5, -27, STR_BOGOTA]
        - [302.5, 302.5, 34.5, 34.5, -27, STR_BUENOS_AIRES]
        - [289.375, 289.375, 33.375, 33.375, -27, STR_SANTIAGO]
        - [316.875, 316.875, 22.875, 22.875, -27, STR_RIO_DE_JANEIRO]
        - [283, 283, 12, 12, -27, STR_LIMA]
        - [293.125, 293.125, -10.5, -10.5, -27, STR_CARACAS]
        - [359.875, 359.875, -51.5, -51.5, -27, STR_LONDON]
        - [2.375, 2.375, -48.75, -48.75, -27, STR_PARIS]
        - [13.375, 13.375, -52.5, -52.5, -27, STR_BERLIN]
        - [37.625, 37.625, -55.75, -55.75, -27, STR_MOSCOW]
        - [12.5, 12.5, -41.875, -41.875, -27, STR_ROME]
        - [356.25, 356.25, -40.375, -40.375, -27, STR_MADRID]
        - [19.125, 19.125, -47.5, -47.5, -27, STR_BUDAPEST]
        - [3.125, 3.125, -6.5, -6.5, -27, STR_LAGOS]
        - [31.25, 31.25, -30, -30, -27, STR_CAIRO]
        - [352.375, 352.375, -33.5, -33.5, -27, STR_CASABLANCA]
        - [28.125, 28.125, 26.25, 26.25, -27, STR_PRETORIA]
        - [36.75, 36.75, 1.25, 1.25, -27, STR_NAIROBI]
        - [18.5, 18.5, 34, 34, -27, STR_CAPE_TOWN]
        - [15.375, 15.375, 4.375, 4.375, -27, STR_KINSHASA]
        - [32.75, 32.75, -39.875, -39.875, -27, STR_ANKARA]
        - [77.25, 77.25, -28.625, -28.625, -27, STR_DELHI]
        - [67, 67, -24.875, -24.875, -27, STR_KARACHI]
        - [44.5, 44.5, -33.25, -33.25, -27, STR_BAGHDAD]
        - [51.5, 51.5, -35.625, -35.625, -27, STR_TEHRAN]
        - [73.125, 73.125, -18.875, -18.875, -27, STR_BOMBAY]
        - [88.375, 88.375, -22.625, -22.625, -27, STR_CALCUTTA]
        - [139.75, 139.75, -35.625, -35.625, -27, STR_TOKYO]
        - [116.375, 116.375, -39.875, -39.875, -27, STR_BEIJING]
        - [100.625, 100.625, -13.625, -13.625, -27, STR_BANGKOK]
        - [121, 121, -14.625, -14.625, -27, STR_MANILA]
        - [127, 127, -37.5, -37.5, -27, STR_SEOUL]
        - [103.875, 103.875, -1.375, -1.375, -27, STR_SINGAPORE]
        - [106.75, 106.75, 6.25, 6.25, -27, STR_JAKARTA]
        - [121.5, 121.5, -31.25, -31.25, -27, STR_SHANGHAI]
        - [114.125, 114.125, -22.25, -22.25, -27, STR_HONG_KONG]
        - [82.75, 82.75, -55, -55, -27, STR_NOVOSIBIRSK]
        - [149.125, 149.125, 35.375, 35.375, -27, STR_CANBERRA]
        - [175.125, 175.125, 41.25, 41.25, -27, STR_WELLINGTON]
        - [145, 145, 37.875, 37.875, -27, STR_MELBOURNE]
        - [115.75, 115.75, 32, 32, -27, STR_PERTH]
        - [286.875, 286.875, -38.25, -38.25, -27, STR_NEW_YORK]
        - [290.25, 290.25, -41.25, -41.25, -27, STR_BOSTON]
        - [271.25, 271.25, -50.875, -50.875, -27, STR_FORT_SEVERN]
        - [343.75, 343.75, -14.75, -14.75, -27, STR_DAKAR]
        - [319.375, 319.375, 8.625, 8.625, -27, STR_RECIFE]
        - [140, 140, -36, -36, -27, STR_TOKYO]
        - [120.75, 120.75, -32, -32, -27, STR_SHANGHAI]
        - [137, 137, -44.75, -44.75, -27, STR_VLADIVOSTOK]
        - [0, 0, -48.75, -48.75, -27, STR_LONDON]
        - [356.25, 356.25, -53.75, -53.75, -27, STR_ABERDEEN]
        - [10, 10, -58.125, -58.125, -27, STR_OSLO]
        - [287, 287, -17, -17, -27, STR_JAMAICA]
        - [279.75, 279.75, -9, -9, -27, STR_PANAMA]
        - [278.5, 278.5, -27, -27, -27, STR_MIAMI]
        - [345, 345, 8, 8, -27, STR_ASCENSION_ISLAND]
        - [343.75, 343.75, -14.75, -14.75, -27, STR_DAKAR]
        - [319.375, 319.375, 8.625, 8.625, -27, STR_RECIFE]
        - [210.125, 210.125, -57.75, -57.75, -27, STR_ANCHORAGE]
        - [238, 238, -37, -37, -27, STR_SAN_FRANCISCO]
        - [237.75, 237.75, -49, -49, -27, STR_VANCOUVER]
        - [147.5, 147.5, 40.75, 40.75, -27, STR_TASMANIA]
        - [175, 175, 40.25, 40.25, -27, STR_WELLINGTON]
        - [352.5, 352.5, -36.25, -36.25, -27, STR_LISBON]
        - [32, 32, -30, -30, -27, STR_PORT_SAID]
        - [5, 5, -40, -40, -27, STR_MARSEILLES]
        - [13, 13, -29.375, -29.375, -27, STR_TRIPOLI]
        - [121, 121, -14.5, -14.5, -27, STR_MANILA]
        - [114, 114, -23, -23, -27, STR_HONG_KONG]
        - [102.625, 102.625, -1.25, -1.25, -27, STR_SINGAPORE]
        - [100.5, 100.5, -12.5, -12.5, -27, STR_BANGKOK]
        - [131, 131, 13.25, 13.25, -27, STR_DARWIN]
        - [73, 73, -19, -19, -27, STR_BOMBAY]
alienMissions:
  - type: STR_ALIEN_TERROR
    points: 10
    objective: 3
    spawnZone: 0 #Mission zone for terror missions <--------------- Change it to zero
    raceWeights:
      0:
        STR_SECTOID: 30
        STR_FLOATER: 70
      1:
        STR_SECTOID: 60
        STR_FLOATER: 40
      3:
        STR_SECTOID: 20
        STR_SNAKEMAN: 60
        STR_FLOATER: 20
      6:
        STR_SECTOID: 10
        STR_SNAKEMAN: 20
        STR_ETHEREAL: 40
        STR_MUTON: 20
        STR_FLOATER: 10
      9:
        STR_SECTOID: 20
        STR_SNAKEMAN: 30
        STR_ETHEREAL: 20
        STR_MUTON: 20
        STR_FLOATER: 10
    waves:
      - ufo: STR_TERROR_SHIP
        count: 1
        trajectory: P27
        timer: 9000
        objective: true
missionScripts:
  - type: recurringTerrorTFTD
    missionWeights:
      0:
        STR_ALIEN_TERROR: 100
    regionWeights:
      0:
        CITIESUFO: 100
    varName: terrortftd
    useTable: false
    firstMonth: 0
    executionOdds: 100
    #startDelay: 150
    maxRuns: -1
    #researchTriggers:                   
    #  STR_ALIEN_SIGNAL: true
globe:
  textures:
    - id: -27
      deployments:
        STR_TERROR_MISSION_UFO: 50

I will force the spawn zone to 1 mission zone. Namely zero.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Need help with a fatal error.
« Reply #10 on: February 04, 2020, 04:40:56 pm »
To fix this problem, would this new code helps?

You don't need any fix in my opinion.

Just start a new game, so that you don't have a corrupt save and everything will work fine.

wcho035

  • Guest
Re: Need help with a fatal error.
« Reply #11 on: February 05, 2020, 01:05:39 pm »
Hi, thanks for all the help. Fixed the problem. Have to rewrite the coding for everything to do it.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Need help with a fatal error.
« Reply #12 on: February 05, 2020, 02:05:11 pm »
Hi, thanks for all the help. Fixed the problem. Have to rewrite the coding for everything to do it.

Just for future reference if anyone else is reading this looking for similar issues:

There was no problem and there is no need to rewrite anything.
The ruleset was 100% correct.
The issue was an incompatible save (between different versions of the same mod), which can be solved either by modifying the save or by starting a new game.

wcho035

  • Guest
Re: Need help with a fatal error.
« Reply #13 on: February 06, 2020, 12:40:17 am »
Hi Meridian, do you know where I can find this section of the code in the ruleset?

Code: [Select]
  - type: STR_ALIEN_TERROR
    region: STR_ANTARCTICA
    race: STR_FLOATER
    nextWave: 3
    nextUfoCounter: 0
    spawnCountdown: 1590
    liveUfos: 0
    uniqueID: 2
    missionSiteZone: 2

I am still experiencing the same error.

wcho035

  • Guest
Re: Need help with a fatal error.
« Reply #14 on: February 06, 2020, 12:42:12 am »
Here is the Region.rul with the logs. I just can't figure out why it is looking for something beyond the missionzone.
« Last Edit: February 06, 2020, 03:23:25 am by Precentor Apollyon »