Author Topic: Mapscript Questions  (Read 16685 times)

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: Mapscript Questions
« Reply #30 on: February 06, 2015, 04:43:47 pm »
The issue here is also designing the scripts to allow them to be used in different map sizes (which eliminates the need for cloned terrains) but the rules aren't too friendly on that matter. Placement of specific map blocks on the top right/left usually works without a problem on any battlescape size, but there will be issues if you need to place specific mapblocks on the bottom left/right.
This is my "issue". I'm not setting map size in the script/terrain, but I'm placing down blocks which, if the maps size changes, are not where they're supposed to be anymore :P. It's not a big deal cloning the terrain, I was just wondering if there was a more elegant solution.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Mapscript Questions
« Reply #31 on: February 06, 2015, 05:34:57 pm »
This is my "issue". I'm not setting map size in the script/terrain, but I'm placing down blocks which, if the maps size changes, are not where they're supposed to be anymore :P. It's not a big deal cloning the terrain, I was just wondering if there was a more elegant solution.

Yeah, I've run into this issue as well while adding the original Port terrain - map size needs to be 50x50, otherwise the waterfront won't be correctly placed. It may be possible to overcome this using conditionals though:
    - type: addBlock
      rects:
        - [5, 0, 1, 6]
      executions: 6
      label: 1
    - type: addBlock
      rects:
        - [4, 0, 1, 5]
      executions: 5
      conditionals: -1
     
The 1st command tries to place the waterfront on a 60x60 map. If it fails then it the 2nd command is run, to place the waterfront in a 50x50 map. Haven't tried this but theoretically it should work.

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: Mapscript Questions
« Reply #32 on: February 06, 2015, 06:01:11 pm »
Yeah I guess the solution is an complex script with lost of conditionals.
For now I'm duplicating the terrain :-[