OpenXcom Forum

Modding => Help => Topic started by: luke83 on November 07, 2018, 12:03:12 pm

Title: Underground Trial - Map questions
Post by: luke83 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?
Title: Re: Map placement
Post by: bulletdesigner 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]
Title: Re: Map placement
Post by: Solarius Scorch on November 07, 2018, 06:36:20 pm
Here is a very useful diagram Otto Hartenstein made for me.
Title: Re: Map placement
Post by: Hobbes 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
Title: Re: Map placement
Post by: Solarius Scorch on November 07, 2018, 08:12:30 pm
Oh shit, I had no idea! Sorry Hobbes, I got it from Otto at some point...
Title: Re: Map placement
Post by: Hobbes 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 ;)
Title: Re: Map placement
Post by: ohartenstein23 on November 07, 2018, 08:48:13 pm
I made you a similar diagram at some point, but never sent this one to you.
Title: Re: Map placement
Post by: Solarius Scorch 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! :)
Title: Re: Map placement
Post by: luke83 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,
Title: Re: Map placement
Post by: The Reaver of Darkness 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.
Title: Re: Map placement
Post by: luke83 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?
Title: Re: Map placement
Post by: The Reaver of Darkness 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.
Title: Re: Map placement
Post by: luke83 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?
Title: Re: Map placement
Post by: The Reaver of Darkness 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
Title: Re: Underground Trial - Map questions
Post by: luke83 on November 11, 2018, 10:32:08 am
Tellng me it cant find the file which is in the user/Mod directory
Title: Re: Underground Trial - Map questions
Post by: The Reaver of Darkness on November 11, 2018, 01:54:30 pm
Change the filename of UNDERG.mcd to UNDERG.MCD and see if that works. If not, gimme the next error log.
Title: Re: Underground Trial - Map questions
Post by: luke83 on November 12, 2018, 10:52:52 am
It still cant find the file in the Mod folder even after i renamed it, having similar issue with the Pyramid mod also, it wants to load the MCDs from the original games UFo/terrain folder, not the MOD terrain folder.


Going to download the newest nightly and see if that makes any difference.

Update - Same result.

Update2 - I coped all the Terrain data out of the MOD folders and into the original game directories and now it crashes because the map fails to build... I also used the Oldest Nightly i could find, still no luck.
Title: Re: Underground Trial - Map questions
Post by: Hobbes on November 12, 2018, 03:54:11 pm
List of things to fix:

* To fix the UNDERG.mcd error, you need to reorganize the folders... you have \mods\Underground\Underground\TERRAIN, when it should be \mods\Underground\TERRAIN (remove the extra UNDERGROUND folder and the repeated metadata.yml)
* UNDERG02 .RMP needs to be renamed (contains an extra space)
* You only have 5 maps available, and according to the FARM script each can only be used 3 times, so 3x5 = 15 map blocks, which aren't enough to fill a 50x50 battlescape
* FARM script places a UFO, but there aren't any UFOs defined, so the game can't place any alien units; also, there's no data field defined on alienDeployments, so it's impossible to place any alien units
* The maps are a mess, it's impossible for the terrain to work like this. I made several changes and got the below pic

Finally, do not use old nightlies unless you want to banned to the seven hells ;)
Title: Re: Underground Trial - Map questions
Post by: luke83 on November 12, 2018, 06:40:30 pm
cool thanks for the tips, one follow up  question how do you get the entire map visible, will make bug-testing so much easier.
Title: Re: Underground Trial - Map questions
Post by: Hobbes on November 12, 2018, 06:46:55 pm
cool thanks for the tips, one follow up  question how do you get the entire map visible, will make bug-testing so much easier.

I had to edit the vanilla PLANE.RMP for aliens to spawn next to the forward landing wheel, otherwise it would be impossible to generate the map since there are no spawn points active for aliens (the UFO was added using addUFO type: STR_MEDIUM_SCOUT but it doesn't contain spawn points for some reason).
Title: Re: Underground Trial - Map questions
Post by: luke83 on November 13, 2018, 06:44:27 am
List of things to fix:
* The maps are a mess, it's impossible for the terrain to work like this. I made several changes and got the below pic

LOL its just concept at the moment, i have not rally done anything other than steal and recolour a MCD file, i wanted to get something in game to see how the colours look in a dark environment before i spend any time building the maps i am thinking about.

Right, after much stuffing around i can confirm Hobbes tips are been fixed:
1)fixed the folder structure
2)removed extra space from UNDERG02 ( note i have removed it anyway as i didnt have it in my mapview)
3)Now have 9 maps ( and have removed all groups except group2)
4) i dont want a UFO, if anything this map should copy the U_BASE script, i changed the script to U_BASE but it still does not work (see Ruleset).
5) Maps are not a mess per say, pretty sure i didnt have the MCD order correct in original ZIp i posted, maps are almost identical copies of MOUNT
6) i am using a NEW nightly again
7) i have added some basic Routes/to each mapblock so hopefully aliens can spawn
8) I have added xcom Spawn point to a map to hopefully spawnXcom - have these marked as Group2
9) i removed all map block groups - except for group2


Current issue, it now wont let me add alien units to the map, i dont want any UFOs, i want to use the alienBase rules, so any thoughts as to why it wont work.






Title: Re: Underground Trial - Map questions
Post by: Hobbes on November 13, 2018, 01:51:57 pm
4) i dont want a UFO, if anything this map should copy the U_BASE script, i changed the script to U_BASE but it still does not work (see Ruleset).

You need to create a specific script - using the vanilla ones is counter-productive if you don't know what you are doing

Quote
8) I have added xcom Spawn point to a map to hopefully spawnXcom - have these marked as Group2
9) i removed all map block groups - except for group2

Groups are usually used if the mapScript contains Craft/UFOs (where you need at least one map designated as Group 1) and road placement (as in Terror Sites, where you need at least one map for groups 2, 3 and 4).

In your case, you need to have 1 map assigned to group 1, and nothing else. You can also use groups to indicate specific maps, but for simplicity's sake don't use them now.

Quote
Current issue, it now wont let me add alien units to the map, i dont want any UFOs, i want to use the alienBase rules, so any thoughts as to why it wont work.

alienDeployments requires this field to work, otherwise the game has no idea of how many alien units it should place and what weapons they should carry.

Code: [Select]
alienDeployments:
    data:
      - alienRank: 5
        lowQty: 1
        highQty: 1
        dQty: 0
        percentageOutsideUfo: 50
        itemSets:
          -
            - STR_PLASMA_PISTOL
            - STR_PLASMA_PISTOL_CLIP
            - STR_PLASMA_PISTOL_CLIP
            - STR_MIND_PROBE
          -
            - STR_PLASMA_RIFLE
            - STR_PLASMA_RIFLE_CLIP
            - STR_PLASMA_RIFLE_CLIP
            - STR_MIND_PROBE
          -
            - STR_HEAVY_PLASMA
            - STR_HEAVY_PLASMA_CLIP
            - STR_MIND_PROBE
Title: Re: Underground Trial - Map questions
Post by: The Reaver of Darkness on November 14, 2018, 07:09:43 am
It still cant find the file in the Mod folder even after i renamed it, having similar issue with the Pyramid mod also, it wants to load the MCDs from the original games UFo/terrain folder, not the MOD terrain folder.


Going to download the newest nightly and see if that makes any difference.

Update - Same result.

Update2 - I coped all the Terrain data out of the MOD folders and into the original game directories and now it crashes because the map fails to build... I also used the Oldest Nightly i could find, still no luck.

OpenXcom should automatically check the mod folder for terrain files and use them at higher priority than any found in the game folders. Make sure you have your mod's folder system correct. In the OpenXcom\mods\ folder, you should have the main folder for your mod which may contain the various subfolders generally one level deep. The mcd should be in Pyramid_rebirth\TERRAIN\. Make sure all of the spelling is correct--it's all case sensitive as well--and make sure MAPVIEW is using the same versions of the terrain as OpenXcom is using.
Title: Re: Underground Trial - Map questions
Post by: luke83 on December 15, 2018, 10:42:33 am
So i have the map coming into OXC now, still not sure what the final use of this map will be, thinking it may be a Underground Lab, anyway just thought i would share now its generating enough to test  ( i only have 9 map blocks currently so its very early days and most of the MCD is still not built) :P
Title: Re: Underground Trial - Map questions
Post by: Solarius Scorch on December 15, 2018, 12:10:30 pm
I made many underground/cave maps, but this one definitely looks prettier than anything I've done!
Title: Re: Underground Trial - Map questions
Post by: luke83 on December 15, 2018, 12:50:55 pm
I made many underground/cave maps, but this one definitely looks prettier than anything I've done!

Cool, where are your ones? having been away for so long i think i may be missing a lot of good stuff others have done over the years.
Title: Re: Underground Trial - Map questions
Post by: Solarius Scorch on December 16, 2018, 12:26:23 am
I don't have a readily available mod... But check the X-Com Files mod and look for Shogg Village. And Mysterious Caves.