aliens

Author Topic: [Solved] How to change the map size from Aliendeployment using MapScript  (Read 4751 times)

wcho035

  • Guest
Proposition- The generation of Battlescape map size, can be allow to be done in a global variable sort of way for Mapscript instead of Aliendeployment alone. When I mean global Variable sort of way, I mean Mapscript have priority, in deciding the size of the Battlescape map, before Aliendeployment.

Justification-When a UFO crash in a texture, it is their Alien deployment that decide the size of the battlescape map. A small scout can forever crash in a small or certain size map decide upon by its aliendeployment.

If Mapscript can decide upon the Length and width of a battlescape mission map, we can allow random map size for a ufo missionsite or crashsite.

For example, if we have 3 mapscript

One for a Desert Town with
    width: 50
    length: 50 

One for a Desert City with
    width: 120
    length: 120 

One for a Desert volcano with 
    width: 40
    length: 50 

Say in the same texture id say 5.

If the ufo crashes in texture id 5, it could use either the town, city or volcano mapscript with varying and unpredictable mapsizes.

The true purpose of my request, is to allow random cities or towns assigned to the texture ID, this allow for town and cities crash sites with varying battlescape map size, instead of solely depending on the Aliendeployment from the ufo.

I am hoping some Terrain Modders who love making terrains and maps to pick up on this idea. Perhaps someone can code it.
« Last Edit: February 14, 2023, 11:38:48 am by Meridian »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Use the mapScript command "resize".

Code: [Select]
mapScripts:
  - type: DESERTCITY
    commands:
      - type: resize
        size: [12, 12, 4] # sets size to 120×120×4

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Wow. The things a mapScript can do... Colour me impressed.

wcho035

  • Guest
Wow nice. So if I am to assume.  size: [12, 12, 4]  translate as [L, W, H] ?  This will override the Length and width in Aliendeployment? Confirm?

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Yes, but it's [x, y, z] or [width, length, height].

And yes it overrides the deployment to setting it to the specified size, but it has to be done before any blocks are added by the script.

wcho035

  • Guest
Thanks again, Ohartenstien23, if you can also help with my other question about blank terrain. I am most grateful. Thank you.

wcho035

  • Guest
Regreatfully Ohartenstien23, your solution didn't meet the objective of this request. The size only works for per block, not the whole battlescape map. Anyway, I would keep this request open.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
Regreatfully Ohartenstien23, your solution didn't meet the objective of this request. The size only works for per block, not the whole battlescape map. Anyway, I would keep this request open.

That is false.

The resize mapscript command can only resize the entire map, it cannot resize blocks.

wcho035

  • Guest
Okay, again, I am not good with certain words.

Map = Physical map + Routes.   <--- This is what I mean by block, like

    - type: addBlock
      size: [2,2,5]
      execution: 2
      terrain: globeTerrain

so the definition of Block in this case here is = whole battlescape mission maps?

So block and addblock, perhaps two different terminology? So I am confused here.
« Last Edit: March 04, 2020, 03:58:57 pm by Precentor Apollyon »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
"addBlock" command works with blocks (=the small building blocks that together make a map)

"resize" command works with the whole map, not with blocks

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
It is unfortunate that mapblock files have the extension .map. It adds to confusion, because a map is generally understood to be the entire battlescape area, not just one block.

I would personally prefer to avoid using the word "map" in non-casual conversations (like documentation), but the nomenclature is not really there yet. The smaller parts can be called blocks or mapblocks without any problem, but what about the whole thing? A battlescape? I don't know.

wcho035

  • Guest
So not the whole battlescape map, when I mean map like the WHOLE mission map, including UFO, Craft buildings and other maps.. geezz got to work on my definitions here.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9101
    • View Profile
So not the whole battlescape map, when I mean map like the WHOLE mission map, including UFO, Craft buildings and other maps.. geezz got to work on my definitions here.

yes, the "resize" command affects the whole battlescape map = the whole mission map including UFO, Craft and everything else.

wcho035

  • Guest
I finally understood now. Thank you. Got confused with size and resize.

wcho035

  • Guest
So for example the code should look like

  - type: DESERTTOWNSCRIPT
    commands:
    - type: resize
      size: [20, 20, 9]
    - type: addUFO
      groups: 1   
    - type: addCraft
      groups: 1
    - type: addBlock
      size: [1,1,4]
      verticalLevels:
      - type: ground
        size: [1,1,0]
        groups: 1   
      - type: middle
        size: [1,1,4]
        executionChances: 5
        terrain: PORT6
    - type: addBlock
      size: 2
      execution: 2
    - type: fillArea