OpenXcom Forum

Modding => Help => Topic started by: robin on October 27, 2018, 11:06:05 pm

Title: Reusing the same map block in terrain definition?
Post by: robin 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?
Title: Re: Reusing the same map block in terrain definition?
Post by: Meridian 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
Title: Re: Reusing the same map block in terrain definition?
Post by: robin 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.