Forum index VCMI Project - Heroes 3: WoG recreated
Forum of the project aiming to recreate best turn-based strategy ever!

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

Previous topic :: Next topic
SoD files mod like
Author Message
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-04, 14:50   

I have now a problem that resources are not found for my mod....

I have a "SoD" mod with a submod "Castle".

Alttough all files are in place and seem to be loaded ok.

Code:
2017-Feb-04 11:56:59.688681 DEBUG global [22c] -         Loading resource at MODS/sod/MODS/castle/Content
2017-Feb-04 11:57:00.501728 TRACE global [22c] - File system loaded, 484 files found


I get these "resource not found errors"...

Code:
2017-Feb-04 15:38:50.821014 WARN global [1ce4] - Data in angel is invalid!
2017-Feb-04 15:38:50.823014 WARN global [1ce4] - At /graphics/animation
    Error: Def file "sprites//creatures//battle//CANGEL.def" was not found

2017-Feb-04 15:38:50.889018 WARN global [1ce4] - Data in archangel is invalid!
2017-Feb-04 15:38:50.892018 WARN global [1ce4] - At /graphics/animation
    Error: Def file "sprites/creatures/battle/CRANGL.def" was not found


Can anyone tell only from this information what could be amiss?

I tried to specify the paths with single and double slashes. (see above)

I think if I have the files in the Content/sprites/creatures/battle/ folder they should be loaded automatically.
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 155
Posted: 2017-02-04, 16:17   

Hard to say, what is amiss without full json code.
But don't write "sprites" in json def path. Game know that defs start to be in 'sprites' folder. So:
"sprites/creatures/battle/CANGEL.def" - BAD code
"creatures/battle/CANGEL.def" - OK code
 
     
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-04, 17:21   

I have uploaded the Mod to https://github.com/krs0/vcmi/tree/ResourceExtractor/Mods

It is not final version but should be close to 90%

The H3 data is missing obviously, but the folder structure is there.

Overall suggestions and comments are welcome.
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 155
Posted: 2017-02-04, 17:35   

Just remove "sprites" word from "animation", "map" etc. and all will be fine.
 
     
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-04, 20:19   

Removing of sprites, sounds, etc seems to be working ty.

Now, I wonder if there is a way to specify in Json something like a macro or variable so you do not have to write all the time the same string?

eg: animationPath = "factions/castle/townScreen/animations"


Code:
{
    "castle" :
    {
        "town" :
        {
            "structures" :
            {
                "extraAnimation": { "animation" : "factions/castle/townScreen/animations/TBCSEXT2.def", "x" : 46,  "y" : 119 },
                "mageGuild1":     { "animation" : "factions/castle/townScreen/animations/TBCSMAGE.def", "x" : 707, "y" : 166, "z" : 1, "border" : "TOCSMAG1.bmp", "area" : "TZCSMAG1.bmp" },
                "mageGuild2":     { "animation" : "factions/castle/townScreen/animations/TBCSMAG2.def", "x" : 706, "y" : 135, "z" : 1, "border" : "TOCSMAG2.bmp", "area" : "TZCSMAG2.bmp" },
                "mageGuild3":     { "animation" : "factions/castle/townScreen/animations/TBCSMAG3.def", "x" : 704, "y" : 107, "z" : 1, "border" : "TOCSM301.bmp", "area" : "TZCSM301.bmp" },
                "mageGuild4":     { "animation" : "factions/castle/townScreen/animations/TBCSMAG4.def", "x" : 704, "y" : 76,  "z" : 1, "border" : "TOCSM401.bmp", "area" : "TZCSM401.bmp" },
                "tavern":         { "animation" : "factions/castle/townScreen/animations/TBCSTVRN.def", "x" : 0,   "y" : 230, "z" : 1, "border" : "TOCSTAV1.bmp", "area" : "TZCSTAV1.bmp" },
                "shipyard":       { "animation" : "factions/castle/townScreen/animations/TBCSDOCK.def", "x" : 478, "y" : 134, "border" : "TOCSDKMS.bmp", "area" : "TZCSDKMS.bmp" },
                "fort":           { "animation" : "factions/castle/townScreen/animations/TBCSCSTL.def", "x" : 595, "y" : 66,  "border" : "TOCSCAS1.bmp", "area" : "TZCSCAS1.bmp" },
                "citadel":        { "animation" : "factions/castle/townScreen/animations/TBCSCAS2.def", "x" : 478, "y" : 66,  "border" : "TOCSCAS2.bmp", "area" : "TZCSCAS2.bmp" },
 
     
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-04, 21:03   

Mod definitions updated: https://github.com/krs0/vcmi/tree/ResourceExtractor/Mods/SoD

Next Hurdle: even though I see no differences to HotA mod I get these errors for Castle mod <root>

Code:
2017-Feb-04 21:31:37.186417 WARN global [1934] - Data in castle is invalid!
2017-Feb-04 21:31:37.189417 WARN global [1934] - At <root>
    Error: Unknown entry found: creatures
At <root>
    Error: Unknown entry found: dwellings
At <root>
    Error: Unknown entry found: heroClases


EDIT: I have managed to find out what was wrong with the above...
- Creatures is not in node "Factions" but in <factionName>.Town
- dwellings should be listed under the unintuitive "objects" node "objects" : [ "config/hota/dwellings" ], (why not "mapObjects")
- heroClases .... well this one was just misspelled (heroClasses), but not in the mod.json but in an inner file.
Last edited by krs on 2017-02-05, 09:52; edited 1 time in total  
 
     
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-05, 10:21   

Next problem. I see some inconsistencies between HotA definition of dwellings and the serialized version i got when I serialized core from code....

So can anyone please check the below definition for a dwelling? When I get an ok I will update all dwellings according to this structure.

(I am not interested in the values, but in the structure itself. EG: is "animation" part of "base"? Is "creatureGeneratorCommon" the name for this node and not dewllings?)

Code:
{
    "castle" :
    {
        "dwellings" :
        {
            "guardhouse" :
            {
                "name" : "Guardhouse",
                "creatures" : [
                    [
                        "pikeman"
                    ]
                ],
                "base" : {
                    "animation" : "factions/castle/adventureMap/dwellings/AVGPIKE0.def",
                    "mask" : [
                        "VVV",
                        "VBB",
                        "VAA"
                    ],
                    "visitableFrom" : [
                        "---",
                        "+++",
                        "+++"
                    ]
                },
            },


For reference this is HotA mod...
Code:
{
    "core:creatureGeneratorCommon" : {
        "types" : {
            "waterfall" : {
                "name" : "Waterfall",
                "creatures" : [[ "nymph" ]],
                "templates" : {
                    "default" : {
                        "animation" : "hota/map/waterfall",
                        "mask" : [ "VVV", "VVV", "VBA" ]
                    }
                }
            },


Ans this is serialized from core...
Code:
creatureGeneratorCommon
{
    "base" : {
        "base" : {
            "mask" : [
                "VVV",
                "VBB",
                "VAA"
            ],
            "visitableFrom" : [
                "---",
                "+++",
                "+++"
            ]
        }
    },
    "handler" : "dwelling",
    "index" : 17,
    "name" : "Creature Generator 1",
    "types" : {
        "airConflux" : {
            "base" : {
                "mask" : [
                    "VVV",
                    "VBB",
                    "VAA"
                ],
                "visitableFrom" : [
                    "---",
                    "+++",
                    "+++"
                ]
            },
            "creatures" : [
                [
                    "airElemental"
                ]
            ],
            "index" : 7,
            "templates" : {
            }
        },
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 155
Posted: 2017-02-05, 12:51   

krs wrote:
Next problem. I see some inconsistencies between HotA definition of dwellings and the serialized version i got when I serialized core from code....

It's not inconsistence. HotA is a mod, so we must "core:" creatureGeneratorCommon schema to add new dwellings to 'database'.

Quote:

So can anyone please check the below definition for a dwelling? When I get an ok I will update all dwellings according to this structure.

I think that your third code is most proper code and animation part must be in the same part of base with masks.
 
     
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-05, 13:15   

I have not understood how object templates should work.
So now I have 2 versions like below. Which one to use?

Code:
{
    "creatureGeneratorCommon" :
    {
        "guardhouse" :
        {
            "name" : "Guardhouse",
            "creatures" : [
                [
                    "pikeman"
                ]
            ],
            "base" : {
                "animation" : "factions/castle/adventureMap/dwellings/AVGPIKE0.def",
                "mask" : [
                    "VVV",
                    "VBB",
                    "VAA"
                ],
                "visitableFrom" : [
                    "---",
                    "+++",
                    "+++"
                ]
            },
        },


Code:
{
    "creatureGeneratorCommon" :
    {
        "guardhouse" :
        {
            "name" : "Guardhouse",
            "creatures" : [
                [
                    "pikeman"
                ]
            ],
            "templates" :
            {
                "default" :
                {
                    "animation" : "factions/castle/adventureMap/dwellings/AVGPIKE0.def",
                    "mask" : [
                        "VVV",
                        "VBB",
                        "VAA"
                    ],
                    "visitableFrom" : [
                        "---",
                        "+++",
                        "+++"
                    ]
                }
            }
        },
Last edited by krs on 2017-02-05, 17:58; edited 3 times in total  
 
     
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-05, 13:33   

In Hero Classes "commander" is needed.
Code:
Error: Required entry commander is missing

Since this is not SoD, could this be made optional?
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 155
Posted: 2017-02-05, 19:44   

krs wrote:
I have not understood how object templates should work.


I'm not familiar with refactoring vcmi config files. When I want to change, I always use "core:creatureGeneratorCommon" commands. All you have to know about object format, you'll read there: http://wiki.vcmi.eu/index.php?title=Object_Format
I guess it's best for you it's trial-and-errors method. It's best for me :) Or browse various existing mods to see how it works under diffirent conditions.
Quote:

In Hero Classes "commander" is needed.
Since this is not SoD, could this be made optional?

In vcmi you can play maps using commanders or stack experience without WoG mod.

Modules:
"STACK_EXPERIENCE", "STACK_ARTIFACTS", "COMMANDERS" are disabled by default, player can enable them by change "false" to "true" in defaultMods.json file and play SoD maps with these features. I can't see any reason to alter this handy functionality.
 
     
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-06, 23:03   

For Castle town buildings I have
Code:
                "horde2" : null,
                "horde2Upgr" : null,
                "mageGuild5" : null,
                "special4" : null


Code:
At /town/buildings/horde2
    Error: Required entry id is missing
At /town/buildings/horde2Upgr
    Error: Required entry id is missing
At /town/buildings/mageGuild5
    Error: Required entry id is missing
At /town/buildings/special4
    Error: Required entry id is missing

How to fix this?
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 155
Posted: 2017-02-07, 13:32   

krs wrote:
For Castle town buildings I have
Code:
                "horde2" : null,
                "horde2Upgr" : null,
                "mageGuild5" : null,
                "special4" : null


You can safely delete this code.
 
     
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-07, 22:59   

It seems that all creature dwellings have the same "visitableFrom" and "mask" definitions.
It looks pointless what I have done... that is to repeat these lines for each and every single dwelling.
Code:
"visitableFrom" : [ "---", "+++", "+++" ],
                "mask" : [ "VVV", "VBB", "VAA" ]


Can someone review the definition below? I am concerned about the "template" : "default" part. And about the "name" : "Creature Generator 1", part

Code:
{
    "creatureGeneratorCommon" :
    {
        "handler": "dwelling",
        "name" : "Creature Generator 1",
        "base" :
        {
            "base" :
            {
                "visitableFrom" : [ "---", "+++", "+++" ],
                "mask" : [ "VVV", "VBB", "VAA" ]
            }
        },
        "types" :
        {
            "guardhouse" :
            {
                "name" : "Guardhouse",
                "creatures" : [
                    [
                        "pikeman"
                    ]
                ],
                "templates" :
                {
                    "default" :
                    {
                        "animation" : "factions/castle/adventureMap/dwellings/AVGPIKE0.def",
                    }
                }
            },
            "archersTower" :
            {
.....................................
 
     
krs


Joined: 04 Sep 2012
Posts: 374
Posted: 2017-02-08, 21:29   

I miss Ivan :(
 
     
Display posts from previous:   
Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group
Template Chronicles modified by Nasedo modified by Tow.
© VCMI Team
Page generated in 0.09 second. SQL queries: 13