Author Topic: Custom maps  (Read 14025 times)

Offline Kato

  • Captain
  • ***
  • Posts: 51
  • ASHU is coming
    • View Profile
Custom maps
« on: October 04, 2018, 05:26:35 pm »
There'll be some questions from rookie (really rookie >_<) modder about maps...

I tried to change a map's height: all DESERT map-blocks got +1 additional level (total 5) via Mapview2. Then, I ran a quick battle at 'Desert' terrain, but the game crashed.

Quote
A fatal error has occurred: Height of map MAPS/DESERT09.MAP too big for this mission, block is 5, expected: 4

So, how can I change 'expected' height?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Custom maps
« Reply #1 on: October 04, 2018, 05:36:08 pm »
that's in the terrain definition in the ruleset

Offline Kato

  • Captain
  • ***
  • Posts: 51
  • ASHU is coming
    • View Profile
Re: Custom maps
« Reply #2 on: October 04, 2018, 05:53:01 pm »
'Terrains.rul' file includes names of map-blocks, their width & length. I added 'height: 5' to all Desert blocks - and still the same thing.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11722
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Custom maps
« Reply #3 on: October 04, 2018, 06:14:11 pm »
Warboy meant alienDeployments, not terrains.

Offline Kato

  • Captain
  • ***
  • Posts: 51
  • ASHU is coming
    • View Profile
Re: Custom maps
« Reply #4 on: October 04, 2018, 06:49:30 pm »
It works! >^_^<

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Custom maps
« Reply #5 on: October 04, 2018, 06:52:52 pm »
right, yes, those.

Offline Kato

  • Captain
  • ***
  • Posts: 51
  • ASHU is coming
    • View Profile
Re: Custom maps
« Reply #6 on: October 05, 2018, 06:41:35 pm »
Well, I have a 60x60x8 monoblock-map (one MAP and one RMP files). I want it to be an alien base. There are two ways to apply it:

1 - Just to name these files as one of already existing blocks, replace that block with them and slightly edit mapscript. It works, but don't satisfy me.

2 - To create files with new names and integrate them in rulesets. How to do it properly? I've changed  mapScripts, terrains and alienDeployments - and here's the log:

Quote
[05-10-2018_22-31-18]   [FATAL]   A fatal error has occurred: Map failed to fully generate.
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   0xa89ea0 IMG_LoadWEBP_RW
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   ??
[05-10-2018_22-31-18]   [FATAL]   0x77023398 BaseThreadInitThunk
[05-10-2018_22-31-18]   [FATAL]   0x77559e8f RtlInitializeExceptionChain
[05-10-2018_22-31-18]   [FATAL]   0x77559e8f RtlInitializeExceptionChain

See my broken files below.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9093
    • View Profile
Re: Custom maps
« Reply #7 on: October 05, 2018, 07:58:18 pm »
Can you upload the whole mod, including the map blocks and everything else?

Offline Kato

  • Captain
  • ***
  • Posts: 51
  • ASHU is coming
    • View Profile
Re: Custom maps
« Reply #8 on: October 05, 2018, 11:52:39 pm »
Here all I work with for now.

Root_1 is the 1st way (use already existing name - it works, but it's barbaric).

Root_2 is the 2nd way (without replacing original MAP and RMP - here's the crash).


Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9093
    • View Profile
Re: Custom maps
« Reply #9 on: October 06, 2018, 10:21:19 am »
First block has index 0, not 1.

Also attaching repackaged as a real mod.

Code: [Select]
mapScripts:
  - type: BOSSBATTLE
    commands:
    - type: fillArea
      blocks: [0]           # first block has index 0
      freqs: [1]
    - type: digTunnel
      direction: both
      tunnelData:
        level: 0
        MCDReplacements:
          - type: westWall
            set: 2
            entry: 18
          - type: northWall
            set: 2
            entry: 17
          - type: corner
            set: 2
            entry: 19
          - type: floor
            set: 1
            entry: 63

Offline Kato

  • Captain
  • ***
  • Posts: 51
  • ASHU is coming
    • View Profile
Re: Custom maps
« Reply #10 on: October 06, 2018, 04:53:05 pm »
Wow. That was so close. Thanks a lot >^_^<

(Kato obtained +20 XP)

Next question: how to disable tactical saving without the Ironman mode? This have to be a feature for one certain map - like T'Leth-Level#3.
« Last Edit: October 06, 2018, 06:59:30 pm by Kato »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9093
    • View Profile
Re: Custom maps
« Reply #11 on: October 08, 2018, 10:24:29 pm »
Next question: how to disable tactical saving without the Ironman mode? This have to be a feature for one certain map - like T'Leth-Level#3.

Not possible.

Offline Kato

  • Captain
  • ***
  • Posts: 51
  • ASHU is coming
    • View Profile
Re: Custom maps
« Reply #12 on: October 09, 2018, 05:00:50 pm »
I need Doomguy's corpse. But there's an error because of it when I click the 'next turn' button after destroyibg the Brain.
Code: [Select]
[09-10-2018_20-44-13] [FATAL] A fatal error has occurred: Segmentation fault. This usually indicates something missing in a mod.
[09-10-2018_20-44-13] [FATAL] ??
[09-10-2018_20-44-13] [FATAL] ??
[09-10-2018_20-44-13] [FATAL] 0x77677428 RtlKnownExceptionFilter
[09-10-2018_20-44-13] [FATAL] 0x77639e8f RtlInitializeExceptionChain

Having this corpse in anyone's inventory also leads to crash.

Everything allright if I delete this from Terrains.rul :
Code: [Select]
          STR_CORPSE_SLAVE_DOOM:
            - [4, 1, 0]

Also I can destroy this item - and there'll be no errors too.

What's the reason of this crash and how to fix it?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Custom maps
« Reply #13 on: October 09, 2018, 05:35:50 pm »
if i had to guess i'd imagine it's a lacking or mis-defined geoscape corpse item

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9093
    • View Profile
Re: Custom maps
« Reply #14 on: October 09, 2018, 05:49:13 pm »
What's the reason of this crash and how to fix it?

You can't put corpses (battleType=11) on the map as normal items... without an actual unit.

You have two options:
1. spawn a real unit, kill it and recover a corpse the usual way
2. spawn the corresponding geoscape item directly (STR_DOOMGUY_ARMOR_DMG), not the battlescape corpse (STR_CORPSE_SLAVE_DOOM)... you may need to set recover: true on such item if it doesn't have it, also maybe define width, height, sprites, etc. everything that a battlescape item needs