Author Topic: [Suggestion] Separate AlienDeployment switching, for land/sea base/Mission sites  (Read 894 times)

Offline Precentor Apollyon

  • Colonel
  • ****
  • Posts: 435
    • View Profile
Request Priority-High to Mid.

Hi Meridian, I wish to thank you very much for the addition of globalterrain to the recent built of OXCE.

However, upon testing, there's a missing component in the fulfillment of this feature request.

Currently there's no provision for Alien Deployment switching, for land/sea terrains for Alien bases or mission sites. Like it is currently available, for ufo crash sites.

It is critical in this switch, that the land and sea Alien deployment have their own separate Mapscript. 
 
How this will work is, each Aliendeployment is defaulted to its land base equivalent, until the base is build on a sea texture. Then, it is switch to one with _underwater extension, just like ufo crash sites.

So this request is now updated.

Thank you again for allowing us of this wonderful feature, globalterrain, Meridian.



« Last Edit: November 09, 2019, 05:42:33 am by Precentor Apollyon »

Offline Precentor Apollyon

  • Colonel
  • ****
  • Posts: 435
    • View Profile
Greetings. This feature request has now been updated.

I was able to get all the features I wanted from the post before, by using fake UFOS in Alien deployment and passed them on as Base Structures.

Sample coding from ufo.rul

  - type: STR_LANDBASEUFO
    size: STR_VERY_LARGE
    sprite: 1
    damageMax: 0
    speedMax: 0
    accel: 0
    power: 0
    range: 0
    score: 0
    reload: 0
    breakOffTime: 0
    battlescapeTerrainData:
      name: LANDBASEUFO
      mapDataSets:
        - BLANKS
        - SEA
        - PORT01
        - PORT02
        - ORGANIC2
      mapBlocks:
        - name: LANDBASEUFO
          width: 20
          length: 20
 
This is a fake ufo, that's actually a building.

A few months ago, Meridian has kindly provided us with a feature allowing texture to be defined as Surface or undersea terrain with

  textures:
    - id: 4    # sahara
      fakeUnderwater: false
    - id: 10
      fakeUnderwater: true

The Aliendeployment code of the Fake UFO that's a building is.

  - type: STR_LANDBASEUFO
    data:
    {Hidden}
    width: 60
    length: 60
    height: 4
    genMission:
      STR_ALIEN_SUPPLY: 100
    genMissionFreq: 6
    alienBase: true    # this is only to tell new battle mode what to do with this deployment
    nextStage: STR_HUMAN_BASE_ASSAULT_UNDERGROUND
    markerName: STR_HUMAN_BASE
    markerIcon: 9
    briefing:
      title: STR_ALIEN_COLONY_ATTACK_MISSION
      desc: STR_ALIEN_COLONY_P1_BRIEFING
      palette: 4
      music: GMTACDRY
      background: BACK01.SCR
    points: 5      

For underwater.

  - type: STR_LANDBASEUFO_UNDERWATER
    depth: [1, 1]
    data:
      {Hidden}
    genMission:
      STR_ALIEN_SUPPLY: 100
    genMissionFreq: 6
    terrains:
      - PIPES
    script: THREEBIGMOD
    alienBase: true    # this is only to tell new battle mode what to do with this deployment
    nextStage: STR_HUMAN_BASE_ASSAULT_UNDERGROUND
    markerName: STR_HUMAN_BASE
    markerIcon: 9
    briefing:
      title: STR_ALIEN_COLONY_ATTACK_MISSION
      desc: STR_ALIEN_COLONY_P1_BRIEFING
      palette: 4
      music: GMTACWET
      background: BACK01.SCR
    points: 5   

By using this approach, the terrains from the upper surface level in my two-level enemy bases are randomly generated, just like those found in a downed UFO mission. The FakeUFO/ Base structure will serve as a "Castle" which  you have to capture, so you can send your units to the basement/ next level of the base attack mission.

However, this approach of mine has its own limitation.

In Geoscape,  these fake ufo/ Alien bases are showing up as UFOS, not as faction colored Alien Bases.

Please see screenshot.

Now, my request is..a flag of some sort,

Like FakeUFO: true.

This would identify the UFO aliendeployment as fake UFO. The expected result I seek is.

1) When the base or fake ufo is generated in geoscape, it will not show up in the Hyperwave decoder screen as a UFO.

2) Any Craft attacking/or raiding the Alien/Human base will not generate an interception screen, before it continues on to a normal briefing that's from an Alien base attack mission.

3) In the geoscape, instead of a red cross, the normal properties of an Alien base should be shown.

4) Instead of a fake ufo, I wanted it to be an alien base. Like it can generate supply and retaliation missions like an actual alien base should.

The potential of this feature does allow of other possibilities, like the generated random events and other battlescape missions from Alien Deployment.



« Last Edit: October 25, 2019, 02:57:31 pm by Precentor Apollyon »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1713
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Rather than making something hack-y work (calling a UFO a base), a simpler solution would be to extend map scripts for alien base assault maps to have access to the terrain from the globe texture. Map scripts already allow for defining specific terrains within commands and for using globe texture to get terrains for player base defense maps, it's not much of a stretch to imagine this being extended to marker-type missions (terror missions, alien bases).

Offline Precentor Apollyon

  • Colonel
  • ****
  • Posts: 435
    • View Profile
Hi ohartenstein23, thank you for the reply. I am not an expert when it come to Mapscripts. I tried to understand the scripting logic behind it, but with the current documentation available, it is a challenge to say the least.

I know the basic like adding craft and ufonames, the rest is beyond me. If you can teach me how to script, I am interested to learn.

I used the ufo as a base structure for another reason, if the alien base is build on sea terrain, it can use the _underwater extension in Aliendeployment, eg.

  - type: STR_ALIENBASE_UNDERWATER
    depth: [1, 1]

for underwater weapons and condition.

I am keen to know if your Mapscript solution can handle this too? 

The solution I am using here handle this perfectly.

If I can avoid asking for a feature request, trust me I will. I spend two hours with Warboy for a solution just now. Unfortunately, his solution doesn't allow the setup of a UFO in terrain or handle sea terrain.
« Last Edit: October 25, 2019, 04:42:44 pm by Precentor Apollyon »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1713
  • Flamethrowers fry cyberdisk circuits
    • View Profile
The most important improvement for you mapScripts would be the use of the "terrain" tag. This allows you to use terrains outside of the one defined on the deployment or globe texture. For example, if you wanted an alien base that has an above-ground entrance for the first stage in the Forest, you would have something like this in ruleset:

Code: [Select]
alienDeployments:
  - type: STR_ALIEN_BASE_ASSAULT_LEVEL1_FOREST
    # ... bunch of stuff
    terrains:
      - UBASE # we use the alien base as our "main" terrain
    mapScript: ALIENBASE_FOREST_ENTRANCE
    # ... bunch of other stuff

mapScripts:
  - type: ALIENBASE_FOREST_ENTRANCE
    commands:
    - type: addBlock # start by adding our entrance
      blocks: 21 # or whatever number the entrance block is, could use groups instead

    # overly simplified way of filling the map
    - type: addCraft
      terrain: FOREST # our skyranger lands in the forest
    - type: fillArea
      terrain: FOREST # and the area around is all forest

#*** Reframing your suggestion ***
The way I'd reframe your suggestion would be to add a special case for that "terrain" tag in the mapscript - something like "terrain: geoscapeTerrain," that would specifically look where you are on the globe and grab a terrain from that texture. So instead of having to make separate mapScripts, alienMissions, and alienDeployments for each terrain you wanted to use, you would just replace "terrain: FOREST" from above with "terrain: geoscapeTerrain". This would require new code, but I've been planning on making this change for a while, just haven't gotten around to it.

I'm also assuming you're separating land and sea bases by different deployments and alienMissions, so depth and everything else necessary for that would be handled by the specific alienDeployment.

#*** What you can do right now ***
As for what you can do without any new feature requests, I would like to first point out that landed UFOs cannot generate missions the way alien bases can - they won't get supply ships flying to them, they can't send out HK UFOs to shoot down your craft if they get too close. If you want to do some copy/paste work, you can do the following to get alien bases on different terrains:
  • Make copies of the alienMission to generate bases for each terrain, e.g. STR_ALIEN_BASE_FOREST, STR_ALIEN_BASE_DESERT, etc., each one with a different siteType deployment to match the terrain.
  • Add mission zones to regions.rul that only contain one type of terrain/texture to place the base on those spots.
  • Create mapScripts using the "terrain" tag as above for each deployment or base type
You can see an example of using terrains like this in X-Com Files - many of the early cultist missions in that mod have multiple variants just for different terrains, like a POLAR and FOREST variant. It is a lot of work, but I think it would better match what you want than using UFOs.

Offline Precentor Apollyon

  • Colonel
  • ****
  • Posts: 435
    • View Profile

This would require new code, but I've been planning on making this change for a while, just haven't gotten around to it.


Hi ohartenstein23, I wish to thank you again for your kind and long contribution to this problem of mine.

I had suggested possible paths as to how a feature is coded. However, it is up to Meridian I believe, who is coding this. To decide of the best strategy, to code of this in the most efficient way possible.

This feature I am requesting here, is to allow for a split level an alien or human base with upper surface and lower basement level. Its surface level has to be generated, by using the terrains listed in the texture id from Globe.rul

For example, from mine.

  textures:
    - id: 0
      fakeUnderwater: false     
      terrain:
        - name: FOREST
          area: [0, 360, -90, 0]
        - name: JUNGLE
          area: [0, 360, 0, 90]
    - id: 1
      fakeUnderwater: false      
      terrain:
        - name: CULTA
          weight: 70      
        - name: CORALFORREST
          weight: 30   

    - id: 10
      startingCondition: STR_UNDERWATERTESTREALLYDEEP
      fakeUnderwater: true
      terrain:
        - name: SEABED
          weight: 20
        - name: PIPES
          weight: 20       
        - name: PLANE
          weight: 20   
        - name: ATLAN
          weight: 5
        - name: MSUNK
          weight: 5   
        - name: VOLC
          weight: 30   

If the Alien base is spawn on id0, it can either use the forrest terrain or Jungle terrain. If it spawn on id 10, it uses underwater terrain listed there.

Land and sea terrain must be able to use their own alien deployment. This is done already for ufo crashsite.

Ohartenstein23, I understand of your strategy in the approach of this request. It still need new coding to get it in order to work properly. However, I wish to keep this feature request in its original general format. I will follow which ever path or strategy Meridian decides to kindly allow of this feature made available.

Until now, I have tested of all the available paths that I can thought of, to allow of this, to avoid a feature request.

1)  UFO trajectories to spawn bases, of land and sea to have their own separate trajectories.

I had initially thought ufos uses trajectories and they travel to the site at where the Alien bases were spawn. If I uses land trajectories, it will spawn land bases and sea trajectories will spawn sea bases. This does not work because the spawning of Alien bases and ufos are NOT mutually connected. They are completely separate things.  Anyway, it didn't work after testing of using TFTD and UFO trajectories having them class differently.

2)  Spawning Alienbases using warboy's method.

In alien mission, I have a modified code.

  - type: STR_BASESPAWN
    points: 50
    objective: 2
    siteType: STR_HUMAN_BASE (from Alien deployment)
    spawnZone: 4
    raceWeights:
      0:
        STR_HUMANFACTION: 100
    waves:
      - ufo: Dummy
        count: 1
        trajectory: P1
        timer: 0

Using this method, the alien base will spawn and use the terrains bound to the texture id that it is generated on. However, this kind spawning will only use the original maps that comes with the terrain. Unless the terrain has been modified with an alien base on it, or has tiles that transport to the next level, it will not work. This method does not work with Sea and land separate land or sea deployment. Or it will use the fakeufo/Structure I had hacked. Please see 4)

3)

#*** What you can do right now ***
As for what you can do without any new feature requests, I would like to first point out that landed UFOs cannot generate missions the way alien bases can - they won't get supply ships flying to them, they can't send out HK UFOs to shoot down your craft if they get too close. If you want to do some copy/paste work, you can do the following to get alien bases on different terrains:
  • Make copies of the alienMission to generate bases for each terrain, e.g. STR_ALIEN_BASE_FOREST, STR_ALIEN_BASE_DESERT, etc., each one with a different siteType deployment to match the terrain.
  • Add mission zones to regions.rul that only contain one type of terrain/texture to place the base on those spots.
  • Create mapScripts using the "terrain" tag as above for each deployment or base type
You can see an example of using terrains like this in X-Com Files - many of the early cultist missions in that mod have multiple variants just for different terrains, like a POLAR and FOREST variant. It is a lot of work, but I think it would better match what you want than using UFOs.

This is Solarius/X-Com Files for random events/ encounters and needing specific region/mission zones coordinates to work. I have studied this feature extensively.

Yes, it will meet most of all the feature I seek with this method. The game will generate all the Alienbases or human faction bases all over the world. Unfortunately, those generated bases will always be spawn in those speficied zone coordinates.
There is only a semi-randomness to the location at where they are spawn.

Also if the alien or human faction are to generate new bases using the normal Base creation routine. Like later in the month, alien are to create new bases using the normal method, I don't believe this method will work properly.

Lastly, I have plans to use of this method to generate my own random events. Depending on the new possibilities raised,  should my feature request of this is made available. I might uses of method 2 or warboy's method.

4) Using fakeufos/ Fake base structure.

I have been experimenting on a hack, using fake ufos as fake base structures map that having tiles which allows your soldiers to be transport to the next or basement level in an alien base attack mission.   

This hack has its benefit and problems. The benefit is, it meets all my expectation, it uses the normal ufo crash site handing of different alien deployment for land and sea terrain. It generates by using the terrains bound to the texture id and the mission in battlescape behaves like an actual alien base attack mission. 

However, the problem with this method at its current inception. Like ohartenstein23 had kindly input, "they won't get supply ships flying to them, they can't send out HK UFOs to shoot down your craft if they get too close."

The Fakeufo/Structure base will be shown as a ufo in geoscape. If you intercept it, a brief interception screen will be shown before the actual alien base attack mission starts.

Also I am able to verify, if you try to generate an alien base using this method. Like how the aliens will normally create their bases on the globe. It will appear as an alien base, instead of a ufo in geoscape. However, the alien base will follows alien base behavior, not the hack fakeufo behavior. (AKA, Will not use the terrain bounded to the texture Id, no Aliendeployment handling for sea and land etc)

So, if method 4 is considered, using flags like Fakeufo: true, then something like fakealienbases:true might be needed.

5) ohartenstein23 method. Using map script to meet the requirement needed with extra coding.

I only have a high level conception of how this might work. I can't comment unless actual testing is done on my mod.
« Last Edit: October 26, 2019, 11:22:57 am by Precentor Apollyon »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1713
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Huh, I didn't realize that using the "dummy" UFO method for spawning the alien base allows for using the geoscape texture to get the terrain. That makes this easier.

In the following simple mod, I create an alien base that has two stages:
  • An above ground entrance that uses the geoscape terrain except for one map block that is an entrance to the base. It's just a random block from the UBASE terrain, but I assume you're capable of using this example to make a better-looking mapblock for your entrance.
  • An underground portion that is just a copy of the original alien base assault.

You might have to make two separate missions, one for underwater and one for above water and split the missionZones so only underwater creates bases on your fakeUnderwater terrain and above water puts it on the regular ground, but this is much less work than Solarius' method of making site types for different terrains. No new code is required.

By the way, I wrote most of the OXCE code that adds new features to map generation, Meridian usually asks me to look at/handle changes in those related code files.

Here's the simple mod that I used for testing:
Code: [Select]
alienMissions:
  - type: STR_ALIEN_BASE
    waves:
      - ufo: Dummy
        count: 1
        trajectory: P1
        timer: 0
    siteType: STR_ALIEN_BASE_ENTRANCE

mapScripts:
  - type: ALIEN_BASE_ENTRANCE
    commands:
    - type: addCraft
    - type: addBlock
      terrain: UBASE #<---- this is probably the most important part, adding something from a specified terrain to make the "entrance" to the underground base
    - type: addBlock
      size: 2
      executions: 2
    - type: fillArea

missionScripts:
  - delete: gameStart

  - type: gameStart # just to make sure I had a base when the game started
    missionWeights:
      0:
        STR_ALIEN_BASE: 100
    lastMonth: 0
    targetBaseOdds: 100
    raceWeights:
      0:
        STR_SECTOID: 100
    startDelay: 0

alienDeployments:
  - type: STR_ALIEN_BASE_ENTRANCE
    width: 50
    length: 50
    height: 4
    script: ALIEN_BASE_ENTRANCE
    briefing:
      textOffset: -16
      background: BACK01.SCR
      showTarget: false
    objectiveType: 3
    markerName: STR_ALIEN_BASE
    markerIcon: 7
    genMission:
      STR_ALIEN_SUPPLY: 100
    genMissionFreq: 6
    alienBase: true
    points: 5
    nextStage: STR_ALIEN_BASE_ASSAULT
    #data:
    #*** I cut this out to make it easier to read, just a copy of the alien base assault data minus the leaders/commander ***

  - type: STR_ALIEN_BASE_ASSAULT
    genMission: {} # Not necessary since the first stage now handles it
    genMissionFreq: 0 # Not necessary since the first stage now handles it

Attached pictures show the two stages of this mod in action.

Offline Precentor Apollyon

  • Colonel
  • ****
  • Posts: 435
    • View Profile
Greetings ohartenstein23,

I wish to thank you once again, for your kind, detailed and diligence help in this issue.

I am very grateful for your effort and advice. Today I tested the code you have provided here. Regretfully, I have found some anomalies.

Firstly, I had made some serious error,in both my testing and assumption of Warboy's method from method 2 before.

I didn't test it thoroughly and I stopped, after discovering the main entrance sructure map to the lower or next level is missing from the main map. I naturally assumed this does not work, so no more testing was necessary.

Today, I did a more through test with Warboy's method. I found to a mishap or miscalculation. The terrain which this method used,is a default terrain. That means it always uses the farm terrain, no matter what texture id it is spawned on. If it is a sea texture, it will generate a farm terrain by default. The fault is mine and I do appologize deeply, if I had given you reason to believe it had worked.

Then while testing your code, I can't see of a entrance structure or building with the new code. I have special units in the battlescape that's heavily equipped with mind control to get the Enemy to scout the whole map. None of the expected map with the entrance structure spawned.

I will list my coding here. It is similar to those you uploaded from before in many respect.
   
Here is mine with the recommended modification.


mapScripts:
  - type: LAND_ASSAULT
    commands:
    - type: addCraft   
    - type: addBlock     
      terrain: ENEMYBASEBLOCKLAND  #<----  Formerly the terrain for landbaseufo with the base/entrance to the next level.
    - type: addBlock
      size: 2
      execution: 2     
    - type: fillArea
 
  - type: SEA_ASSAULT
    commands:
    - type: addCraft   
    - type: addBlock     
      terrain: ENEMYBASEBLOCKSEA   #<---- As per highlighed by you in your coding before. The sea equivalent.
    - type: addBlock
      size: 2
      execution: 2
    - type: fillArea
 

terrains:
  - name: ENEMYBASEBLOCKLAND
    mapDataSets:
      - BLANKS
      - SEA
      - PORT01
      - PORT02
      - ORGANIC2
    mapBlocks:
      - name: LANDBASEUFO_00
        width: 20
        length: 20

  - name: ENEMYBASEBLOCKSEA
    mapDataSets:
      - BLANKS
      - SAND
      - PIPES
      - UFOBITS
      - ORGANIC2
    mapBlocks:
      - name: SEABASEUFO_00
        width: 20
        length: 20

alienDeployments:
  - type: STR_HUMAN_BASE_ASSAULT
    data:
    <Ommited>
    width: 60
    length: 60
    height: 4
    genMission:
      STR_ALIEN_SUPPLY: 100
    genMissionFreq: 6
    script: LAND_ASSAULT          #<---- As per highlighed by you in your coding before. It is formerly the terrain for landbaseufo
    alienBase: true   
    nextStage: STR_HUMAN_BASE_ASSAULT_UNDERGROUND
    markerName: STR_BASELANDTESTX
    markerIcon: 9
    briefing:
      title: STR_ALIEN_COLONY_ATTACK_MISSION
      desc: STR_ALIEN_COLONY_P1_BRIEFING
      palette: 4
      music: GMTACDRY
      background: BACK01.SCR
    points: 5


  - type: STR_HUMAN_BASE_ASSAULT_UNDERWATER
    depth: [1, 1]
    data:
    <Ommited>
    width: 60
    length: 60
    height: 4
    genMission:
      STR_ALIEN_SUPPLY: 100
    genMissionFreq: 6
    script: SEA_ASSAULT              #<---- As per highlighed by you in your coding before. The sea equivalent.
    alienBase: true   
    nextStage: STR_HUMAN_BASE_ASSAULT_UNDERGROUND
    markerName: STR_BASESEATESTX
    markerIcon: 9
    briefing:
      title: STR_ALIEN_COLONY_ATTACK_MISSION
      desc: STR_ALIEN_COLONY_P1_BRIEFING
      palette: 4
      music: GMTACDRY
      background: BACK01.SCR
    points: 5

#Code below worked perfectly.

alienMissions:
  - type: STR_BASESPAWN
    points: 50
    objective: 2
    siteType: STR_HUMAN_BASE_ASSAULT
    spawnZone: 4
    raceWeights:
      0:
        STR_ENEMY_FACTION: 100
    waves:
      - ufo: Dummy
        count: 1
        trajectory: P1
        timer: 0


missionScripts:
  - type: MassFactionBaseSPAWN3a
    firstMonth: 0
    lastMonth: 0
    executionOdds: 100     
    maxRuns: 1
    avoidRepeats: 1
    varName: A8
    missionWeights:
      0:
        STR_BASESPAWN: 100

If you can recommend the necessary changes, I am most attentive to read and update. However, with Warboy's method not exactly working, unless you have an alternative way. I have to keep this feature request open.

I am extremely sorry for this and for any false hope raised. Again, thank you for your time and help ohartenstein23.
« Last Edit: October 27, 2019, 08:47:14 am by Precentor Apollyon »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5495
  • Aaand we're back!
    • View Profile
    • My Wiki
Today, I did a more through test with Warboy's method. I found to a mishap or miscalculation. The terrain which this method used,is a default terrain. That means it always uses the farm terrain, no matter what texture id it is spawned on. If it is a sea texture, it will generate a farm terrain by default. The fault is mine and I do appologize deeply, if I had given you reason to believe it had worked.

There's a bug, will be fixed.

Offline Precentor Apollyon

  • Colonel
  • ****
  • Posts: 435
    • View Profile
Thanks Meridian. It is good to hear from you again.

To clarify of your reply. This bug, you referring to

1) Warboy's method?

2) Or ohartenstein23 terrain base entrance replacement?

Thank you.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5495
  • Aaand we're back!
    • View Profile
    • My Wiki
I refer to this statement.

The terrain which this method used,is a default terrain. That means it always uses the farm terrain, no matter what texture id it is spawned on. If it is a sea texture, it will generate a farm terrain by default.

Offline Precentor Apollyon

  • Colonel
  • ****
  • Posts: 435
    • View Profile
thank you for the reply.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1713
  • Flamethrowers fry cyberdisk circuits
    • View Profile
You're using 20x20 mapBlocks for the entrances. The addBlock mapScript command needs to match that size - the default if you don't give it a size is size: 1, or a 10x10 block. Try

Code: [Select]
    - type: addBlock
      terrain: ENEMYBASEBLOCKLAND
      size: 2

By the way, you should put large chunks of ruleset in inside code tags on the forum to separate them from regular text.

Offline Precentor Apollyon

  • Colonel
  • ****
  • Posts: 435
    • View Profile
Hi ohartenstein23, thanks for the quick reply.

At last! It finally worked!  Thank you sir! At least your side of the coding worked! Once the bug from the other side is fixed. I can say, wow.. it has been a journey for me.

I must say, I am truly enlighten by power of this mapscripts.

So size 1 and 2 is for 10x10 and 20x20.

I wonder ohartenstein23 can you draw more than one terrain with this? Beside just one map block?

I can thought of possibilities like a random event with two ufos having a meeting or well.. the mind can wander on this.

Writing of random events, this feature, once its working.. its application don't stop here. You know the random events for Solarius XComfiles.. this is a more efficient method for generating random events.

If I can suggest a feature outside of this suggestion/feature request ohartenstein23.  Say for example.

-typeaddRandommapBlock:
      -
        - 60
        - terrain: ENEMYBASEBLOCKLAND
          size: 2
(There's a 60% chance this mapblock will spawn)
      -
        - 20
        - terrain: ENEMYBLOCKLANDDIFFERNT2
          size: 2
(There's a 20% chance this mapblock will spawn)
      -
        - 30
        - terrain: Blocknewthree
          size: 1 
(There's a 20% chance this mapblock will spawn)

This will give the power of random mapblock.. so the base has a random different central core building that goes underground.
There are many application to this, like random events.. different core base variation spawn. Add unpredictability.

And this feature can one day be apply to XCom crash sites too. You have a map with a damage craft and you spawn it like an alienbase when it crash. The alien will keep attacking this "alien base" until all your soldiers are dead. Extra coding might be the terrain need to detect the addufo that's attacking the base. And then another craft has landed the base and rescue the surviving soldiers, the alien base disappeared. Of course, this is not on the table anymore, I still wish to speculate how it can be done.

Or, you can have a upper terrain for a two level XCom defense mission. With Top level surface terrain using the same application like this. Please check this link.

https://openxcom.org/forum/index.php/topic,7513.0.html

Well, I better stop here, before the developers stop me from going overboard...

Thanks again ohartenstein23
« Last Edit: October 27, 2019, 04:17:25 pm by Precentor Apollyon »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1713
  • Flamethrowers fry cyberdisk circuits
    • View Profile
You don't need new features for randomized map blocks. The map script commands already pick a randomized block that fits the constraints from the command. Something like

Code: [Select]
    - type: addBlock
      terrain: UBASE
      size: 2

will choose a random map block that fits the constraints of
  • Being in the UBASE terrain
  • Having size = 20x20
  • Having 0 in the groups tag (default)

If you want to pull from multiple different terrains, you can use the executionChances, label, and conditionals tags in the commands:

Code: [Select]
    - type: addBlock
      executionChances: 60 # this command is run 60% of the time
      terrain: ENEMYBASEBLOCKLAND
      size: 2
      label: 1

    - type: addBlock
      conditionals: [-1] # the command labeled 1 must not have run in order for this one to run
      executionChances: 50 # this command is run 50% of the time command #1 is NOT run, i.e. 40%*50% = 20%
      terrain: ENEMYBASEBLOCKLANDDIFFERENT2
      size: 2
      label: 2

    - type: addBlock
      conditionals: [-1, -2] # both commands 1 and 2 must not have run to use this one
      executionChances: 100 # this command is always run when neither 1 or 2 runs, i.e. 20% of the time
      terrain: BLOCKNEWTHREE
      size: 2