MantisBT - VCMI
View Issue Details
0003133VCMIRandom Map Generatorpublic2020-06-17 20:012023-03-26 15:54
misiokles 
Nordsoft 
nonecrashalways
resolvedfixed 
PCWindows
0.99 
1.0.0 
0003133: "allowedTerrains" command crashes custom mines.
For example HotA made new mines graphics belong to sand terrain.
Code for adding such mines to vcmi is easy.

{
"core:mine" : {
    "types" : {
        "hotaCrystalCavern" : {
        "templates": {
            "avmcrdn0" : { "animation" : "avmcrdn0", //hota sand
                    "mask" : ["VVVV","VBBB","VBAB"],
                    "allowedTerrains":["sand"]
                    },
                }
            },

Without "allowedTerrains":["sand"] command, such crystal mine is generated in every type of terrain. But with "allowedTerrains":["sand"] - game crash during map generation.
n/a
n/a
No tags attached.
png hj.png (1,142,552) 2020-06-17 20:03
https://bugs.vcmi.eu/file_download.php?file_id=3084&type=bug
Issue History
2020-06-17 20:01misioklesNew Issue
2020-06-17 20:03misioklesFile Added: hj.png
2020-06-17 21:44AndruidsNote Added: 0007908
2020-06-18 03:23AndruidsNote Edited: 0007908bug_revision_view_page.php?bugnote_id=7908#r3600
2020-06-18 03:24AndruidsNote Edited: 0007908bug_revision_view_page.php?bugnote_id=7908#r3601
2022-08-21 23:51NordsoftNote Added: 0008304
2022-08-22 12:53NordsoftAssigned To => Nordsoft
2022-08-22 12:53NordsoftStatusnew => assigned
2023-03-26 15:54WarmongerStatusassigned => resolved
2023-03-26 15:54WarmongerFixed in Version => 1.0.0
2023-03-26 15:54WarmongerResolutionopen => fixed

Notes
(0007908)
Andruids   
2020-06-17 21:44   
(edited on: 2020-06-18 03:24)
Let me correct this. Defining new type within mines won't do anything, of course.

misiokles meant this code:

{
"core:mine" : {
    "types" : {
    "crystalCavern" : {
        "templates": {
        "avmcrdn0" : {
        "animation" : "avmcrdn0", //hota sand
        "visitableFrom" : [ "---", "+++", "+++" ],
        "mask" : ["VVVV","VBBB","VBAB"]
                    }
                }
            },

And including:

"allowedTerrains":["sand"]

causes a different type of bug - game will start and RMG will run, but it will generate an empty map. Without borders and with only 2 zones iirc.

(0008304)
Nordsoft   
2022-08-21 23:51   
Should work well in new-terrains feature branch