Author Topic: Mapscript using blank Terrain crash issue.  (Read 2019 times)

wcho035

  • Guest
Mapscript using blank Terrain crash issue.
« on: March 02, 2020, 07:29:21 pm »
Hi, Ohartenstein23, I believe you are the only person with the experience and knowledge to
help me with this complex mapscript question.

I recently experimented with Blank Terrain, like using Terrain without maps but mapscript alone to generate a battlescape mission.

An example of my Blank Terrain.

Code: [Select]
terrains: #done
  - name: TLETHBASESEA
    music:
      - GMTACWET
    depth: [1, 2]
    ambience: 990
    ambientVolume: 1.5
    mapDataSets:
      - BLANKS
    script: ALIEMBASEMAPFINAL

Code: [Select]
mapScripts:
  - type: ALIEMBASEMAPFINAL
    commands:
    - type: addCraft
      terrain: globeTerrain
      groups: 1
    - type: addBlock
      size: [1,1,4]
      verticalLevels:
      - type: ground
        size: [1,1,0]
        terrain: globeTerrain
        groups: 1
      - type: middle
        size: [1,1,4]
        terrain: ALIENBASE01
    - type: addBlock
      size: [1,1,4]
      verticalLevels:
      - type: ground
        size: [1,1,0]
        terrain: globeTerrain
        groups: 1
      - type: middle
        size: [1,1,4]
        terrain: ALIENBASE02
        executionChances: 50
    - type: addBlock
      size: [1,1,4]
      verticalLevels:
      - type: ground
        size: [1,1,0]
        terrain: globeTerrain
        groups: 1
      - type: middle
        size: [1,1,4]
        terrain: ALIENBASE02
        executionChances: 50
    - type: addBlock
      size: 2
      execution: 2
      terrain: globeTerrain
    - type: fillArea
      terrain: globeTerrain

Notice how I use terrain like lego blocks, I plug in buildings into terrain maps so I can generate cities or towns on the fly using any terrain. Unfortunately, this blank terrain in turn can't be use by other mapscripts to build something else. Like for example, if I have a Desert City blank terrain, using mapscript alone to generate the city. This will work fine, if the mapscript or blank terrain is use in Aliendeployment alone. However, if I want to build or plug in an alienbase using the blank terrain Desert City for example,

Code: [Select]
mapScripts:
  - type: ALIENBASE_USING_TLETHBASESEA
    commands:
    - type: addCraft
      terrain: TLETHBASESEA
      groups: 1
    - type: addBlock
      size: [1,1,4]
      verticalLevels:
      - type: ground
        size: [1,1,0]
        terrain: TLETHBASESEA
        groups: 1
      - type: middle
        size: [1,1,4]
        terrain: ALIENBASE01
    - type: addBlock
      size: [1,1,4]
      verticalLevels:
      - type: ground
        size: [1,1,0]
        terrain: TLETHBASESEA
        groups: 1
      - type: middle
        size: [1,1,4]
        terrain: ALIENBASE02
        executionChances: 50
    - type: addBlock
      size: [1,1,4]
      verticalLevels:
      - type: ground
        size: [1,1,0]
        terrain: ALIENBASE034
        groups: 1
      - type: middle
        size: [1,1,4]
        terrain: TLETHBASESEA
        executionChances: 50
    - type: addBlock
      size: 2
      execution: 2
      terrain: TLETHBASESEA
    - type: fillArea
      terrain: TLETHBASESEA
because terrain TLETHBASESEA doesn't have any actual maps attach to it, the Alienbase mapscript will crash. Can you figure of any way around it?
« Last Edit: March 02, 2020, 07:39:45 pm by Precentor Apollyon »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Mapscript using blank Terrain crash issue.
« Reply #1 on: March 02, 2020, 07:39:56 pm »
First of all, you can put the script directly in the alienDeployment, you don't have to make a terrain with no maps (I would suggest not doing that):

Code: [Select]
alienDeployments:
  - type: TLETH_BASE
    script: ALIEMBASEMAPFINAL

If you have very specific terrain combinations you want, I'd recommend making different scripts, especially for important things like alien bases.