Author Topic: [Suggestion] Default Terrain in map script  (Read 1817 times)

Offline mutantlord

  • Colonel
  • ****
  • Posts: 136
    • View Profile
[Suggestion] Default Terrain in map script
« on: August 04, 2022, 09:39:41 am »
Hello, I wish to suggest a feature that could benefit all modders.

In playing mods like XCF and XPiratez, sometimes the mission can spawn on a texture having no terrain, thus the mars terrain is always the one used to replace of all the missing maps in the mission. Thus this can ruins the show or mission.

I propose of having a defaultTerrain feature in mapscript. If the mapscript encounters a texture having no terrain, the defaultTerrain would be used instead.

Sample code

  - type: DESERTSAMPLE
    commands:
    - type: addUFO
      defaultTerrain: URBAN #If texture has no terrain then URBAN is used instead.
    - type: addCraft
      defaultTerrain: URBAN #If texture has no terrain then URBAN is used instead.
    - type: addBlock
      size: 2
      executions: 3
      defaultTerrain: URBAN #If texture has no terrain then URBAN is used instead.
    - type: fillArea
      defaultTerrain: URBAN #If texture has no terrain then URBAN is used instead.
« Last Edit: February 19, 2023, 09:07:28 am by Meridian »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [Suggestion] Default Terrain
« Reply #1 on: August 04, 2022, 12:05:03 pm »
Is this really solution? Modders need update all mapscripts to have it. Probably simpler would be fixing spawn of mission to be correct than fixing all scripts.

I think better would be some global config that is used for cases for lack of texture as it will need lest work from modder and more correct.
As far I understand lack of texture happens when mission is spawned on ocean, this mean outside of any polygon making land.
Because of this we could embrace it and add global `oceanTexture:` that will be used for this case, current value will be "mars" but modder could add different one.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: [Suggestion] Default Terrain
« Reply #2 on: August 04, 2022, 12:14:32 pm »
Just a small correction:

Mars is not a default terrain in OXC(E).
Mars has been manually configured by XCF, for each relevant deployment, as a default terrain in case no globe terrain is found.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Suggestion] Default Terrain
« Reply #3 on: August 04, 2022, 05:45:22 pm »
Just to avoid any misunderstandings: actually it's the Moon terrain in XCF, not Mars. (Looks the same but is recoloured.)

And yes, I made it so specifically to spot any bugs straight away.

Offline mutantlord

  • Colonel
  • ****
  • Posts: 136
    • View Profile
Re: [Suggestion] Default Terrain
« Reply #4 on: August 04, 2022, 08:55:08 pm »
I raise this request is for the sole reason of custom default terrain tailored to the mapscript attached to specific mission/Alien deployment. Not global default terrain that replace ocean texture. If that is the case, then -1 in the global texture can be listed with the default terrain of desired choice.