Author Topic: Reusing the same map block in terrain definition?  (Read 2873 times)

Offline robin

  • Commander
  • *****
  • Posts: 1225
  • ULTIMATE ROOKIE
    • View Profile
Reusing the same map block in terrain definition?
« on: October 27, 2018, 11:06:05 pm »
Code: [Select]
    mapBlocks:
      - name: MYBLOCK_00
        width: 10
        length: 10
      - name: MYBLOCK_00
        width: 10
        length: 10
        items:
          STR_SOME_ITEM:
            - [0, 0, 0]
      - name: MYBLOCK_00
        width: 10
        length: 10
        items:
          STR_SOME_OTHER_ITEM:
            - [0, 0, 0]

Does this work?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9106
    • View Profile
Re: Reusing the same map block in terrain definition?
« Reply #1 on: October 28, 2018, 12:47:25 am »
The only place where mapBlocks are referenced by name is when generating an xcom base defense map... only the first one would be considered there.

Everywhere else, they are referenced by an index or chosen randomly, so it should work.

I didn't test it... so better make some tests too, don't just believe me blindly :)

EDIT: if it is only about randomized items, you can also use this feature: https://openxcom.org/forum/index.php/topic,2915.msg69165.html#msg69165
« Last Edit: October 28, 2018, 12:51:43 am by Meridian »

Offline robin

  • Commander
  • *****
  • Posts: 1225
  • ULTIMATE ROOKIE
    • View Profile
Re: Reusing the same map block in terrain definition?
« Reply #2 on: October 28, 2018, 10:09:32 am »
The only place where mapBlocks are referenced by name is when generating an xcom base defense map... only the first one would be considered there.

Everywhere else, they are referenced by an index or chosen randomly, so it should work.

I didn't test it... so better make some tests too, don't just believe me blindly :)

EDIT: if it is only about randomized items, you can also use this feature: https://openxcom.org/forum/index.php/topic,2915.msg69165.html#msg69165
I'll test it.
I don't think I can use the randomized items feature because the items have to be primed to spawn units.