Author Topic: [Solved] Multiple craft maps  (Read 2931 times)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11721
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
[Solved] Multiple craft maps
« on: December 07, 2022, 10:10:49 pm »
I am trying to make an X-Com craft with multiple maps (to be selected at random - same as with UFOs), but the game doesn't cooperate.

Code: [Select]
crafts:
  - type: STR_MY_STARTING_BUILDING
    (...)
    battlescapeTerrainData:
      name: ATRIUM_DEFENSE
      mapDataSets:
        - BLANKS
        - ROADS
        - URBITS
        - URBAN
        - FRNITURE
        - BATHBITZ_HT
        - TAVERN
        - CAFEENTRY
      mapBlocks:
        - name: D_ATRIUM_DEF
          width: 20
          length: 20
        - name: D_ATRIUM_3_DEF
          width: 20
          length: 20

When I do this, the game doesn't load. When I delete any of these two mapBlocks, it loads fine.

Is my syntax wrong, or is it simply impossible to do so with a craft?
« Last Edit: April 21, 2023, 10:26:22 am by Meridian »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9085
    • View Profile
Re: Multiple craft maps
« Reply #1 on: April 10, 2023, 04:46:59 pm »
Code: [Select]
crafts:
  - type: STR_SKYRANGER
    sprite: 0
    fuelMax: 1500
    damageMax: 150
    speedMax: 760
    accel: 2
    soldiers: 14
    vehicles: 3
    costBuy: 500000
    costRent: 500000
    forceShowInMonthlyCosts: true
    refuelRate: 50
    transferTime: 72
    score: 200
    battlescapeTerrainData:
      name: PLANE
      mapDataSets:
        - BLANKS
        - PLANE
        - AVENGER
      mapBlocks:
        - name: PLANE
          width: 10
          length: 20
        - name: AVENGER
          width: 10
          length: 20

It doesn't crash for me.
What is the error you're getting?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11721
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Multiple craft maps
« Reply #2 on: April 11, 2023, 11:01:08 am »
The error:

Code: [Select]
[11-04-2023_09-57-26] [ERROR] failed to load 'X-Com Files'
D:/Gry/OpenXcom_XFiles/user/mods/XComFiles/Ruleset/crafts_XCOMFILES.rul: yaml-cpp: error at line 1418, column 9: end of map not found

1418 being the line where the second map starts.

If you want to give it a try, please check X-Com Files from GitHub and replace crafts_XCOMFILES.rul with the one attached. (Or you can just take the file from GitHub and unhash the section which starts at line 1418.)

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9085
    • View Profile
Re: Multiple craft maps
« Reply #3 on: April 11, 2023, 12:34:07 pm »
There is nothing attached.

I tried the github one and it loaded when I commented out the misplaced line 1417   (craftInventoryTile: [16, 3, 0])
You cannot have anything between the two mapBlocks entries (other than empty lines).

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11721
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Multiple craft maps
« Reply #4 on: April 11, 2023, 01:15:42 pm »
Sorry about the attachment, but I see you found the issue. Thanks!
But how do I set up craftInventoryTile? Naturally these are two different maps, so it requires two different entries. Is this about the number of spaces?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9085
    • View Profile
Re: Multiple craft maps
« Reply #5 on: April 11, 2023, 02:00:08 pm »
there is only one `craftInventoryTile` per craft

it is currently not possible to define different ones per mapBlock

PS: same applies to `deployment`

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11721
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Multiple craft maps
« Reply #6 on: April 11, 2023, 02:13:50 pm »
OK, thanks. I'll work around it. :)

EDIT: It appears from testing that with multiple maps, craftInventoryTile is ignored instead of applied to all the maps. Is this correct?
« Last Edit: April 11, 2023, 02:24:02 pm by Solarius Scorch »

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: Multiple craft maps
« Reply #7 on: April 17, 2023, 09:28:49 am »
Darn, that's a good idea. How i missed that. Thanks, Solarius Scorch

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: [Solved] Multiple craft maps
« Reply #8 on: August 19, 2023, 04:34:52 pm »
I am trying to make an X-Com craft with multiple maps (to be selected at random - same as with UFOs), but the game doesn't cooperate.

Code: [Select]
crafts:
  - type: STR_MY_STARTING_BUILDING
    (...)
    battlescapeTerrainData:
      name: ATRIUM_DEFENSE
      mapDataSets:
        - BLANKS
        - ROADS
        - URBITS
        - URBAN
        - FRNITURE
        - BATHBITZ_HT
        - TAVERN
        - CAFEENTRY
      mapBlocks:
        - name: D_ATRIUM_DEF
          width: 20
          length: 20
        - name: D_ATRIUM_3_DEF
          width: 20
          length: 20

When I do this, the game doesn't load. When I delete any of these two mapBlocks, it loads fine.

Is my syntax wrong, or is it simply impossible to do so with a craft?

if that's applied with specific craft from mapScripts, I think the best way to play around it - make a several different crafts (if you want very different buildings), and make mapScript to choose one (like we do with addLine commands, for instance).