aliens

Author Topic: Underground Trial - Map questions  (Read 9205 times)

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Underground Trial - Map questions
« on: November 07, 2018, 12:03:12 pm »
In the ruleset, is it possible to specify map block must be placed on the outside edge of the battle scape when generating?

For example, i always want map blocks 1-3 to generate on the north edge and maos 4-6 to generate on south, is this an option within the current vanilla oxc?
« Last Edit: November 11, 2018, 10:26:45 am by luke83 »

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 676
    • View Profile
Re: Map placement
« Reply #1 on: November 07, 2018, 12:51:00 pm »
sure on the map script rulleset
for exemple on this script i add 2 blocks, one of type 15 to a specific location and other of type 16 to other specific location
  - type: SOMEMAPSCRIPT
    commands:
    - type: addCraft
      rects:
        - [4, 2, 2, 2]
    - type: addBlock
      size: 1
      executions: 10
      blocks: [15]
      maxUses: [1]
    - type: addBlock
      executions: 10
      blocks: [16]
      maxUses: [1]
      rects:
        - [2, 0, 1, 4]   #[y,x,mapSize_width,mapSize_heigth]
        - [1, 0, 1, 4]   #[y,x,mapSize_width,mapSize_heigth]
    - type: addBlock
      size: 2
      executions: 3
      blocks: [5, 6, 7, 8, 9]
      maxUses: [1, 1, 1, 1, 1]
    - type: fillArea
      # URBAN set is lacking blocks 10-13, so the numbers don't correlate properly here,
      # because these are references to the block numbers within the sets, not the file names.
      blocks: [3, 4, 10, 11, 12, 13, 14]
      freqs: [1, 1, 2, 2, 2, 2, 2]
      maxUses: [2, 2, 2, 2, 2, 2, 2]

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Map placement
« Reply #2 on: November 07, 2018, 06:36:20 pm »
Here is a very useful diagram Otto Hartenstein made for me.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Map placement
« Reply #3 on: November 07, 2018, 08:05:49 pm »
Here is a very useful diagram Otto Hartenstein Hobbes made

FTFY ;)

Important to clarify: first two numbers indicate the position of the map, next two numbers the size of the square/rectangle
« Last Edit: November 07, 2018, 08:12:46 pm by Hobbes »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Map placement
« Reply #4 on: November 07, 2018, 08:12:30 pm »
Oh shit, I had no idea! Sorry Hobbes, I got it from Otto at some point...

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Map placement
« Reply #5 on: November 07, 2018, 08:16:45 pm »
For example, i always want map blocks 1-3 to generate on the north edge and maos 4-6 to generate on south, is this an option within the current vanilla oxc?

This is what you'll need for a 50x50 battlescape:

Code: [Select]
    - type: addBlock
      executions: 5
      blocks: [01, 02, 03]
      rects:
        - [0, 0, 5, 1]
    - type: addBlock
      executions: 5
      blocks: [04, 05, 06]
      rects:
        - [0, 4, 5, 1]

This adds the specified blocks to the NE and SW sides (just north/south doesn't help to describe a map edge on isometric perspective)

Oh shit, I had no idea! Sorry Hobbes, I got it from Otto at some point...

No worries ;)
« Last Edit: November 07, 2018, 08:21:06 pm by Hobbes »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Map placement
« Reply #6 on: November 07, 2018, 08:48:13 pm »
I made you a similar diagram at some point, but never sent this one to you.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Map placement
« Reply #7 on: November 08, 2018, 11:47:22 am »
I made you a similar diagram at some point, but never sent this one to you.

So I'm not crazy! It really is different from what I remember! :)

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: Map placement
« Reply #8 on: November 09, 2018, 01:13:04 pm »
So, working on a side idea and i just trying to have the minimum info required to get the new maps to import into the Instant Battle options so i can continue to play around with the concept over time. I tried to create a Mod set from scratch and  i am now just having issue getting the ruleset right. It just needs to work good enough so i can load it into the game to test,

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: Map placement
« Reply #9 on: November 09, 2018, 02:58:40 pm »
You need to add in the additional terrain data. For example, it needs a script. Like this:
Code: [Select]
terrains:
  - name: Underground
    script: POLAR
This would give it the same script as the polar tileset, which pretty much just puts tiles randomly as far as I can tell. Other scripts you can figure out what they do by checking them out. It just determines the tile placement rules. I think you can just pick any existing map script you like, as long as it doesn't have a need for tile pieces you haven't put in.

I got it to work before when I made my space tileset mod. It's just a demo which showcases the terrain by enabling you to have it appear in-game. So I put the zip up here in case you want to use it as a reference. I might be forgetting something else I did to make it work.

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: Map placement
« Reply #10 on: November 10, 2018, 12:26:19 am »
Getting closer but now it crashes the game as map fails to generate....Can someone take a look at what i am missing?

ALso i How do i specify the stage limits ( 50x 60x 5) etc? Do i need my own script?

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: Map placement
« Reply #11 on: November 10, 2018, 11:13:45 am »
1.) The mod as downloaded is double-wrapped, and thus the game doesn't recognize it as a mod. Easy to fix, but could trip up the more casual players.

2.) You have two copies of the ruleset in the mod, one in the Ruleset folder and one in the Terrains folder. The latter is probably ignored by the game. Each copy has some data which the other lacks.

It looks like you have the basic script used for assembling the map with four of the Underground terrain blocks (#0, #1, #3, #4). You'll need a situation which calls for this map, which in standard usage would involve editing the geoscape regions and tying some places to your new Underground terrain. Then any mission which occurs in these areas will use the Underground map. I'm pretty sure there's other ways to do it but I am extremely green on this area of modding--that's a disclaimer going forward for the rest of this message. The UFO or crash site type as well as the X-Com craft choice will each determine additional blocks which override some of the Underground blocks into I think Underground #0 so the crafts can be placed on top of it. This means your block #0 should always be flat empty ground. I have not checked your maps so I cannot comment on them.


If you wanted to make a mission generate terrain specific to the mission, and not specific to the region, you could design several micro-regions on the geoscape just like how the Alien Terror mission uses the various cities as its regions. I don't know if they have to be cities or if they can be invisible. For this operation I would check the coding for the Alien Terror mission, and also various random missions in the early game in mods such as The X-Com Files.

If you wanted to make a mission generate a specific UFO on standard terrain (I.e.: a pyramid ship landed on farm), you just need to set the UFO to call the pyramid ship map block as its map unit, and add the MCD(s) that are used in that map block. You can copy the ruleset data from another UFO and adjust it as needed.

If you want to make the Underground map have a specific size not based on the UFO in it, you might take a peek at TFTD map generation rules. Those maps are always 6x6 blocks. I don't know if it's exclusive to TFTD (probably not), if you can just copy the same scripts over, or what. I don't know why UFO Defense maps change size based on the alien vessel.

It can be good to seek out mods which have done similar things, and copy their code. I haven't seen a lot of mods which do advanced terrain adjustments, but I know several mods have random "terror site" missions, such as Area-51, The X-Com Files, X-Pirates, The World of Terrifying Silence, and more. Total Conversions are often a good place to check for big, sweeping changes to see how it's done. I haven't seen any of the gameplay in Tech-COMM, but I hear it is a real piece of work. And as always, if you can't find examples anywhere else, X-Piratez serves as an example for almost anything you can do. If you dig deep enough into X-Pirates ruleset, you can find almost anything.


I'm certain to be wrong about several things here, so hopefully Meridian or another will stop by and correct me.
« Last Edit: November 10, 2018, 11:20:30 am by The Reaver of Darkness »

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: Map placement
« Reply #12 on: November 10, 2018, 01:19:57 pm »
You'll need a situation which calls for this map, which in standard usage would involve editing the geoscape regions and tying some places to your new Underground terrain. Then any mission which occurs in these areas will use the Underground map. I

So these will either be A: Random replacement for Terror Site ( Snakeman Hive has been located  underground, enter and destroy all egg sacks and any aliens you find)  OR B: SNakeman Alien base.... It will come down to how BUILTUP i make the map, right now i could go either way. Right now i just want to test them in game via the instant battle option.

Update: removed double wrapping  - still crashing my OXC, any other tips?
« Last Edit: November 10, 2018, 01:34:36 pm by luke83 »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: Map placement
« Reply #13 on: November 11, 2018, 07:37:19 am »
It doesn't crash for me. I also tried running it on OXC, still doesn't crash.

Make sure your file system for the mod is correct. It should look like this:

C:\Users\<your computer's name>\My Documents\OpenXcom\mods\Underground\

Inside the Underground folder:
MAPS\
Mapview\
Resources\
ROUTES\
Ruleset\
TERRAIN\
metadata.yml
Underground readme.txt

Offline luke83

  • Commander
  • *****
  • Posts: 1558
    • View Profile
    • openxcommods
Re: Underground Trial - Map questions
« Reply #14 on: November 11, 2018, 10:32:08 am »
Tellng me it cant find the file which is in the user/Mod directory