Author Topic: Mapscript Block Mutiplying.  (Read 2077 times)

wcho035

  • Guest
Mapscript Block Mutiplying.
« on: March 04, 2020, 05:38:08 pm »
Hi, just like resize, is there something in the mapscript that allow the multiplication of mapscript blocks? Not listed in the usual Openxcom rule page.

If I want Blocks like these

    - type: addBlock
      size: [2,2,4]
      verticalLevels:
      - type: ground
        size: [2,2,0]
        groups: 2
        terrain: DESERTTOWN
      - type: middle
        size: [2,2,4]
        executionChances: 5
        terrain: URBANSECONDARY1

To appear X number of times in a mission map?

Because there are no physical block or maps, I can't freq or block to decide how many times a map should appear in a mission map.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Mapscript Block Mutiplying.
« Reply #1 on: March 04, 2020, 06:01:15 pm »
Code: [Select]
    - type: addBlock
      size: [2,2,4]
      executions: 2 #<------ Run this addBlock twice
      verticalLevels:
      - type: ground
        size: [2,2,0]
        groups: 2
        terrain: DESERTTOWN
      - type: middle
        size: [2,2,4]
        executionChances: 5
        terrain: URBANSECONDARY1

If you meant decide between two slightly different versions of this addBlock, use executionChances, labels, and conditionals.
« Last Edit: March 04, 2020, 06:03:14 pm by ohartenstein23 »

wcho035

  • Guest
Re: Mapscript Block Mutiplying.
« Reply #2 on: March 04, 2020, 06:21:35 pm »
Hi Ohartenstein23, not quite two different version of add block, exactly the same block, but can appear how many times you want in a mission map.
 
So execution : 10 means like ten times?

Excellent!  If I include execution chance 50, this will vary the appearance and induce a random probability of how many of a certain building will appear.

I am planning to include skyscrapers in a mission map, does anyone knows the maximum height a mission map can support?

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Mapscript Block Mutiplying.
« Reply #3 on: March 04, 2020, 07:46:13 pm »
Technically, you can go as high as the integer limit for your operating system. Realistically, adding more z levels tends to cause slowdowns in the game - Piratez has a map with 30 height and the slowdown is significant. Personally I wouldn't go more than 10 or so, and I'd reduce the width and length of the map. X-Com Files has a nice office building you can look like to get some ideas how it works.