OpenXcom Forum

Modding => Help => Topic started by: wcho035 on February 03, 2020, 01:16:36 pm

Title: Need help with a fatal error.
Post by: wcho035 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.
Title: Re: Need help with a fatal error.
Post by: Solarius Scorch 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.
Title: Re: Need help with a fatal error.
Post by: wcho035 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?
Title: Re: Need help with a fatal error.
Post by: Meridian 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.
Title: Re: Need help with a fatal error.
Post by: wcho035 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
Title: Re: Need help with a fatal error.
Post by: wcho035 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.

Title: Re: Need help with a fatal error.
Post by: wcho035 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
Title: Re: Need help with a fatal error.
Post by: Meridian 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.
Title: Re: Need help with a fatal error.
Post by: wcho035 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.
Title: Re: Need help with a fatal error.
Post by: wcho035 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.
Title: Re: Need help with a fatal error.
Post by: Meridian 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.
Title: Re: Need help with a fatal error.
Post by: wcho035 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.
Title: Re: Need help with a fatal error.
Post by: Meridian 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.
Title: Re: Need help with a fatal error.
Post by: wcho035 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.
Title: Re: Need help with a fatal error.
Post by: wcho035 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.
Title: Re: Need help with a fatal error.
Post by: Meridian on February 06, 2020, 12:45:38 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.

This is not ruleset, it's copied from your save file (Beta.sav).
You can find it under alienMissions section.

Here is the Region.rul with the logs. I just can't figure out why it is looking for something beyond the missionzone.

I am telling you for the fifth time now, it is crashing because your save is corrupted.
I am not going to repeat it for the sixth time.
Title: Re: Need help with a fatal error.
Post by: wcho035 on February 06, 2020, 12:47:10 am
I have started a new game Meridian. I have not load it from a save file. I understand it is frustrating. If it is from a save file I will tell you.
Title: Re: Need help with a fatal error.
Post by: wcho035 on February 06, 2020, 12:47:47 am
This is a problem from a different mod in fact. Same kind of problem. It is the Terror mission looking for something beyond its range or something in a mission zone.

In fact, it crashes every time when I start a new game and test it through the month. I did not load it from any save.
Title: Re: Need help with a fatal error.
Post by: Meridian on February 06, 2020, 12:56:12 am
This is a problem from a different mod in fact. Same kind of problem. It is the Terror mission looking for something beyond its range or something in a mission zone.

In fact, it crashes every time when I start a new game and test it through the month. I did not load it from any save.

And how am I supposed to know that?

You have quoted lines from a save we discussed earlier.

You have not said anything about a new game or about a new mod or anything like that.
Title: Re: Need help with a fatal error.
Post by: wcho035 on February 06, 2020, 12:59:35 am
Sorry Meridian. Please try to understand communicating over the net is a tough situation. The true intent of a message can get lost and lead to frustration.

I have a solution to this. I don't like it, but to save time I want to try it. Firstly, can you assign a blank texture value into a missionzone for city? Like this for example?

[236.75, 236.75, -49.375, -49.375, -19, STR_VANCOUVER]   the -19 can be blank like.


[236.75, 236.75, -49.375, -49.375, , STR_VANCOUVER]   

If not what is the syntax legal way to do it?
Title: Re: Need help with a fatal error.
Post by: wcho035 on February 06, 2020, 03:57:51 am
I have done a similar diagnostic on the error vs the save game, like you did, with the latest save I have. I found a pattern finally.

Code: [Select]
[06-02-2020_12-39-44] [FATAL] A fatal error has occurred: vector::_M_range_check: __n (which is 31) >= this->size() (which is 2)
[06-02-2020_12-39-44] [FATAL] 0x5998e0 OpenXcom::CrossPlatform::stackTrace(void*)
[06-02-2020_12-39-44] [FATAL] 0x59a750 OpenXcom::CrossPlatform::crashDump(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
[06-02-2020_12-39-44] [FATAL] 0x41c880 exceptionLogger()
[06-02-2020_12-39-44] [FATAL] 0xb41d60 MPEGaction::MPEGaction()
[06-02-2020_12-39-44] [FATAL] 0xd0ffd0 void std::iter_swap<__gnu_cxx::__normal_iterator<OpenXcom::ScriptProcData*, std::vector<OpenXcom::ScriptProcData, std::allocator<OpenXcom::ScriptProcData> > >, __gnu_cxx::__normal_iterator<OpenXcom::ScriptProcData*, std::vector<OpenXcom::ScriptProcData, std::allocator<OpenXcom::ScriptProcData> > > >(__gnu_cxx::__normal_iterator<OpenXcom::ScriptProcData*, std::vector<OpenXcom::ScriptProcData, std::allocator<OpenXcom::ScriptProcData> > >, __gnu_cxx::__normal_iterator<OpenXcom::ScriptProcData*, std::vector<OpenXcom::ScriptProcData, std::allocator<OpenXcom::ScriptProcData> > >)
[06-02-2020_12-39-44] [FATAL] 0xd15660 std::__detail::_Compiler<std::__cxx11::regex_traits<char> >::_M_expression_term<true, true>(std::pair<bool, char>&, std::__detail::_BracketMatcher<std::__cxx11::regex_traits<char>, true, true>&)::{lambda(char)#1}::operator()(char) const
[06-02-2020_12-39-44] [FATAL] 0xd04520 void std::__merge_sort_with_buffer<__gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*, std::allocator<OpenXcom::Soldier*> > >, OpenXcom::Soldier**, __gnu_cxx::__ops::_Iter_comp_iter<OpenXcom::SortFunctor> >(__gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*, std::allocator<OpenXcom::Soldier*> > >, __gnu_cxx::__normal_iterator<OpenXcom::Soldier**, std::vector<OpenXcom::Soldier*, std::allocator<OpenXcom::Soldier*> > >, OpenXcom::Soldier**, __gnu_cxx::__ops::_Iter_comp_iter<OpenXcom::SortFunctor>)
[06-02-2020_12-39-44] [FATAL] 0x83e870 OpenXcom::AlienMission::think(OpenXcom::Game&, OpenXcom::Globe const&)
[06-02-2020_12-39-44] [FATAL] 0x6abb60 OpenXcom::GeoscapeState::time30Minutes()
[06-02-2020_12-39-44] [FATAL] 0x6b55d0 OpenXcom::GeoscapeState::timeAdvance()
[06-02-2020_12-39-44] [FATAL] 0x6707f0 OpenXcom::Timer::think(OpenXcom::State*, OpenXcom::Surface*)
[06-02-2020_12-39-44] [FATAL] 0x5b1b40 OpenXcom::Game::run()
[06-02-2020_12-39-44] [FATAL] 0x41c950 SDL_main
[06-02-2020_12-39-44] [FATAL] 0x95d1c0 console_main
[06-02-2020_12-39-44] [FATAL] 0x95d2e0 WinMain
[06-02-2020_12-39-44] [FATAL] ??
[06-02-2020_12-39-44] [FATAL] ??
[06-02-2020_12-39-44] [FATAL] 0x7ff8dc221fd0 BaseThreadInitThunk
[06-02-2020_12-39-44] [FATAL] 0x7ff8dd31ef90 RtlUserThreadStart
[06-02-2020_12-40-17] [FATAL] OpenXcom has crashed: vector::_M_range_check: __n (which is 31) >= this->size() (which is 2)

Note the which is 31, in the same game, I checked antarctic.

Code: [Select]
  - type: STR_FACTION_TERRORMERC
    region: STR_ANTARCTICA
    race: STR_MERC_REGIMENT
    nextWave: 3
    nextUfoCounter: 0
    spawnCountdown: 1530
    liveUfos: 0
    uniqueID: 17
    missionSiteZone: 31

Same problem, the third spawn zone has no areas for it to spawn. To solve this, I need a regionweight for my missionscript.

Similar to TFTD,

Code: [Select]
    regionWeights:
      0:
        STR_NORTH_ATLANTIC: 10
        STR_SOUTH_ATLANTIC: 10
        STR_NORTH_PACIFIC: 10
        STR_SOUTH_PACIFIC: 10
        STR_MEDITERRANEAN: 10
        STR_SOUTH_CHINA_SEA: 10
        STR_INDIAN_OCEAN: 10
        STR_THE_EAST_SEA: 10
        STR_NORTH_SEA: 10
        STR_CARRIBEAN: 10
 

Excluded antartica and artic will hopefully solved the problem.
Title: Re: Need help with a fatal error.
Post by: wcho035 on February 06, 2020, 09:36:57 am
I have started another game and another crashed. I believe Ohartenstien23 have the same problem too, from his discord posting.

What I am trying to do is to implement different terror missions per faction in my mod. Each faction will do Port, Island, UFO City style terror missions and ship attack terror missions.

For Ship attack, because it is not assigned to a negative texture with a city per area. I can null the problem by using

    objective: 0

However, for the others, I keep getting out of vector crashes, even with using regionweight to exclude antarctic and other region that has no cities assign to the 3rd mission zone.
Title: Re: Need help with a fatal error.
Post by: wcho035 on February 06, 2020, 11:03:04 am
I am able to solve the problem using objective: 0 and using coding similar to how a shipping terror attack is generated.

Otherwise, it will generate a vector error.

I will never know if there is a bug. However, I am able to solve my problem at the moment. Finger's cross.
Title: Re: Need help with a fatal error.
Post by: wcho035 on February 06, 2020, 03:29:13 pm
Latest version.

Edit by Meridian: attachment removed