OpenXcom Forum

Modding => Help => Topic started by: Kato on October 04, 2018, 05:26:35 pm

Title: Custom maps
Post by: Kato 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?
Title: Re: Custom maps
Post by: Warboy1982 on October 04, 2018, 05:36:08 pm
that's in the terrain definition in the ruleset
Title: Re: Custom maps
Post by: Kato 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.
Title: Re: Custom maps
Post by: Solarius Scorch on October 04, 2018, 06:14:11 pm
Warboy meant alienDeployments, not terrains.
Title: Re: Custom maps
Post by: Kato on October 04, 2018, 06:49:30 pm
It works! >^_^<
Title: Re: Custom maps
Post by: Warboy1982 on October 04, 2018, 06:52:52 pm
right, yes, those.
Title: Re: Custom maps
Post by: Kato 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.
Title: Re: Custom maps
Post by: Meridian on October 05, 2018, 07:58:18 pm
Can you upload the whole mod, including the map blocks and everything else?
Title: Re: Custom maps
Post by: Kato 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).

Title: Re: Custom maps
Post by: Meridian 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
Title: Re: Custom maps
Post by: Kato 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.
Title: Re: Custom maps
Post by: Meridian 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.
Title: Re: Custom maps
Post by: Kato 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?
Title: Re: Custom maps
Post by: Warboy1982 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
Title: Re: Custom maps
Post by: Meridian 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
Title: Re: Custom maps
Post by: Kato on October 09, 2018, 06:07:10 pm
Got it.

It works! Huzzah!

Code: [Select]
items:
  - type: STR_D-GUY
    size: 0.6
    weight: 120
    bigSprite: 9000
    floorSprite: 9000
    costThrow:
      energy: 60
      time: 30
    flatThrow:
      time: true
    twoHanded: true
    blockBothHands: true
    invWidth: 2
    invHeight: 3
Title: Re: Custom maps
Post by: Meridian on October 09, 2018, 09:56:46 pm
You really should not use sprite indices so high... you will get conflicts with other mods.

Use numbers lower than 1000.
From 200 to 999 should be safe in all situations.
Title: Re: Custom maps
Post by: Kato on October 09, 2018, 11:29:53 pm
Changed both to 669. Wasn't easy cuz almost all of these numbers are used already.
Title: Re: Custom maps
Post by: Meridian on October 09, 2018, 11:52:04 pm
Changed both to 669. Wasn't easy cuz almost all of these numbers are used already.

Used by what? By your mod?

Cause if they are used by piratez, that doesn't matter, you can (and should) use the same numbers in your submod, there will be no conflicts, the engine takes care of that.
Title: Re: Custom maps
Post by: Kato on October 10, 2018, 06:34:07 am
Purrfect >^_^<

I have a race with 16 different members. How to assign them all with MapView2 unit types and node ranks? Or is there a way to spawn them at certain coordinates of certain map via rulesets?

Hmmm... Via rulesets - solved partially:
https://openxcom.org/forum/index.php/topic,6535.msg102193.html

But how to equip them?

And more: how to spawn a weapon charged with ammo?
Code: [Select]
        items:
          STR_SOME_WEAPON:
            - [X, Y, Z] #it's empty - so, what to do next?
Title: Re: Custom maps
Post by: Hobbes on October 21, 2018, 02:54:51 pm
I have a race with 16 different members. How to assign them all with MapView2 unit types and node ranks?

You can't - there's a technical limitation with to the .RMP data files where each node is assigned a single byte, so nodes can only have 8 ranks attributed to it. Any additional ranks greater than 7 are all spawn in nodes rank 0
Title: Re: Custom maps
Post by: Kato on November 26, 2018, 02:43:20 pm
How to spawn enemy units with a certain sight directions? They're not intended to patrol - just standing at their posts and overwatching.
Title: Re: Custom maps
Post by: Hobbes on November 26, 2018, 03:09:13 pm
How to spawn enemy units with a certain sight directions? They're not intended to patrol - just standing at their posts and overwatching.

It's not possible to spawn units in a certain direction. And you'll need to set their TUs to 0 if you don't want them to leave the location where they are spawned.
Title: Re: Custom maps
Post by: Kato on November 26, 2018, 03:19:25 pm
How sad >_<
Title: Re: Custom maps
Post by: Solarius Scorch on November 26, 2018, 03:28:10 pm
Actually don't set their TUs to 0, since this may cause unforeseen effects... Set their Stamina to 0 instead.
Title: Re: Custom maps
Post by: ohartenstein23 on November 26, 2018, 04:24:25 pm
There's a relatively new OXCE armor tag that completely prevents unit movement:
Code: [Select]
armors:
  - type: STR_ARMOR_THAT_DOESNT_MOVE
    allowsMovement: false
Title: Re: Custom maps
Post by: Solarius Scorch on November 26, 2018, 04:35:06 pm
There's a relatively new OXCE armor tag that completely prevents unit movement:
Code: [Select]
armors:
  - type: STR_ARMOR_THAT_DOESNT_MOVE
    allowsMovement: false

Wow, neato. Thanks!
Is there any advantage this tag has over Stamina 0?
Title: Re: Custom maps
Post by: Meridian on November 26, 2018, 04:47:25 pm
Is there any advantage this tag has over Stamina 0?

You can still move up/down with stamina 0.
Title: Re: Custom maps
Post by: Solarius Scorch on November 26, 2018, 04:53:04 pm
You can still move up/down with stamina 0.

Right, makes sense for flying units (or if you spawn it on a lift). Thanks!
Title: Re: Custom maps
Post by: Kato on November 26, 2018, 05:26:10 pm
Hmmm... Automatic turrets! Zero-Stamina is really make sence. Or the armor that doesn't move... There's some ideas for Kato >^_^<
Title: Re: Custom maps
Post by: ohartenstein23 on November 26, 2018, 05:30:20 pm
Also allows you to use Dioxine's vehicle stamina trick - limiting weapons fire by requiring large amounts of energy instead of TUs, so you can have a turret that can use most of its TUs turning and still get a shot or two while not worrying about it being able to fire way too many times per turn.
Title: Re: Custom maps
Post by: Hobbes on November 26, 2018, 08:05:33 pm
Actually don't set their TUs to 0, since this may cause unforeseen effects...

And the units wouldn't be able to shoot, if they are turrets