Author Topic: How customizable is the digTunnel mapscript command?  (Read 3384 times)

Offline Amoebka

  • Colonel
  • ****
  • Posts: 120
    • View Profile
How customizable is the digTunnel mapscript command?
« on: June 11, 2018, 04:01:14 pm »
Hello, everyone.

Long story short, I want to make my own alien base maps and so I need to understand the digTunnel command better. To summarize it in a few questions:

1) Can the positions of the removed tiles be customized? I know I can specify which Z-levels have tunnels, and which tiles are used to make tunnel walls/floor, but can I dig tunels in ways other than the standart 3 by 1 right in the middle of each map chuck's side?

2) What would happen of I try to dig tunnels on a map composed of non-standart map chunks (i.e. not 10 by 10 or 20 by 20)?

3) Can map chunks in general have sides that are not dividable by 10 (of course assuming that all map chunks in a single terrain have the same common divisor that I specify somewhere in rulesets)?

I know I can always just make tunnels a part of the map chunks themselves, but that would lead to tunnels cutting off into nowhere at the edges. Assuming I make special map chunks to use as borders, what do I need to write in my mapscript commands to place them around the map's perimiter? So for example the map itself is 80 by 80, where the outermost chunks are solid rock and the inner 60 by 60 are filled randomly as usual.

Thanks in advance.  :D

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9106
    • View Profile
Re: How customizable is the digTunnel mapscript command?
« Reply #1 on: June 11, 2018, 05:28:00 pm »
1/ I don't know... but probably not

2/ game would crash

3/ no

4/ there is a possibility to fine-control what is on the edges and what is inside... but it's a lot of boring repetitive work... you most likely don't want to do it that way... but if you do, you can use the "rects" in the mapscript to define, for each block, the allowed positions
« Last Edit: June 11, 2018, 05:30:33 pm by Meridian »

Offline Amoebka

  • Colonel
  • ****
  • Posts: 120
    • View Profile
Re: How customizable is the digTunnel mapscript command?
« Reply #2 on: June 11, 2018, 06:17:35 pm »
Thanks, Meridian.

I guess the rects approach is what I will be using. Could you walk me through the process a bit, though? Here's the standart TFTD port terror script for reference:

Code: [Select]
  - type: PORT_TERROR
    commands:
    - type: addBlock
      rects:
        - [0,0,4,2]
      blocks: 20
    - type: addBlock
      rects:
        - [4,0,1,5]
      executions: 5
      blocks: [2, 3, 4, 5, 6, 7, 8, 9]
      maxUses: [1, 1, 1, 1, 1, 1, 1, 1]
    - type: addCraft
    - type: addBlock
      size: 2
      executions: 2
    - type: fillArea

As far as I understand, the commands are performed in the specified order, top to bottom. That way everything except the first one makes sense. PORT_20 is a 20 by 20 map (THAT ONE building), yet the command lists its rect as "4 by 2". Is it just a mistake that's not critical so it gets ignored? Does it serve some actual purpose? Do the addBlock and fillArea commands only use blocks from group 0 unless specified otherwise (so, for example, the second last commands here would ignore any size 2 maps from non-zero groups)?
If everything here is correct it doesn't actually look THAT boring or repetitive, am I missing something?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9106
    • View Profile
Re: How customizable is the digTunnel mapscript command?
« Reply #3 on: June 11, 2018, 06:32:44 pm »
[0, 0, 4, 2] means it can be anywhere in a rectangle with top-left corner [0,0] and width=4 and height = 2

So for example on a 60x60 map, it could be anywhere in the green area as illustrated on the attached screenshot.
« Last Edit: June 11, 2018, 06:34:52 pm by Meridian »

Offline Amoebka

  • Colonel
  • ****
  • Posts: 120
    • View Profile
Re: How customizable is the digTunnel mapscript command?
« Reply #4 on: June 11, 2018, 06:38:45 pm »
Oh, ok. Seems like a completely random design choice, but at least the syntax is clear.
Thanks for the help again, I think I get it now.  8)