Author Topic: [Answered] addCraft in multi-stage mission does not work properly.  (Read 839 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
As players of my x-chronicles mod have seen, multi-stage mission cause ctd when i use "addCraft" in a mapScript of the second stage. (In a past it was maked through addUfo for xcom units placement, but it was too bugged)
Why i think, that this can be a bug? Because if i start quickbattle of that map(of second stage) - all works fine. If i start quickbattle of first stage, and then proceed to second - ctd repeats. No matter which craft i use.

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: [Bug?] addCraft in multi-stage mission does not work properly.
« Reply #1 on: April 11, 2024, 07:37:12 pm »
Just carried out some some experiments via new battle and it seems that the addCraft command fails when it's executed in any followup stage of a multi-stage mission. It works fine when the new battle calls it directly, but that only means it would also work in campaign if the mission was a single stage and you already started within the rift.

Tweaking one of the scripts, in this case the mushroom rift script, I 'borrowed' part of the entry block for the tower interior map and placed it IF the addCraft failed to execute thus creating an alternate spot for the player units to spawn. As you can see, it works 'flawlessly' if you don't consider the mismatch in terrain, but this is for testing purposes and an actual proper entry point map block could be made instead.

The modified code is as follows:
Code: [Select]
  - type: MUSHROOMSCRIPT
    commands:
    - type: addBlock
      size: 2
      executions: 1
    - type: addCraft
      label: 1
      craftName: STR_BRIFT00

    - type: addBlock
      conditionals: [-1]
      rects:
        - [1,2,1,1]       #Place entry
      size: [1, 1, 6]
      verticalLevels:
      - type: ground
        terrain: MAGE_TOWER_INT
        blocks: 0
        size: [1, 1, 2]

    - type: fillArea
Note how the addCraft now has a 'label: 1' and a whole new addBlock borrowed from the tower script, at least the important part, with a conditional added. While it doesn't direcly fix the issue with the addCraft it does give you a temporary workaround / failsafe to use.
« Last Edit: April 21, 2024, 03:03:33 pm by CrazedHarpooner »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: [Bug?] addCraft in multi-stage mission does not work properly.
« Reply #2 on: April 21, 2024, 02:39:29 pm »
OXC/OXCE don't support addCraft command in multi-stage missions (in stage 2+) at all.

I.e. it's not a bug.

Please open a thread under Suggestions, if this feature is desired.