Author Topic: [Documentation] Getting High on Vertical Terrain  (Read 14564 times)

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #15 on: February 09, 2019, 10:24:01 am »
Is it possible to place the x-com craft in a middle level, like it's parked in an underground hangar?

I must say that I'd like more in-depth example of this. Is someone using this feature so I can steal check the ruleset?
 

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: [Documentation] Getting High on Vertical Terrain
« Reply #16 on: February 09, 2019, 11:38:28 am »

Place ablock object on grid 0,0 level 1 and the ship will be placed on the next level up( assuming its empty), i am using this on my current map i am building.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #17 on: February 09, 2019, 07:06:20 pm »
Yes, the underground hangar can work, it'd look something like this:
Code: [Select]
mapScripts:
  - name: STR_UNDERGROUND_HANGAR
    commands:
      - type: addCraft
        size: [1, 1, 8] # either 8 or the height of your deployment
        verticalLevels:
         - type: ground
           size: [1, 1, 0] # either 0 or the z-level where your craft is supposed to be
         - type: craft
           size: [1, 1, 4] # either 4 or the height of the craft's map
         - type: ceiling
           size: [1, 1, 4] # either 4 or the height of the blocks you want placed above the craft

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #18 on: February 10, 2019, 10:26:55 am »
Yes, the underground hangar can work, it'd look something like this:
Code: [Select]
mapScripts:
  - name: STR_UNDERGROUND_HANGAR
    commands:
      - type: addCraft
        size: [1, 1, 8] # either 8 or the height of your deployment
        verticalLevels:
         - type: ground
           size: [1, 1, 0] # either 0 or the z-level where your craft is supposed to be
         - type: craft
           size: [1, 1, 4] # either 4 or the height of the craft's map
         - type: ceiling
           size: [1, 1, 4] # either 4 or the height of the blocks you want placed above the craft
Won't define a size like that be suited only to crafts that can fit into a 10x10 map block?
The x, y values should adapt to the size of the craft involved in the mission... I think. Even in vanilla crafts have different sizes.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #19 on: February 10, 2019, 04:51:42 pm »
For addCraft/addUfo commands, the x, y sizes are ignored in favor of the size of the craft, and the rest is filled with 10x10 blocks.

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #20 on: February 10, 2019, 05:15:42 pm »
For addCraft/addUfo commands, the x, y sizes are ignored in favor of the size of the craft, and the rest is filled with 10x10 blocks.

How does addCraft work into TFTD ship/cruise terror terrains ?

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #21 on: February 10, 2019, 06:39:33 pm »
The LZ blocks are replaced with a larger map block before the craft is loaded. This is not guaranteed to work well with verticalLevels.

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #22 on: April 23, 2019, 09:31:57 pm »
    - type: addBlock
      size: [2, 2, 9]
      executions: 3
      verticalLevels:
      - type: ground
        size: [2, 2, 5]
        groups: 3
        blocks: [1, 2, 5, 6, 7, 8, 9, 10, 15]
        maxUses: [1, 1, 1, 1, 1, 1, 1, 1, 1]
      - type: ceiling
        size: [2, 2, 3]
        terrain: U_PLANET
        groups: 0


I'm adding 2x2 map blocks of the ground terrain. The problem is that the ceiling terrain consists of 1x1 map blocks only.. With the above command no ceiling map blocks are placed over the ground 2x2 map blocks. Is there a way to "fill the area" with 1x1 map blocks or do I strictly need 2x2 ceiling blocks to cover 2x2 ground blocks? (It is not a problem for me to make some new 2x2 map blocks! I just want to know before starting doing it).
Thanks.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #23 on: April 23, 2019, 09:37:25 pm »
You can't mix 2x2 size blocks with 1x1 blocks in the same command.

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #24 on: April 23, 2019, 09:38:41 pm »
Alright thanks!

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #25 on: April 25, 2019, 09:58:28 pm »
I have a problem with the with the digTunnel command: the tunnels are not dug for the map blocks under the X-Com craft (see screenshot, places marked with red crosses shoudl be open; you can see it works for the other map blocks -green circles).

Full script:

Code: [Select]
  - type: U_DIMENSION  # U_BUILDING + U_PLANET using verticalLevels
    commands:
    - type: addCraft
      size: [1, 1, 9]
      verticalLevels:
       - type: ground
         size: [1, 1, 5] # either 0 or the z-level where your craft is supposed to be
         groups: 0
       - type: decoration
         size: [1, 1, 0] # either 0 or the z-level where your craft is supposed to be
         terrain: U_PLANET
         groups: 1
       - type: craft
         size: [1, 1, 4] # either 4 or the height of the craft's map
   
    - type: addBlock
      #groups: 2
      #executions: 1
      size: [1, 1, 9]
      verticalLevels:
      - type: ground
        size: [1, 1, 5]
        groups: 2
      - type: ceiling
        size: [1, 1, 4]
        terrain: U_PLANET
        groups: 2
     
    - type: addBlock
      size: [2, 2, 9]
      verticalLevels:
      - type: ground
        size: [2, 2, 5]
        groups: 3
      - type: ceiling
        size: [2, 2, 4]
        terrain: U_PLANET
        groups: 3
       
    - type: addBlock
      size: [2, 2, 9]
      executions: 3
      verticalLevels:
      - type: ground
        size: [2, 2, 5]
        groups: 3
        blocks: [1, 2, 5, 6, 7, 8, 9, 10, 15]
        maxUses: [1, 1, 1, 1, 1, 1, 1, 1, 1]
      - type: ceiling
        size: [2, 2, 4]
        terrain: U_PLANET
        groups: 3
        maxUses: 1
       
    - type: fillArea
      size: [1, 1, 9]
      verticalLevels:
      - type: ground
        size: [1, 1, 5]
        groups: [0, 1]
        freqs: [3, 1]
      - type: ceiling
        size: [1, 1, 4]
        terrain: U_PLANET
        groups: 0
     
    - type: digTunnel
      direction: both
      tunnelData:
        level: 1
        MCDReplacements:
          - type: corner
            set: 11
            entry: 2
          - type: westWall
            set: 11
            entry: 1
          - type: northWall
            set: 11
            entry: 0
          - type: floor
            set: 11
            entry: 50
           
    - type: digTunnel
      direction: both
      tunnelData:
        level: 3
        MCDReplacements:
          - type: corner
            set: 11
            entry: 2
          - type: westWall
            set: 11
            entry: 1
          - type: northWall
            set: 11
            entry: 0
          - type: floor
            set: 11
            entry: 50


« Last Edit: April 25, 2019, 10:05:15 pm by robin »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #26 on: April 26, 2019, 01:18:43 am »
This is a limitation to the way I implemented the code. Any map loaded by verticalLevels is read into the game after the script finishes, so after the tunnel digging is done. I'm in the middle of a refactor of the code to fix that and allow it to work with digTunnel. For now, I'd avoid using verticalLevels with digTunnel.

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #27 on: April 26, 2019, 02:01:28 am »
I remember that you introduced verticalLevels with base defence scenario...
It is similar to ufo base scenario ... therefore the issue is critical because it block your very interesting and innovative feature that required an advance maps maker to apply

In mine knowledge, Robin is the first modder that tries to use it




Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #28 on: April 26, 2019, 02:23:34 am »
Robin is not the first, Finnik and Solarius Scorch have been attempting a similar mapscript for a while that would make use of digTunnel the way Robin wants to. The example of the base defense map is a specific case where it was defined to work. That is, the level where you are digging has to be
  • The first level loaded
  • Not using the terrain tag
The addCraft command adds additional complications that base defense maps did not have to account for.

However, this should all be fixed soon with the refactor. It's just somewhat slow going because I'm double-checking and comprehensively testing everything to make sure an issue like this doesn't happen again.

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Getting High on Vertical Terrain
« Reply #29 on: April 26, 2019, 10:09:22 am »
ohartenstein23 take your time, don't worry!
Moreover it isn't a big issue; in the worst case I could tweak the map blocks and open up the corridors preemptively, making the digTunnel command unneeded.