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
Modding FAQ
Author Message
AVS 

Joined: 25 Feb 2011
Posts: 563
Location: Russia
Posted: 2016-09-02, 02:32   

misiokles wrote:
Ok, another question. I want to modify standard H3 creature banks. For example, I want to place in shipwrecks some Abyss creatures than Wights. I tried various ways, but I failed...
I'm lack of ideas...


File a bug report please, with logs for all cases.
 
     
Warmonger 
VCMI programmer


Age: 28
Joined: 07 Jun 2008
Posts: 1545
Location: Warsaw, Poland
Posted: 2016-09-02, 05:55   

Does your mod check is abyss mod is present?

Code:

    "depends" :
    [
        "abyss"
    ],


Also try something like mod name prefx:
Code:
{ "amount": 5, "type": "abyss:abyssAbyssalCrab" }
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 183
  Posted: 2016-09-02, 07:26   

Macron1 wrote:
Strange...
I made test json for dwarven treasury:
Code:
{
    "core:creatureBank": {
        "types": {


            "dwarvenTreasury": {

                "levels": [{
                    "chance": 40,
                    "guards": [{
                        "amount": 50,
                        "type": "peasant"
                    }, {
                        "amount": 50,
                        "type": "peasant"
                    }, {
                        "amount": 50,
                        "type": "peasant"
                    }, {
                        "amount": 50,
                        "type": "peasant"
                    }, {
                        "amount": 50,
                        "type": "peasant"
                    }],
                    "combat_value": 300,
                    "reward": {
                        "resources": {

                            "gold": 15000
                        },
                        "artefacts": [{
                            "class": "TREASURE"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "TREASURE"
                        }, {
                            "class": "MINOR"
                        }],
                        "value": 17000
                    }
                }, {
                    "chance": 40,
                    "guards": [{
                        "amount": 60,
                        "type": "peasant"
                    }, {
                        "amount": 60,
                        "type": "peasant"
                    }, {
                        "amount": 60,
                        "type": "peasant"
                    }, {
                        "amount": 60,
                        "type": "peasant"
                    }, {
                        "amount": 60,
                        "type": "peasant"
                    }],
                    "combat_value": 350,
                    "reward": {
                        "value": 20000,
                        "resources": {

                            "gold": 17000
                        },
                        "artefacts": [{
                            "class": "MAJOR"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "MINOR"
                        }]

                    }
                }, {
                    "chance": 20,
                    "guards": [{
                            "amount": 60,
                            "type": "peasant"
                        }, {
                            "amount": 60,
                            "type": "peasant"
                        }, {
                            "amount": 60,
                            "type": "peasant"
                        },

                        {
                            "amount": 60,
                            "type": "peasant"
                        }, {
                            "amount": 60,
                            "type": "peasant"
                        }
                    ],
                    "combat_value": 450,
                    "reward": {
                        "value": 26000,
                        "resources": {

                            "gold": 20000
                        },
                        "artefacts": [{
                            "class": "MAJOR"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "MAJOR"
                        }]

                    }
                }]
            },
}

And it works, on visiting dwarven treasury I see peasants, many of them


Thanks Marcon1 and Warmonger. I've tried all your solution but still wights on shipwrecks. That's odd, because Macron's peasants at Dwarven Treasury are present, but when I changed only "dwarvenTreasury" to "shipwreck" in this configuration, there's no peasants in game, only wights!
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2016-09-02, 07:50   

Yes, I checked shipwreck in game, there are wights, because shipwreck is a object of type shipwreck, not of type creatureBank.
So code must be like this:
Code:
{
    "core:shipwreck": {
        "types": {


            "shipwreck": {

                "levels": [{
                    "chance": 40,
                    "guards": [{
                        "amount": 50,
                        "type": "peasant"
                    }, {
                        "amount": 50,
                        "type": "peasant"
                    }, {
                        "amount": 50,
                        "type": "peasant"
                    }, {
                        "amount": 50,
                        "type": "peasant"
                    }, {
                        "amount": 50,
                        "type": "peasant"
                    }],
                    "combat_value": 300,
                    "reward": {
                        "resources": {

                            "gold": 15000
                        },
                        "artefacts": [{
                            "class": "TREASURE"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "TREASURE"
                        }, {
                            "class": "MINOR"
                        }],
                        "value": 17000
                    }
                }, {
                    "chance": 40,
                    "guards": [{
                        "amount": 60,
                        "type": "peasant"
                    }, {
                        "amount": 60,
                        "type": "peasant"
                    }, {
                        "amount": 60,
                        "type": "peasant"
                    }, {
                        "amount": 60,
                        "type": "peasant"
                    }, {
                        "amount": 60,
                        "type": "peasant"
                    }],
                    "combat_value": 350,
                    "reward": {
                        "value": 20000,
                        "resources": {

                            "gold": 17000
                        },
                        "artefacts": [{
                            "class": "MAJOR"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "MINOR"
                        }]

                    }
                }, {
                    "chance": 20,
                    "guards": [{
                            "amount": 60,
                            "type": "peasant"
                        }, {
                            "amount": 60,
                            "type": "peasant"
                        }, {
                            "amount": 60,
                            "type": "peasant"
                        },

                        {
                            "amount": 60,
                            "type": "peasant"
                        }, {
                            "amount": 60,
                            "type": "peasant"
                        }
                    ],
                    "combat_value": 450,
                    "reward": {
                        "value": 26000,
                        "resources": {

                            "gold": 20000
                        },
                        "artefacts": [{
                            "class": "MAJOR"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "MINOR"
                        }, {
                            "class": "MAJOR"
                        }]

                    }
                }]
            },
}
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 183
Posted: 2016-09-02, 08:23   

You are right. Now, shiwrecks work as intended. Thank you gorgously :)
 
     
Andrettin 

Joined: 11 Jul 2016
Posts: 4
Location: Vienna
Posted: 2016-09-02, 19:16   

How do I add new proper names for towns without replacing the pre-existing ones?

This is what I've got so far:

Code:

{
    "core:necropolis" :
    {
        "town" :
        {
            "names" : [
                // original names
                "Haunt's Wind",
                "Cessacioun",
                "Agony",
                "Sanctum",
                "Terminus",
                "Blackquarter",
                "Death's Gate",
                "Grave Raven",
                "Dark Cloud",
                "Coldsoul",
                "Coldreign",
                "Dark Eternal",
                "Ghostwind",
                "Blight",
                "Shadow Keep",
                "Worm Warren",
                // new names
                "Eljudnir", // The hall of Hel (the ruler of the dead in Norse mythology) in Niflheim; Source: Kevin Crossley-Holland, "The Norse Myths", 1980, p. 241.
                "Hvergelmir", // Spring in Niflheim from which the eleven rivers known as Elivagar flow; Source: Kevin Crossley-Holland, "The Norse Myths", 1980, p. 245.
                "Nastrond" // Place in Helheim (realm within Niflheim ruled by Hel) where a hall for evil-doers lies; Source: Kevin Crossley-Holland, "The Norse Myths", 1980, p. 248.
            ],
        }
    }
}


This does the job, but isn't optimal, since I have to repeat the original names. Is there a way to add new names to the "names" array instead of redefining it entirely?
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 183
Posted: 2016-09-02, 19:33   

I think it's logical. You want to add names and the end of the existing list, so you you must copy/paste previous names and add yours at the end. On contrary - if you want to change third name for example, you copy entire list and change only this third name.
 
     
Warmonger 
VCMI programmer


Age: 28
Joined: 07 Jun 2008
Posts: 1545
Location: Warsaw, Poland
Posted: 2016-09-02, 20:12   

This is how json files are interpreted - named items (in quotation marks) replace the old ones. This way you can for instance clear entire list ;)

All we could do here is to change town format so that every name would be separate item, without the list.
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
Andrettin 

Joined: 11 Jul 2016
Posts: 4
Location: Vienna
Posted: 2016-09-02, 20:29   

Warmonger wrote:
This is how json files are interpreted - named items (in quotation marks) replace the old ones. This way you can for instance clear entire list ;)

All we could do here is to change town format so that every name would be separate item, without the list.


Ah, I see :( Thanks for the explanation though!

The thing is that I wanted to make my mod 100% open-source.

Each name being a separate item sounds too cumbersome - how about adding a "new_names" array instead, which would add names to the "names" array instead of replacing the whole thing?
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2016-09-03, 13:15   

Warmonger wrote:

All we could do here is to change town format so that every name would be separate item, without the list.


I hope vcmi team will keep the changes to modding format to minimum, only adding new fields :mrgreen:

Andrettin wrote:
The thing is that I wanted to make my mod 100% open-source.

Than change all names, rewriting standart names written in proprietary lods:-)
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 183
Posted: 2016-10-25, 15:48   

From few reasons I'm looking a way to add my creature +1 attack per turn during battle (so atack is +1 to base in first turn, +2 to base in second, +3 in third and so on..). I thought it's possible only via new special spell.
So I wrote such creature ability:
Code:
            "casts" :
            {
                "type" : "CASTS",
                "val" : 20
            },
            "attackBooster":
            {
            "type" : "ENCHANTER",
            "subtype" : "spell.attackBooster",
            "val" : 1,
            "addInfo" : 1
            }


And here's my spell atackBooster:
Code:
        "levels":
        {
            "base":
            {
                "power": 10,
                "aiValue": 20,
                "range": "0",
                "targetModifier":
                {
                    "smart": false
                }
            },
            "none":
            {
                "description": "Attack",
   
                "cost": 0,
                "effects":
                {
                    "plusOneAttack":
                    {
                        "type": "PRIMARY_SKILL",
                        "duration": ["N_TURNS"],
                        "val" : 1,
                        "subtype" : "primSkill.attack",
                        "valueType" : "ADDITIVE_VALUE"
                    }
                }
            },
            "basic":
            {
                "description": "Attack",   
                "cost": 0,
   
                "effects":
                {
                    "plusOneAttack":
                    {
                        "type": "PRIMARY_SKILL",
                        "duration": ["N_TURNS"],
                        "val" : 1,
                        "subtype" : "primSkill.attack",
                        "valueType" : "ADDITIVE_VALUE"
                    }
                }
            },
            "advanced":
            {
                "description": "Attack",
   
                "cost": 0,
   
                "effects":
                {
                    "plusOneAttack":
                    {
                        "type": "PRIMARY_SKILL",
                        "duration": ["N_TURNS"],
                        "val" : 1,
                        "subtype" : "primSkill.attack",
                        "valueType" : "ADDITIVE_VALUE"
                    }
                }
            },
            "expert":
            {
                "description": "Attack",
   
                "cost": 0,

                "effects":
                {
                    "plusOneAttack":
                    {
                        "type": "PRIMARY_SKILL",
                        "duration": ["N_TURNS"],
                        "val" : 1,
                        "subtype" : "primSkill.attack",
                        "valueType" : "ADDITIVE_VALUE"
                    }
                }
            }

But, +1 attack is granted only fist turn, which is lame, becaure I can give my creature +1 attack permament. Is there any way to give prograssive +1 attack per turn?
 
     
Kantor 

Age: 23
Joined: 28 Dec 2013
Posts: 89
Location: Poland
Posted: 2016-10-25, 17:24   

Quote:
Is there any way to give progressive +1 attack per turn?


Hmm, change duration from "N_TURNS" to "PERMANENT"? The disruption ray spell works quite similar.
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 183
Posted: 2016-10-28, 08:00   

Doesn't work either :(
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 389
Posted: 2016-10-29, 20:38   

Kantor wrote:
Hmm, change duration from "N_TURNS" to "PERMANENT"? The disruption ray spell works quite similar.

I'll leave it here to not left it just on slack: DISRUPTING_RAY is heavily hardcoded.
For now VCMI can't handle duplicate bonuses.

Reasonable amount of work would be needed to make it work.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2017-03-25, 09:52   

By the way, I have a question.
If i'll set
Code:

{
"type":"SPELL_IMMUNITY",
"subtype":"spell.visions"
}

to hero, will it be immune to Visions spell?
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
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

Hosting provided by DigitalOcean
Page generated in 0.05 second. SQL queries: 13