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

Help & Bugs - Modding FAQ

Warmonger - 2013-02-12, 17:07
Post subject: Modding FAQ
Questions and answers related to modding. Please ask for advice or share your knowledge regarding mods in VCMI here.

For general suggestions of modding system structure and capabilities visit the following thread:
Modding system discussion

Warmonger - 2013-02-12, 17:13

Set wrote:
I believe there is a bug with "auto" mode in buildings.json (Town Format). I used it to create additional structures in background when building higher levels of Village Hall (like ext2-ext5 Rampart in original HoMM3). All works fine when I start game with Village Hall and then upgrade, but when I start game with already upgraded hall, there are none of those additional structures at all. They appear only after building higher level hall.

Still I'm not sure if I use this "auto" mode for wrong purpose or is it really a bug. :P

Ivan - 2013-02-12, 19:45

Bug I suppose. For 0.91 it should be possible to use same ID's as in H3 for these buildings (27-29). Later I'll try to fix all issues like this along with string ID's for buildings.
Set - 2013-02-14, 07:06

I got next one. Hero specialty this time. Trying to make specialty, that doubles Fire Wall damage.
First i go:
"type": "SPECIFIC_SPELL_DAMAGE",
"subtype": "spell.fireWall",
"val": 100,
It shows double damage in spellbook, but when triggered does only base dmg. So i tried:
"type": "SPECIFIC_SPELL_DAMAGE",
"subtype": "spell.fireWall",
"val": 100
"valueType": "PERCENT_TO_BASE"
And it does nothing at all :D
Next tried same with just "Spell_Damage" with same subtype, val and effects were just opposite XD it does nothing without valuetype and only shows double damage in spellbook with it.

So my question is how to make it right?

PS. My guess is: whole fire wall spell is bugged, even sorcery doesnt work right =(

Warmonger - 2013-02-14, 08:16

Yes, it was bugged same as Landmine. Already fixed it.
Set - 2013-02-14, 17:13

Last question I hope (or two questions :P).
I successfully added my town and put in game with Cove without crash, but all my town's icons have been replaced by Cove's, like here: http://img820.imageshack....beztytuubrc.png

I tried to find some changeable town's ID or something like that, but in vain. Am I blind or You were not rly prepared for more than one town at once? :D
And You get one question extra: Is there any way to put heroes in order other than A-Z in game menu? :P
By looking at Cove I guess not, but want to be sure.

EDIT: PS. (before You start to hate me) - I ask only about matters, that I can't find in bugtracker, believe me XD

Ivan - 2013-02-15, 09:09

Have you changed "buildingsIcons" entry in config to path with your icons?
Quote:
I tried to find some changeable town's ID or something like that, but in vain.

Why? All ID's are assinged dynamically on startup - you shouldn't rely on them.
Quote:
Is there any way to put heroes in order other than A-Z in game menu? :P

Right now - no. And right now I don't see any nice way to add this. Perhaps I'll add sorting by hero class so might heroes will go before magic heroes but that's all.

Set - 2013-02-15, 09:54

Zzz, all works fine, sorry for trouble.
Incredible what a little sleep do with people =X
I didn't change frame IDs in faction. Stupid, stupid, stupid.

Macron1 - 2013-05-20, 16:58

I need consultation.
I want to make creature, will can cast resurrection. And one creature can resurrect 25 hit points per cast.
I write its abilities like in Mod Wiki:

{"type":"SPELLCASTER",
"subtype":"spell.resurrection",
"value":3,
"additional info":100},
{"type":"SPECIFIC_SPELL_POWER",
"value":500,
"subtype":"spell.resurrection"}


But when in battle, cursor doesn't change over my dead stack, and nothing is resurrected.
Please write, how this ability must be written to work?

Warmonger - 2013-05-20, 20:12

Did you give CASTS to your creature? A creature needs to have at least 1 cast to be able to do anything. See Archangel for reference.
Macron1 - 2013-05-20, 21:11

Warmonger wrote:
Did you give CASTS to your creature? A creature needs to have at least 1 cast to be able to do anything. See Archangel for reference.


Warmonger wrote:
Did you give CASTS to your creature? A creature needs to have at least 1 cast to be able to do anything. See Archangel for reference.


If cast is not set, there is "limitless" number of casts (maybe limited by spellpoints- not checked).
I added CAST altrough, it didn't help.

I forgot of archangels.
I copied parametres from them, this didn't help:


{
"type":"SPELLCASTER",
"value":0,
"subtype":"spell.resurrection",
"additionalInfo":100
},
{
type:"SPELLCASTER",
"value":25,
"subtype":"spell.resurrection"
},
{"type":"CASTS",
"value": 2}


"spellpoints" set to 200, it's also not a problem...

Don't know what to do...
I'm trying to make First Aid Tent external, already corrected DEF, and try to force it resurrect stacks:-)

Ivan - 2013-05-21, 00:21

This is how Archangel config looks currently:
Code:
"resurrection100hp" :
{
    "type" : "SPECIFIC_SPELL_POWER",
    "subtype" : "spell.resurrection",
    "val" : 100
},
"resurrects" :
{
    "type" : "SPELLCASTER",
    "subtype" : "spell.resurrection"
},
"spellpoints" :
{
    "type" : "CASTS",
    "val" : 1
},

What I see in yours:
1) Two bonuses with type "SPELLCASTER". One should be "SPECIFIC_SPELL_POWER".
2) "value" should be "val"

Macron1 - 2013-05-21, 05:56

Ivan wrote:

What I see in yours:
1) Two bonuses with type "SPELLCASTER". One should be "SPECIFIC_SPELL_POWER".
2) "value" should be "val"


1) it's miswriting:-)
2) smell a diabolic lot of work to convert all mods to 0.93b
After that try again

For what purpose these strings like "spellpoints" added before abilities? There may be any text? Or these strings are fixed?

Macron1 - 2013-05-31, 08:45

I saw an example mod "conflux-tweaks.zip" wich shows how to modify standard creatures and towns.
But this means that they will be modified.
Is there a possibility to "clone" standard castles (for example take "castle" faction, make a copy as "castlex" faction), and then modify it same way?

Ivan - 2013-05-31, 09:00

Quote:
Is there a possibility to "clone" standard castles (for example take "castle" faction, make a copy as "castlex" faction), and then modify it same way?

No. And this is unlikely to change.

Macron1 - 2013-05-31, 09:13

Ivan wrote:
Quote:
Is there a possibility to "clone" standard castles (for example take "castle" faction, make a copy as "castlex" faction), and then modify it same way?

No. And this is unlikely to change.

Why?
I don't think it's hard to copy structure data to one place to another. One copy operation is so hard?

Ivan - 2013-05-31, 09:25

Because this is far more complex than a simple copy. If you indeed looked in sources this should have been obvious.
Macron1 - 2013-05-31, 09:47

Ivan wrote:
Because this is far more complex than a simple copy. If you indeed looked in sources this should have been obvious.

I didn't looked for this part.
So it's harder, that to load external mod?
OK, I already have standard towns externationalized as json files. Just proceed old way to clone castles...

Macron1 - 2013-06-15, 22:20

I have a question.
In examples of conflux-tweaks there I can modify classic creatures like

"core:psychicElemental" :
{
... replaced parametres...
}


But how can I address creatures from other mods?
Record like

"diabloScorcher"{"faction":"newfaction"}

in new mod in creatures section don't displayed as error, but faction alignment of creatures stays the same in game.

Ivan - 2013-06-17, 10:11

Quote:
But how can I address creatures from other mods?

Replace "core" with name of your mod:
<mod name>:<object name>

Macron1 - 2013-06-17, 10:55

Ivan wrote:
Quote:
But how can I address creatures from other mods?

Replace "core" with name of your mod:
<mod name>:<object name>

You said earlier this adression will be ripped off in next release. Is it not so?

Ivan - 2013-06-17, 11:09

What I'd like to have in next release is:
1) Mods MUST use format <mod>:<object> to access any other mod
2) Mods can access ONLY mods mentioned in mod dependencies ("depends" entry)

In current version this will cause warning and *may* work correctly. In next version this will be considered as error meaning that game won't even start.

So accessing (for example) WoG creature possible only if
1) WoG is dependency
2) access done in wog:<creature> format

Macron1 - 2013-07-01, 14:51

By the way I wanted to ask:
will Silo work, if I point that it produces "gold"? And what amount of gold it produce per day?
Same for "mythril"?

Macron1 - 2013-07-26, 04:47

1) Will repeat my question, maybe someone can say something:
will Silo in town work, if I point that it produces "gold"? And what amount of gold it produce per day?
Same for "mythril"?


2) In Wiki there are some bonuses without vals, for example;
MOVEMENT
LAND_MOVEMENT
SEA_MOVEMENT
SIGHT_RADIOUS

In some mods I saw that, for example, SIGHT_RADIOUS is getting some value trough "val".
Can someone correct Wiki, if this and other bonuses require val, and what's it's meaning?

3) I want to reproduce artifact from HMM1, which gives additional shot to ballista during siege. Is it possible right now, or not? If possible, what should I write in Bonuses?

4) If I want to create creature artifact, that allows creature to rise creatures from dead allies, I must wrote this, right?
:
Code:
        "bonuses":
        [
            {
                "type": "DAEMON_SUMMONING",
                "subtype": "creature.demon",
                "val": 50
            }
        ]


5) Is there a way to point % of happening of DEATH_STARE ability?

Ivan - 2013-07-26, 10:54

1) Unlikely. And if it will it will produce 1 gold / day.

2) sight radius and movement bonuses obviously need distance to function. Probably Warmonger decided not to document something that is obvious.

5) val

Macron1 - 2013-07-26, 11:20

Ivan wrote:

2) sight radius and movement bonuses obviously need distance to function. Probably Warmonger decided not to document something that is obvious.

It's not obvious for me. What to write to them? % of bonus to base of points/cells on adventure map?

Warmonger, can it be added to Wiki? And MORALE/LUCK also.

Ivan wrote:

5) val

val is already reserved for

Quote:
val: if subtype is 0, its the (average) percentage of killed creatures related to size of attacking stack

Warmonger - 2013-07-26, 11:29

Added some triial descriptions for these.

Just in case, everone can edit wiki :P

DAEMON_SUMMONING require creature CASTS to work.

Macron1 - 2013-07-26, 11:32

Warmonger wrote:

DAEMON_SUMMONING require creature CASTS to work.


When I tried it, creature summoned creatures without casts unlimitedly.
CAST only limited ability to 1 (in my case).

And 6th question:

IMPROVED_NECROMANCY
allows Necropolis units other than skeletons to be raised by necromancy

When I added it to hero with "subtype":"creature.someCreature", it didn't work (trivial sceletons were rased). Can you also describe it more fully?

Warmonger - 2013-07-26, 11:44

Well, at the moment it's hardcoded to work just like Cloak of the Undead King. I may change that later to allow more customization.
Macron1 - 2013-07-26, 11:49

Warmonger wrote:
Well, at the moment it's hardcoded to work just like Cloak of the Undead King. I may change that later to allow more customization.


And I earlier proposed ability like DAEMON_SUMMONING, but it works only on enemy stacks (like RAISE_DEAD).
I looked to code, it requires only new "if" (stack is enemy). Can It be implemented later?
It will emerge brand new tactics, so player with Resurrection will no longer be happy.

Macron1 - 2013-07-29, 18:50

And another question.
I need to make creatures that are strong at melee combat, and their shooting is weaker (for example, for 30-50%). Is there a way to make some bonus/minus so their melee damage will be higher that shots?

Warmonger - 2013-07-29, 19:27

Quote:
Is there a way to make some bonus/minus so their melee damage will be higher that shots?

Use ONLY_DISTANCE_FIGHT range modifier to add some penalty for creature attack.

Macron1 - 2013-07-29, 19:51

Warmonger wrote:
Quote:
Is there a way to make some bonus/minus so their melee damage will be higher that shots?

Use ONLY_DISTANCE_FIGHT range modifier to add some penalty for creature attack.


In creature bonuses I found CREATURE_DAMAGE.
But this usually is written in hero config, so will it work, if I write bonus in creature config? Will this bonus be only for the creature?

If this will not work, I found ALWAYS_MINIMUM_DAMAGE for attacks from range.
There can be assigned antibonus to minimum damage. So I can make it -val to correct ranged attacks. Right?

Macron1 - 2013-08-15, 10:17

By the way, I saw idea of artifact, that turns out flying ability of all creatures in battle.
Is something like this already possible in VCMI?
Or all flying creatures must be listed by their name in that case?

HatredElement - 2013-08-22, 13:21

Please forgive my stupid questions and and poor English.How "advMapAmount" works?
Ivan - 2013-08-22, 15:18

Described here: http://wiki.vcmi.eu/index...Creature_Format

This is used to determine size of creature army placed in map editor or on receiving double growth from "Month of" event.
Code:
"advMapAmount" :
{
    "min" : 10,
    "max" : 20
},

This code means that random stacks of a creature on map will be 10-20 units in size.

Macron1 - 2013-08-30, 05:50

I know that right now it's not possible to turn off standard castles.
But we have modding mechanism that allows to change "core:<faction>" towns,
So I want to try in nearly future to take some new town and change it to replace Castle, for example.
Also I want to try to set all castle heroes as "special" : true, so they will not appear on maps.
I'll try also to replace standard creatures by new (changing their parameters, names etc leaving only identificator.
What do you think of it?

Warmonger - 2013-08-30, 05:58

Well, it's not that simple. For example, Stables will always try to upgrade Cavaliers to Champions, which is hardcoded and may not make much sense once these creatures are replaced.
Same issus will be caused by any part where creatures are used - Griffin Conservatory and other banks, necromancy, skeleton transformer, Deity of Fire etc.

Macron1 - 2013-08-30, 06:00

Warmonger wrote:
Well, it's not that simple. For example, Stables will always try to upgrade Cavaliers to Champions, which is hardcoded and may not make much sense once these creatures are replaced.

If I change Cavaliers and Champions animations to new creatures, Stables will upgrade new units, I think.
Graphical appearance of Stables can be changed too :-)

Macron1 - 2013-09-12, 20:08

I wanted to ask - is there some formulas (maybe inaccurate formulas) to calc AI Value/Fight Value for creatures (maybe based on hit points, damage, attack/defence skills)?
I don't want, however, to calculate and correct these values manually altrough, maybe will think about some program modifying values in JSONs according to formulas.

PS If AI is not basing it's actions in battle based on these values, and they can be calculated, then maybe VCMI could count Fight Value/AI Valus on start not forcing people to enter these values as required?

Ivan - 2013-09-12, 22:29

Quote:
I wanted to ask - is there some formulas (maybe inaccurate formulas) to calc AI Value/Fight Value for creatures (maybe based on hit points, damage, attack/defence skills)?

None known.
Quote:
PS If AI is not basing it's actions in battle based on these values, and they can be calculated, then maybe VCMI could count Fight Value/AI Valus on start not forcing people to enter these values as required?

Battle AI largely/completely ignores them.
But adventure map AI does uses them.

Macron1 - 2013-09-13, 11:33

Ivan wrote:
Quote:
I wanted to ask - is there some formulas (maybe inaccurate formulas) to calc AI Value/Fight Value for creatures (maybe based on hit points, damage, attack/defence skills)?

None known.

I found tool Mon Power
https://sites.google.com/site/sergroj/wog/H3MonPower.rar?attredirects=0&d=1
It calculates AI/Fight Values for monsters based on Attack/defence/Hit Points/damage values
(not all, but author swears it gives results close to standard).
Unfortunately, seems there are no sources, so these formulas cannot be reused in other programs...

Randjan - 2013-09-16, 22:43

Can someone help me? I was trying to make a mod, and I got this error:
Code:
23:31:33 ERROR global [11c0] - Resource with name CONFIG/KNIGHT/KNIGHT and type TEXT wasn't found.
23:31:33 ERROR global [11c0] - Disaster happened.
23:31:33 ERROR global [11c0] - Reason: 0xe06d7363 - UNKNOWN EXCEPTION at 0023:75C44B32
23:31:33 ERROR global [11c0] - Thread ID: 4544 [4544]
23:31:33 ERROR global [11c0] - Crash info will be put in VCMI_client.exe_crashinfo.dmp

Ivan - 2013-09-17, 00:30

This means that one of files listed in mod.json was not found (missing file or mismatching name).

Normally vcmi will load file with such name from "Mods/<modname>/Content/config/knight/knight.json"

Randjan - 2013-09-17, 18:29

Thank you, Ivan.

But unfortunately, I have a problem now. I'm trying to make heroes for the Succession Wars mod for VCMI, and I came across a problem that many names are the same.

So when I made a hero with a class "knight", which was actually supposed to be a H2 knight, he appeared as an additional knight hero in the castle faction. His specialty were H2 peasants, but instead he has neutral H3 peasants at startup and his specialty bonus works for them, I haven't given him the other peasants to see if his specialty will work on them, but all of this makes the mod impossible.

Any ideas? :roll:

Warmonger - 2013-09-17, 18:38

If you add new heroes and units with new identifier, they will be added to the game. If you use old identifiers, they will be replaced. What is confusing here?
Ivan - 2013-09-17, 19:06

Well, not exactly. Overriding H3 objects works only with "core" prefix. Meaning that:
"core:knight" : {} // edits H3 object
"knight" : {} // creates new object with same ID but different mod-origin.
Works as designed IMO and quite difficult to change.

And using such ID's in mod creates ambiguous references - "peasant" can be resolved to both H3 peasants as well as peasants added in mod. Right now such situation be "resolved" by random :(
I would consider this as bug - triggering a warning if such situation is encountered is a better idea.

How to fix mod:
a) Rename offending object :)
b) Select object from specific mod using scopes. So "core:peasant" will always resolve to H3 peasants. While using "knight:peasant" will always resolve in peasants from mod "knight".

Randjan - 2013-09-20, 19:13

Can you tell me where can I find a list of specialties that are possible to add for heroes in the latest version?
Warmonger - 2013-09-20, 19:35

Same place as always
http://wiki.vcmi.eu/index...all_bonus_types

Keep in mind that it's possible to use any bonus as hero specialty, even these which weren't originally related to specialties. Many of them should work if only it makes sense.

Randjan - 2013-09-20, 20:59

Warmonger wrote:
Keep in mind that it's possible to use any bonus as hero specialty, even these which weren't originally related to specialties. Many of them should work if only it makes sense.


Really?! :shock: Because I was just about to ask if you were going to make some new specialties. I thought there were some specialties that weren't made yet. I read that many months ago somewhere on google docs.

I was just about to try to make a hero who always has positive morale. Is that really possible? Can I really add SELF_MORALE as a specialty? I have more unusual specialties from the Succession wars mod, and I hope to copy most of them to VCMI as a mod. Some of them are pretty useless, so I might just not make those, like "starts with expert wisdom".

Warmonger - 2013-09-20, 21:44

This should work thanks to bonus system. All hero abilities will be surely propagated to the creatures in army. Not certain about artifact bonuses, but at least some should. Try it ;)
Randjan - 2013-09-20, 21:59

Either I made a mistake or SELF_MORALE isn't possible to work.
This is what I wrote:
Code:
"specialty": //always good morale
        [
            {
                "bonuses":
                {
                    [
                    "type": "SELF_MORALE"
                    ]
                }
        ]


And, why does VCMI report images in defs as missing? Is that a bug or what? This makes me want to extract files, even though the def has my icons perfectly aligned.

HatredElement - 2013-09-21, 02:34

And I found that forge 0.6-fixed cannot work on 0.93c,either.
So can someone fix the two mods and upload them?

Randjan - 2013-09-21, 11:30

HatredElement wrote:
And I found that forge 0.6-fixed cannot work on 0.93c,either.
So can someone fix the two mods and upload them?

I think I can, but I don't know where to download the forge. And I need to fix 2 more bugs with your preserve mod, even though it's playable now, I want to fix it completely when I send it to you.

I'm also working on the succession wars mod, but I don't know how to put all the hero specialties.

Warmonger - 2013-09-21, 12:12

Can't you just leave Forge town to Forge Team? They will update it when the time comes.
Randjan - 2013-09-21, 17:18

Warmonger wrote:
Can't you just leave Forge town to Forge Team? They will update it when the time comes.

I just thought people would like it to be playable, if the only reason the mod doesn't work is small changes that were made to the mod system. I wouldn't change the mod at all. And I also thought that mod was dead before. I thought HotA team were the only ones that would make the Forge town.

Macron1 - 2013-09-24, 23:01

[quote="Randjan"]
Warmonger wrote:
I thought HotA team were the only ones that would make the Forge town.

There are some Forges exept non-released HOTA Forge.

I think it will do no harm, if you will correct some VCMI towns to make them work.

Macron1 - 2013-10-04, 17:45

I wanted to ask.
What will happen, if there will be class of hero defined for "faction":"neutral" and some heroes are made?
Will they appear in taverns in towns?
Or they will be only in prisons?
Or they will not be used at all?

I plan to create some heroes assigned as neutrals, with non-standard relatively big starting armies of hobbits/boars/etc neutrals

Ivan - 2013-10-04, 18:07

Quote:
What will happen, if there will be class of hero defined for "faction":"neutral" and some heroes are made?

Theoretically this should work
Quote:
Will they appear in taverns in towns?

Normally they won't because faction "neutral" have 0 chance to appear in taverns ("tavern" entry in town/hero class formats)
Quote:
Or they will be only in prisons?

Neutral heroes *may* appear in prison. But heroes in prisons are not random - they are set in map editor.

Macron1 - 2013-10-04, 20:05

Ivan wrote:
Neutral heroes *may* appear in prison. But heroes in prisons are not random - they are set in map editor.

As I remember, they are random, if not set.
So neutral heroes will do what I want - will not appear in towns and will be as bonus chars.
Thanks for answer.
PS I think prisons are often useless (but have strong guards). Chance to meet uber hero will make them more useful.

Macron1 - 2013-10-09, 13:41

Another question for modding system.
It seems there is some property "WAR_MACHINE" mentioned somewhere in spells.
Do this flag helps creature to get bonuses from artilliery/ballistics skills?
Or is it used some another way?

Randjan - 2013-10-12, 20:56

Is it possible to add a specialty "starting with expert skill", like Adrienne has expert fire magic at start?
Macron1 - 2013-10-12, 21:00

Randjan wrote:
Is it possible to add a specialty "starting with expert skill", like Adrienne has expert fire magic at start?


There are only schools of magic available this way, I think.

Warmonger - 2013-10-14, 05:54

Any secondary skill should work with Adrienne's specialty.
Quote:
It seems there is some property "WAR_MACHINE" mentioned somewhere in spells.
Do this flag helps creature to get bonuses from artilliery/ballistics skills?

No. here is no such thing like "bonus from artillery skill" in general.
It only menas that war machines are immune to certain spells or effects.

Macron1 - 2013-10-14, 11:02

Warmonger wrote:
Any secondary skill should work with Adrienne's specialty.
Quote:
It seems there is some property "WAR_MACHINE" mentioned somewhere in spells.
Do this flag helps creature to get bonuses from artilliery/ballistics skills?

No. here is no such thing like "bonus from artillery skill" in general.
It only menas that war machines are immune to certain spells or effects.


But we can use WAR_MACHINES in limiters also to give em some bonuses, right?

Didn't see Adrienne ability config. But think it's different.

For magic schools I can write

"type":"MAGIC_SCHOOL_SKILL",
"subtype":8,
"val":3

and hooray - hero has expert earth magic, and it don't occupy a slot of sec. skill.

For SPECIAL_SECONDARY_SKILL skill is required to be in slot. Or I'm wrong, and this also don't need skill to be present?

Macron1 - 2013-10-16, 22:58

Warmonger wrote:
Any secondary skill should work with Adrienne's specialty.
Quote:
It seems there is some property "WAR_MACHINE" mentioned somewhere in spells.
Do this flag helps creature to get bonuses from artilliery/ballistics skills?

No. here is no such thing like "bonus from artillery skill" in general.
It only menas that war machines are immune to certain spells or effects.


I created hero wih bonuses to SIEGE_WEAPON.

Code:
    "warmachinesCorwin" :
    {

        "class" : "warmachinesMechanic",
....
                "description" : "Siege Weapons shots +4",
                "tooltip" : "Siege Weapons shots +4",
                "name" : "Siege Weapons shots +4"
....
        "specialty":
        [
            {
                "bonuses":
                [
                    {
                        "type": "SHOTS",
"val":4,
"valueType":"ADDITIVE_VALUE",
"limiters":["SIEGE_WEAPON"]
                    }
                ]
            }
        ]
    },

And VCMI says it doesn't know "SIEGE_WEAPON" limiter. What I have to do?


UPG Got with it. I changed "limiters":["SIEGE_WEAPON"] to

Code:
"limiters":
[
{

    "type": "HAS_ANOTHER_BONUS_LIMITER",
                                "parameters" : ["SIEGE_WEAPON"]

}
]


Now it works.

stanislav_ua - 2013-10-28, 17:00

Is it possible to create new faction without town? Like Neutral faction? What should I wright in the "town" column in faction.json file?
Macron1 - 2013-10-28, 17:05

stanislav_ua wrote:
Is it possible to create new faction without town? Like Neutral faction? What should I wright in the "town" column in faction.json file?


Just now it's not possible to create faction without town.
I suggested to do "special":true value to faction to skip its selection in start-up.
But right now only "neutral" faction can do without town.

Ivan - 2013-10-29, 11:27

It should be possible - if "town" entry is not present then it will act as neutral faction. If not - then I would consider this as a bug.
Macron1 - 2013-10-29, 12:25

Ivan wrote:
It should be possible - if "town" entry is not present then it will act as neutral faction. If not - then I would consider this as a bug.



I checked - great, this now works (didn't worked in 0.93, so I didn't recheck it).

For example, this is content of faction.json. No other files is needed now for section "factions" in json.
Code:

{
    "specialsUSArmy": {
        "name": "US Army",
        "creatureBackground": {
            "120px": "USArmy/120px.bmp",
            "130px": "USArmy/130px.bmp"
        },
        "nativeTerrain": "sand",
        "commander": "specialsUSMarine",
        "alignment": "good"

    }
}


Now we can create factions without town - only with creatures and heroes in it!

Macron1 - 2013-11-03, 14:43

I want to create new heroes with some artefacts (for example, hero with ballista or some artifact on start).

How can I do this?
In WIKI there is no section for artefacts or war machines:
http://wiki.vcmi.eu/index.php?title=Hero_Format

zmudziak22 - 2014-01-13, 18:23

How can I modify original Hero? I want replace Xeron's skills and change speciality to upgrades Devils to Arch Devils(Mobile Upg. Forsaken Palace) and still get his bonuses to this Creatures..
Macron1 - 2014-05-21, 15:13

I wanted to ask about composite artefacts.
Must i again write all bonuses from components of it?
Or i must only write new bonus that will come from it?

I'm asking because we have no editor and i cannot place new arts in it yet to test them.

Warmonger - 2014-05-21, 16:00

All bonuses from parts will be propagated to combined artifact automatically by engine.
edeksumo - 2014-10-09, 11:25

Hi, I'm adding some creatures to VCMI but when i start game, console show a lot of warnings: identifier creaturename is not in camelCase!. How I can remove this errors?
Kantor - 2014-10-09, 14:20

Check if first letter of Your creature is small, and if not change it to small one.
Macron1 - 2014-10-09, 16:05

edeksumo wrote:
Hi, I'm adding some creatures to VCMI but when i start game, console show a lot of warnings: identifier creaturename is not in camelCase!. How I can remove this errors?


Good:
Code:
"creatureName" :
{
    // translatable names
    "name" :
    {
        "singular" : "Creature",
        "plural" : "Creatures"
    },
    "level" : 0,


Bad:
Code:
"CreatureName" :
{
    // translatable names
    "name" :
    {
        "singular" : "Creature",
        "plural" : "Creatures"
    },
    "level" : 0,
[/code]

edeksumo - 2014-10-09, 18:21

It's work thanks, I've got one question, is there any maximum total added creatures? Because I've got them a lot, but today vcmi give me some error. And when i disable one creture, error disapear.
Warmonger - 2014-10-09, 18:36

How about possibility that this creature is buggy?
edeksumo - 2014-10-09, 19:06

No, i disable one of your creature dowloaded from this site.
Warmonger - 2014-10-09, 19:22

So what exactly is the error?
edeksumo - 2014-10-09, 19:33

Disaster happened
Reason 0xc0000005 - EXCEPTION_ACCESS_VIOLATION at... after this there are some numbers but always them are random.

Warmonger - 2014-10-09, 19:50

When exactly does this show?
edeksumo - 2014-10-09, 20:10

When game run (you know first videos).
Warmonger - 2014-10-09, 20:17

I don't see how Launcher mods could cause issues like that. Please make detailed report here with the list of installed mods, console log and everything else you know.
MAcron1 - 2014-10-10, 09:43

edeksumo wrote:
No, i disable one of your creature dowloaded from this site.


Firstly, say what creature mod are you talking about?

Macron1 - 2014-11-30, 08:55

Question: is now for adventure map objects I cannot change standard text appearing?
I want to make Water Wheel - like object (Farm, subid object of Water Wheel), but to change text, that is showed when visiting.

Macron1 - 2014-12-25, 19:47

As I remember, bonuses for war machines worked in >0.96
In 0.97 I add hero:
Code:

    "lightcastleSiegeMaster1" :
    {
        "class" : "lightcastleSiegeMastert",
        "female" :false,
"spellbook" :
        [   
       
        ],

        "texts" :
        {
            "name" : "Mint",
"biography":"NO_TEXT",
            "specialty" :
            {
                "description" : "Ballista +1 shot and health bonus",
                "tooltip" : "Ballista +1 shot and health bonus",
                "name" : "Ballista +1 shot and health bonus"
            }
        },
        "images" :
        {
            "specialtySmall" : "lightcastle-heroes/ballista_32",
            "specialtyLarge" : "lightcastle-heroes/ballista_44",
            "large" : "lightcastle-heroes/siege-large/scout1.bmp",
            "small" : "lightcastle-heroes/siege-small/scout1.bmp"
        },
        "army" :
        [
            {
                "creature" :"lightcastleCompanyAgent",
                "max" :22,
                "min" : 18
            },
            {
                "creature" :"ballista",
                "max" :1,
                "min" : 1
            }
        ],
        "skills" :
        [
            {
                "level" : "advanced",
                "skill" : "artillery"
            }
        ],
       
        "specialty":
        [
            {
                "bonuses":
                [
                    {
                        "type": "ADDITIONAL_ATTACK",
                        "val":1,
                        "limiters":
                        [
                            {
                                "type": "CREATURE_TYPE_LIMITER",
                                "parameters" : ["ballista", true]
                            }
                        ]
                    },
                    {
                        "type": "STACK_HEALTH",
                        "val":700,
                        "limiters":
                        [
                            {
                                "type": "CREATURE_TYPE_LIMITER",
                                "parameters" : ["ballista", true]
                            }
                        ]
                    }
                ]
            }
        ]
    },

and nothing happens - ballista doesn't get +1 shot and hit points +700.
Is it a bug? Or i'm doing something wrong?

edeksumo - 2015-01-10, 12:10

Hi is it possible to blacksmith produce two war machines? I'm trying this:
"warMachine" : "ballista",
but, it's don't work.

Macron1 - 2015-02-15, 14:59

edeksumo wrote:
Hi is it possible to blacksmith produce two war machines? I'm trying this:
"warMachine" : "ballista",
but, it's don't work.

Now it's impossible.

Robert - 2015-03-21, 22:03

Hi guys. I'm newbe.

I've installed latest 9,7c version with some basic mods (like wog and Hota) instaled automaticly.

I tried to modify mods a little bit. Tried change some "def" graphics but the problem is: I can't find those mods and def folders. Tried to find in "Mods" folder but without succeed.

In game everything works fine. I've got commanders, I've got new Hota city- and that is very cool. Problem is: I cant find def graphics for mods...

I'll be very glad for any help...

Robert - 2015-03-21, 22:19

I think, I have found right folder in: documents and settings/My games- folder. Try to replace some defs...

Edit: Ok. Problem solved. Everything work's fine...

Macron1 - 2015-08-05, 12:09

As i can see in sources
https://github.com/vcmi/vcmi/blob/develop/lib/mapObjects/CRewardableConstructor.cpp
JSON configuration for new/modified standard map objects is already implemented.
But there are no examples how how to use these features.
Have someone messed with adding new rewardable objects?
Can help be added to Wiki?

Dydzio - 2015-08-05, 15:20

Does VCMI support recruiting multiple units from one building in town? I want one building upgrade to add two possible units to buy, same as upgrades in heroes 5: tribes of the east, looks like it does not work.
Macron1 - 2015-08-05, 18:35

Dydzio wrote:
Does VCMI support recruiting multiple units from one building in town? I want one building upgrade to add two possible units to buy, same as upgrades in heroes 5: tribes of the east, looks like it does not work.


Because you must do two buildings for 2 units.
Like "building43" is upgrade for "building36", you add it to hallSlots and assign it "redDragon" on 7th level.
Then you add "building50", in "structures" write "requires": ["building43"], "mode":"auto".
then don't write it to hallSlots, but assign "blackDragon" to 3rd unit of level 7.
When 43 building builds, 50 building will be built automatically.

Example:
BUILDINGS.JSON
Code:
 "building43":                {
                    "id": 43,
                    "upgrades": "building36",
"requires" : ["allOf" , ["building2"]],
                    "cost": {
                        "gold": 10000,
                        "ore": 15,
                        "sulfur": 20
                    },
"description" : "Black Tower allows to recruit Red and Black Dragons.",
                    "name" : "Black Tower"
                },

 "building50":                {
                    "id": 50,
                    "mode": "auto",
                     "upgrades":"building43",
                    "cost": {
                        "gold": 10000,
                        "ore": 15,
                        "sulfur": 20
                    },
"description" : "Black Tower allows to recruit Red and Black Dragons.",
                    "name" : "Black Tower"
                }
 


FACTIONS.JSON
Code:
"hallSlots":[[["villageHall","townHall","cityHall","capitol"],["fort","citadel","castle"],["building5"],["building16"]],[["building14","building15"],["building0","building1","building2","building3","building4"],["building21"],["building22"]],[["building17"],["building23"],["building18","building19"]],[["building30","building37"],["building31","building38"],["building32","building39"],["building33","building40"]],[["building34","building41"],["building35","building42"],["building36","building43","building50"]]],

"creatures":[[ "level1","level1Upgrade" ],
[ "level2","level2Upgrade"],
["level3","level3Upgrade"],
["level4","level4Upgrade"],
["level5","level5Upgrade"],
[ "level6","level6Upgrade"],
[ "greenDragon","redDragon","blackDragon" ]],

Macron1 - 2015-08-09, 19:41

Macron1 wrote:
As i can see in sources
https://github.com/vcmi/vcmi/blob/develop/lib/mapObjects/CRewardableConstructor.cpp
JSON configuration for new/modified standard map objects is already implemented.
But there are no examples how how to use these features.
Have someone messed with adding new rewardable objects?
Can help be added to Wiki?


Have no one here experienced modding rewardable objects? :-x

I tried to construct JSON from sources reading on GitHub, I got this object (I tried to recreate full structure of "rewards"), but it don't work (when visiting him on map I got only 1 empty message with OK button.
Where I am wrong?

Code:
{
    //"core:learningStone": {
        "someHistoryMuseum": {
            "handler": "oncePerHero",
            "name": "Museum Level 1",
            "types": {
                "ModernSomeMuseum01": {
                    //"soundID": 1,
                    "resetDuration": 0,
                    "canRefuse": true,
                    "onSelectMessage": "You must pay 200 gold to visit exposition of this museum of history.",
                    "onVisitedMessage": "You already had visited this museum in past and have no time or wish to visit it again.",
                    "onEmptyMessage": "This museum was closed due to budget shorting, and now only wind blows in these walls.",
                    "rewards": [
                        {
                            "dice": 1.0,
                            "appearChance": {
                                "min": 25,
                                "max": 30
                            },
                            "limiter": {
                                //"numOfGrants": 0,
                                //"dayOfWeek": 0,
                                //"minLevel": 1,
                                "resources": {
                                    "gold": 200
                                },
                                //"primary": {
                                    "attack": 0,
                                    "defence": 0,
                                    "spellPower": 0,
                                    "knowledge": 0
                                },
                                //"secondary": {
                                    "necromancy": "basic"
                                },
                                //"artifacts": [
                                   
                                ],
                                //"creatures": [
                                   
                                ],
                               
                            },
                            //"resources": {
                                "gold": 100
                            },
                            "gainedExp": 1000,
                            //"gainedLevels": 0,
                            //"manaPoints": 0,
                            //"manaPercentage": 0,
                            //"movePoints": 0,
                            //"movePercentage": 0,
                            //"primary": {
                                "attack": 0,
                                "defence": 0,
                                "spellPower": 0,
                                "knowledge": 0
                            },
                            //"secondary": {
                                {
                                    "skill": "necromancy",
                                    "level": "basic"
                                }
                            },
                            //"artifacts": [
                               
                            ],
                            //"spells": [
                               
                            ],
                            //"creatures": [
                               
                            ],
                            "message": "You have visited museum exposition, and now your knowledge of the world is getting up.",
                            "selectChance": 60,
                           
                        },
                        {
                            "dice": 1.0,
                            "appearChance": {
                                "min": 25,
                                "max": 30
                            },
                            "limiter": {
                                //"numOfGrants": 0,
                                //"dayOfWeek": 0,
                                //"minLevel": 1,
                                "resources": {
                                    "gold": 200
                                },
                                //"primary": {
                                    "attack": 0,
                                    "defence": 0,
                                    "spellPower": 0,
                                    "knowledge": 0
                                },
                                //"secondary": {
                                    "necromancy": "basic"
                                },
                                //"artifacts": [
                                   
                                ],
                                //"creatures": [
                                   
                                ],
                               
                            },
                            //"resources": {
                                "gold": 100
                            },
                            "gainedExp": 1500,
                            //"gainedLevels": 0,
                            //"manaPoints": 0,
                            //"manaPercentage": 0,
                            //"movePoints": 0,
                            //"movePercentage": 0,
                            //"primary": {
                                "attack": 0,
                                "defence": 0,
                                "spellPower": 0,
                                "knowledge": 0
                            },
                            //"secondary": {
                                "necromancy": "basic"
                            },
                            //"artifacts": [
                               
                            ],
                            //"spells": [
                               
                            ],
                            //"creatures": [
                               
                            ],
                            "message": "You have visited museum exposition, and now your knowledge of the world is getting up.",
                            "selectChance": 60,
                           
                        },
                        {
                            "dice": 1.0,
                            "appearChance": {
                                "min": 25,
                                "max": 30
                            },
                            "limiter": {
                                //"numOfGrants": 0,
                                //"dayOfWeek": 0,
                                //"minLevel": 1,
                                "resources": {
                                    "gold": 200
                                },
                                //"primary": {
                                    "attack": 0,
                                    "defence": 0,
                                    "spellPower": 0,
                                    "knowledge": 0
                                },
                                //"secondary": {
                                    "necromancy": "basic"
                                },
                                //"artifacts": [
                                   
                                ],
                                //"creatures": [
                                   
                                ],
                               
                            },
                            //"resources": {
                                "gold": 100
                            },
                            "gainedExp": 1200,
                            //"gainedLevels": 0,
                            //"manaPoints": 0,
                            //"manaPercentage": 0,
                            //"movePoints": 0,
                            //"movePercentage": 0,
                            //"primary": {
                                "attack": 0,
                                "defence": 0,
                                "spellPower": 0,
                                "knowledge": 0
                            },
                            //"secondary": {
                                "necromancy": "basic"
                            },
                            //"artifacts": [
                               
                            ],
                            //"spells": [
                               
                            ],
                            //"creatures": [
                               
                            ],
                            "message": "You have visited museum exposition, and now your knowledge of the world is getting up.",
                            "selectChance": 60,
                           
                        },
                        {
                            "dice": 1.0,
                            "appearChance": {
                                "min": 25,
                                "max": 30
                            },
                            "limiter": {
                                //"numOfGrants": 0,
                                //"dayOfWeek": 0,
                                //"minLevel": 1,
                                "resources": {
                                    "gold": 200
                                },
                                //"primary": {
                                    "attack": 0,
                                    "defence": 0,
                                    "spellPower": 0,
                                    "knowledge": 0
                                },
                                //"secondary": {
                                    "necromancy": "basic"
                                },
                                //"artifacts": [
                                   
                                ],
                                //"creatures": [
                                   
                                ],
                               
                            },
                            //"resources": {
                                "gold": 100
                            },
                            "gainedExp": 800,
                            //"gainedLevels": 0,
                            //"manaPoints": 0,
                            //"manaPercentage": 0,
                            //"movePoints": 0,
                            //"movePercentage": 0,
                            //"primary": {
                                "attack": 0,
                                "defence": 0,
                                "spellPower": 0,
                                "knowledge": 0
                            },
                            //"secondary": {
                                "necromancy": "basic"
                            },
                            //"artifacts": [
                               
                            ],
                            //"spells": [
                               
                            ],
                            //"creatures": [
                               
                            ],
                            "message": "You have visited museum exposition, and now your knowledge of the world is getting up.",
                            "selectChance": 60,
                           
                        },
                       
                    ],
                    "name": "Museum Level 1",
                    "rmg": {
                        "zoneLimit": 3333,
                        "value": 500,
                        "rarity": 80
                    },
                    "templates": {
                        "138F": {
                            "animation": "test/objects/someMuseum/138F",
                            "visitableFrom": [
                                "---",
                                "+++",
                                "+++"
                            ],
                            "mask": [
                                "VVVVVV",
                                "BBBBBV",
                                "BBBBBB",
                                "VABBVV"
                            ],
                            "allowedTerrains": [
                                "grass",
                                "rough",
                                "dirt"
                            ]
                        },
                       
                    },
                   
                },
               
            }
        }
    }

Warmonger - 2015-08-09, 20:57

I don't think these are implemented yet.
AVS - 2015-08-09, 22:07

Macron1 wrote:

Where I am wrong?


At first please provide valid json file. Also please remove commented junk.

Macron1 - 2015-08-10, 09:20

AVS wrote:
Macron1 wrote:

Where I am wrong?


At first please provide valid json file. Also please remove commented junk.


It's not commented junk. It's constructor of possible values object can have (to uncomment needed fields and make use in next object):-)


Cleared it with help of jsonlint.com:
Code:
{
    "someHistoryMuseum": {
        "handler": "oncePerHero",
        "name": "Museum Level 1",
        "types": {
            "ModernSomeMuseum01": {
                "resetDuration": 0,
                "canRefuse": true,
                "onSelectMessage": "You must pay 200 gold to visit exposition of this museum of history.",
                "onVisitedMessage": "You already had visited this museum in past and have no time or wish to visit it again.",
                "onEmptyMessage": "This museum was closed due to budget shorting, and now only wind blows in these walls.",
                "rewards": [
                    {
                        "dice": 1,
                        "appearChance": {
                            "min": 25,
                            "max": 30
                        },
                        "limiter": {
                            "resources": {
                                "gold": 200
                            }
                        },
                        "gainedExp": 1000,
                        "message": "You have visited museum exposition, and now your knowledge of the world is getting up.",
                        "selectChance": 60
                    },
                    {
                        "dice": 1,
                        "appearChance": {
                            "min": 25,
                            "max": 30
                        },
                        "limiter": {
                            "resources": {
                                "gold": 200
                            }
                        },
                        "gainedExp": 1700,
                        "message": "You have visited museum exposition, and now your knowledge of the world is getting up.",
                        "selectChance": 60
                    },
                    {
                        "dice": 1,
                        "appearChance": {
                            "min": 25,
                            "max": 30
                        },
                        "limiter": {
                            "resources": {
                                "gold": 200
                            }
                        },
                        "gainedExp": 1300,
                        "message": "You have visited museum exposition, and now your knowledge of the world is getting up.",
                        "selectChance": 60
                    },
                    {
                        "dice": 1,
                        "appearChance": {
                            "min": 25,
                            "max": 30
                        },
                        "limiter": {
                            "resources": {
                                "gold": 200
                            }
                        },
                        "gainedExp": 1500,
                        "message": "You have visited museum exposition, and now your knowledge of the world is getting up.",
                        "selectChance": 60
                    }
                ],
                "name": "Museum Level 1",
                "rmg": {
                    "zoneLimit": 3333,
                    "value": 500,
                    "rarity": 80
                },
                "templates": {
                    "138F": {
                        "animation": "test/objects/someMuseum/138F",
                        "visitableFrom": [
                            "---",
                            "+++",
                            "+++"
                        ],
                        "mask": [
                            "VVVVVV",
                            "BBBBBV",
                            "BBBBBB",
                            "VABBVV"
                        ],
                        "allowedTerrains": [
                            "grass",
                            "rough",
                            "dirt"
                        ]
                    }
                }
            }
        }
    }
}

AVS - 2015-08-10, 11:16

Macron1 wrote:

Where I am wrong?

Code:
{
{
"dice": 1,
"appearChance": {
"min": 25,
"max": 30
},

}

You have same dice range 25-30 on all rewards - this means that you have 5% chance to get all rewards, and 95% to get nothing.

Warmonger - 2015-08-10, 11:33

Hmm, IMO the range should be just set as absolute value and their total should be calculated by engine - not neccessarily sum up to 100%.
Macron1 - 2015-08-10, 14:55

AVS wrote:
Macron1 wrote:

Where I am wrong?

Code:
{
{
"dice": 1,
"appearChance": {
"min": 25,
"max": 30
},

}

You have same dice range 25-30 on all rewards - this means that you have 5% chance to get all rewards, and 95% to get nothing.


What dice should i set to get minimum 25% chance?

AVS - 2015-08-10, 15:52

Macron1 wrote:

What dice should i set to get minimum 25% chance?


If you want 4 rewards with 25% probability each (only 1 reward at time), set "dice": 1 for all and min-max to 0-25, 26-50 etc.
Or you may set different "dice" and identical chance 0-25, then you get 25% chance for each reward independently.

AVS - 2015-08-10, 15:53

Warmonger wrote:
Hmm, IMO the range should be just set as absolute value and their total should be calculated by engine - not neccessarily sum up to 100%.


I didn`t say anything about sum

Warmonger - 2015-08-10, 18:57

AVS wrote:
Warmonger wrote:
Hmm, IMO the range should be just set as absolute value and their total should be calculated by engine - not neccessarily sum up to 100%.


I didn`t say anything about sum

Yes, but currently user is asked to calculate incremental sum on his own. So if you decide to change one value, you need to change another accordingly.

AVS - 2015-08-10, 21:22

Warmonger wrote:
AVS wrote:
Warmonger wrote:
Hmm, IMO the range should be just set as absolute value and their total should be calculated by engine - not neccessarily sum up to 100%.


I didn`t say anything about sum

Yes, but currently user is asked to calculate incremental sum on his own. So if you decide to change one value, you need to change another accordingly.

Thanks for explanation. This idea requires think over more. One question is how to define "empty" reward: explicitly for each dice? Or leave sum hardcoded to 100 and only change range to probability.

Macron1 - 2015-10-29, 19:12

Wanted to play with UI elements in adventure map window.
I tried to make minimap in down left corner of window.
Minimap steel border is made like def (gemUL.def),
but still adventure map overlaps minimap. Seems like first minimap is drawn, then adventure map.
Is it possible to make minimap drawn after adventure map? Or it it by design and cannot be fixed?

Macron1 - 2015-11-12, 20:19

Interesting, what will be, if composite artifact is made with one of components "grail".
Will it be possible than to place several grails in form of composite artifacts giving chance to disassemble them and build grail structures?

SXX - 2015-11-12, 21:58

Macron1 wrote:
Will it be possible than to place several grails in form of composite artifacts giving chance to disassemble them and build grail structures?
There only one problem with that. Currently grail handling bases on ArtifactID::GRAIL (2) and artifacts don't support subId. Otherwise it's would work just fine if you allow to put grail into MISC slot as I think combined artifacts can only be disassembled when on hero.

So you can make grail part of combined artifacts right now, but each such artifact can only contain one grail.

misiokles - 2015-11-21, 21:08

Where I can found list of all town buildings id's? Studying building json files I can see:
"requires" :
[ "allOf", ["dwellingLvl1"], ["dwellingLvl2"], ["dwellingLvl3"] ],
"id" : 34

but do not know what id:34 means...

AVS - 2015-11-21, 21:30

Building identifier is name of entire Object field

"dwellingLvl5": { "id" : 34, "requires" : [ "allOf", [ "mageGuild1" ], [ "dwellingLvl4" ] ] },

dwellingLvl5 is the id, numeric id is VCMI internal (also do not use it in any mod)

misiokles - 2015-11-21, 21:37

Bad to hear that :( For example, I want in my planned mod that one of town's building function as a artefact merchant and I want rewrite json file to do that. And now I don't know how :(
SXX - 2015-11-22, 08:15

misiokles wrote:
Bad to hear that :( For example, I want in my planned mod that one of town's building function as a artefact merchant and I want rewrite json file to do that. And now I don't know how :(
Look at how it's made in other town mods for VCMI, e.g Cove in HotA adoption.
Macron1 - 2015-11-22, 10:04

misiokles wrote:
Bad to hear that :( For example, I want in my planned mod that one of town's building function as a artefact merchant and I want rewrite json file to do that. And now I don't know how :(


Special buildings functionalities in mod towns are not implemented. It will be so until script language is implemented and modders could program special buildings functionality.

Kantor - 2016-01-01, 21:31

I'm wondering how 'darkness' bonus works, does it work like in WoG, so any hero with this specialization will create FoW around him step by step, or this is more complicated than I think?
SXX - 2016-01-02, 04:41

Kantor wrote:
I'm wondering how 'darkness' bonus works, does it work like in WoG, so any hero with this specialization will create FoW around him step by step, or this is more complicated than I think?
Unfortunately currently it's only implemented for towns, but fog of war need bug fixes and massive rework anyway so eventually it's should work for any objects that may have bonuses.

Though I'm don't sure if I like the idea if FoW going to be updated after each hero step on map. It's may be more reasonable to update it on end of day as otherwise constant FoW change will cause issues with AI. E.g once AI get some map memory or complex deduction (like understanding where enemy hero likely stand) then we can implement more complex FoW.

Kantor - 2016-01-02, 22:42

SXX wrote:
Though I'm don't sure if I like the idea if FoW going to be updated after each hero step on map. It's may be more reasonable to update it on end of day as otherwise constant FoW change will cause issues with AI. E.g once AI get some map memory or complex deduction (like understanding where enemy hero likely stand) then we can implement more complex FoW.


So you're proposing this solution, which seems fine for AI, but what about human player, will it be possible to implement it in such way in which human player would see changing FoW during enemy hero move?

misiokles - 2016-04-06, 18:49

How can I replace battlefields images? For example - I want to replace CmBkGrTr.pcx file with three another pcx's for display them randomly during battle on the grass?
Warmonger - 2016-04-06, 19:36

misiokles wrote:
How can I replace battlefields images? For example - I want to replace CmBkGrTr.pcx file with three another pcx's for display them randomly during battle on the grass?

Macron1 once offered to implement battlefield support, but since then nothing happened. It's open feature. Certainly we would like to have handling for different battlefields.

AVS - 2016-04-06, 19:43

misiokles wrote:
How can I replace battlefields images? For example - I want to replace CmBkGrTr.pcx file with three another pcx's for display them randomly during battle on the grass?


This is incomplete feature, (image is selected randomly but there is no way to add more than one).

misiokles - 2016-04-09, 11:32

How can I add to particular heroes First Aid Tent and Ammo Cart at start (like starting army?)

Code:
"army" :
[
"creature" : "firstAidTent"
]



doesn't work :[

And is it possible to make heroe's speciality to summon specyfic creature at the beggining of the battle?

Code:
        "specialty":
        [
            {
                "growsWithLevel" : true,
                "bonuses":
                [
                    {
                    "type" : "DAEMON_SUMMONING",
                    "subtype" : "creature.centaur",
                    "val" : 20
                    }

This doesn't work either...

misiokles - 2016-04-09, 14:25

I tried to find diffirent way to summon creatures during battles. I've made a new creature and coded it propertly. It's called MyCreature. Next I wanted to write a unique spell working like DEAMON_SUMMONING but instead of summoning Demons summons MyCreature. And to finish, this spell was written as starting spell in my hero spellbook.
Here the code:

Code:
{
    "summonTreebeard":
    {
        "type": "combat",
        "targetType": "NO_TARGET",
        "name": "Summon MyCreature",
        "school":
        {
            "air": false,
            "earth": true, // for example
            "fire": false,
            "water": false
        },
        "level": 5, //not revelant for now
        "power": 10,       
        "defaultGainChance": 0, //I do'nt want this spell to appear in Mage Guilds
        "animation":{
        "affect":["<path to DEF file of spell animation>"]
        },
 
        "flags" : {"rising": true}, //it is correct? flag 'summoning' is marked as TODO
        "graphics": //placeholder graphics
        {
            "iconBook": "spells/catReflexes_iconBook.bmp",
            "iconScroll": "spells/catReflexes_iconScroll.bmp",
            "iconScenarioBonus": "spells/catReflexes_iconScenarioBonus.bmp",
            "iconEffect": "spells/catReflexes_iconEffect.bmp"
        },

    "sounds":
        {
            "cast":"SUMNELM"
        },
        "levels":
        {
            "none":
            {
                "description": "Summon My Creature.",
                "cost": 0, //spell is free because is my hero unique speciality
                "power": 10,
                "aiValue": 15, //I have no idea what is proper aiValue here
                "range": "X", //is it correct?
                "targetModifier":{"smart":true},    //is is correct?
                "effects":
                {
                    "mycreatureSummoning" : {
                        "type" : "DAEMON_SUMMONING",
                        "subType" : "myCreature",
                        "val" : 20
                    }
                }
            },
            "basic":
            {
// ... and so on..               


But spell doesn't work, console says that:
Code:


Error: Unknown entry found: subType
At /levels/none/effects/myCreatureSummoning
Error: Unknown entry found: subType

At <root>
Error: Required entry gainChance is missing


What I have to do to make spell who summon MyCreature insted of Demon? Or what I have to do to summon MyCreature like Elementals?[/code]

AVS - 2016-04-09, 15:44

misiokles wrote:
a unique spell working like DEAMON_SUMMONING but instead of summoning Demons summons MyCreature.


Custom summoning is not implemented, also DEAMON_SUMMONING is not actually a spell.

misiokles - 2016-04-09, 16:21

Yeap, but I thought this trick would work. Like giving WHIRPOOL_PROTECTION bonus to creature, not artifact (travel through whirpools with creatures with this 'ability' work, but after that game has odd behaviour :))

And what about setting First Aid Tent and AmmoCart at start? Is it possible?

Macron1 - 2016-04-09, 16:51

misiokles wrote:
How can I add to particular heroes First Aid Tent and Ammo Cart at start (like starting army?)
Code:
Code:
"army" :
[
"creature" : "firstAidTent"
]


doesn't work :[



Try
Code:

"army":
[

.... first 1-3 slots ...

            {
                "creature" : "firstAidTent",
                "max" : 1,
                "min" : 1
            },
]

misiokles - 2016-04-09, 18:14

Doesn't work too :( It's dead end, I think, because from viki:

Code:
"army" :
    [
        // First always available stack
        {
            // Identifier of creature in this stack
            "creature" : "mage",
 
            // Minimal and maximum size of stack. [b]Size will be
            // determined randomly at the start of the game[/b]
            "max" : 2,
            "min" : 1
        },
        [b]// Second stack has 90 % chance to appear[/b]
        {
            "creature" : "archmage",
            "max" : 1,
            "min" : 1
        },
        [b]// Third stack with just 20 % chance to appear[/b]
        {
            "creature" : "mage",
            "max" : 2,
            "min" : 1
        }
    ]

Macron1 - 2016-04-09, 21:24

Try to put it first.

I tested it on Christian,
gave him
Code:

        "army" :
        [
                    {
                "creature" : "firstAidTent",
                "max" : 1,
                "min" : 1
            },
            {
                "creature" : "masterGenie",
                "max" : 100,
                "min" : 70
            },
            {
                "creature" : "masterGenie",
                "max" : 900,
                "min" : 900
            },
    //        {
    //            "creature" : "ironGolem",
    //            "max" : 100,
    //            "min" : 70
    //        }
        ],

First Aid Tent appeared in inventory
PS If I make more then 3 army slots. VCMI gives error "number of slots is bigger than 3" and crashes. Why this boundary is set? Maybe someone wants to make hero with 4-7 starting slots and war machines?

misiokles - 2016-04-12, 17:27

I've made a mini-mod called New Siege Creatures. Now Commanders during siege are placed at turrets to shoot at enemy. Mod works fine (it's cool feature ;P) but I noticed game crashes more often than usual at completely diffirent situations not connected to siege. If you have some spare time to test this mod, here it is:
http://www.mediafire.com/...e+Creatures.zip
In this mod, there small test map called ABC1. Just play a map, buy a hero at tavern and conquer nearby enemy towns. Not too fast, use defend button and observe game behaviour...


Quote:

Try
Code:

"army":
[

.... first 1-3 slots ...

            {
                "creature" : "firstAidTent",
                "max" : 1,
                "min" : 1
            },
]

It works! Partially, but works! Thank you!

Warmonger - 2016-04-12, 18:03

misiokles wrote:

And is it possible to make heroe's speciality to summon specyfic creature at the beggining of the battle?

Code:
        "specialty":
        [
            {
                "growsWithLevel" : true,
                "bonuses":
                [
                    {
                    "type" : "DAEMON_SUMMONING",
                    "subtype" : "creature.centaur",
                    "val" : 20
                    }


DAEMON_SUMMONING is Pit Lord's ability, which works ina completely different way. For now there is no ability to summon creatures in battle.
There is a WoG ability and Summon Elementals spell. Witchking even made an artifact that summons 4 elementals at start of teh battle.

Warmonger - 2016-04-12, 18:04

Macron1 wrote:
Try to put it first.

I tested it on Christian,
gave him
Code:

        "army" :
        [
                    {
                "creature" : "firstAidTent",
                "max" : 1,
                "min" : 1
            },
            {
                "creature" : "masterGenie",
                "max" : 100,
                "min" : 70
            },
            {
                "creature" : "masterGenie",
                "max" : 900,
                "min" : 900
            },
    //        {
    //            "creature" : "ironGolem",
    //            "max" : 100,
    //            "min" : 70
    //        }
        ],

First Aid Tent appeared in inventory
PS If I make more then 3 army slots. VCMI gives error "number of slots is bigger than 3" and crashes. Why this boundary is set? Maybe someone wants to make hero with 4-7 starting slots and war machines?


Interesting. I thought it doesn't work altogether, but still there shoudl be idiot-proof way of adding war machines. This should be reported on Mantis.

misiokles - 2016-04-12, 18:37

Quote:

DAEMON_SUMMONING is Pit Lord's ability, which works ina completely different way. For now there is no ability to summon creatures in battle.

Now I know that. I added myCreature ability:
"abilities" :
Code:
        {
            "summonWaterElementals" :
            {
                "type" : "DAEMON_SUMMONING",
                "subtype" : "creature.waterElemental",
                "val" : 50
            },
            "castsAmount" :
            {
                "type" : "CASTS",
                "val" : 1
            }
        }

MyCreature during battle can raise (for example) Water Elementals from dead bodies. That's cool. I though this trick would be applied to hero speciality somehow!

By the way - I found interesting..hm... exploit!
I gave myCreature whirpool_protection ability:
Code:
"abilities" :
        {
            "whirlpoolProtection" :
            {
                "type" : "WHIRLPOOL_PROTECTION",
                "propagator" : "HERO"
            }


IT SHOULD NOT WORK, because whirpool_protection is artifact ability, not creature! But... it works! Almost. Having such creature in army, hero is able safely travel through whirpools. Unfortunatelly, game crashes after trying to get out of the whirpools :( Can this exploit be fixed?

Warmonger - 2016-04-12, 20:25

Quote:
IT SHOULD NOT WORK, because whirpool_protection is artifact ability, not creature! But... it works!

Of course it works, this is exactly what HERO propagator is for (Nomads, Rogues for example).

Quote:
Unfortunatelly, game crashes after trying to get out of the whirpools :( Can this exploit be fixed?

Game should never crash, needs bug report.

misiokles - 2016-05-08, 18:24

What ALWAYS_MINIMUM_DAMAGE exactly means? What creature has this ability to learn how formula works on example?
Code:
 ALWAYS_MINIMUM_DAMAGE

unit does its minimum damage from range

    subtype: -1 - any attack, 0 - melee, 1 - ranged
    value: additional damage penalty (it'll subtracted from dmg)
    additional info - multiplicative anti-bonus for dmg in % [eg 20 means that creature will inflict 80% of normal minimal dmg]

AVS - 2016-05-08, 23:07

ALWAYS_MINIMUM_DAMAGE bonus is basically Curse spell and does not make sense as creature ability.
zmudziak22 - 2016-05-17, 13:24

Isn't work like range penalty?
Kantor - 2016-05-17, 13:44

Do VCMI rmg templates support "density" option for mines, neutral and player towns?
IIRC "density" allows to set maximum amount of sth to be generated in zone if fixed amount isn't specified.

misiokles - 2016-05-17, 16:52

AVS wrote:
ALWAYS_MINIMUM_DAMAGE bonus is basically Curse spell and does not make sense as creature ability.

zmudziak22 wrote:
Isn't work like range penalty?

I've thought that this ability causes always minimum damage to the creature who attack my creature with this ability.

Warmonger - 2016-05-17, 18:57

ALWAYS_MINIMUM_DAMAGE is the effect of Curse, which is opposite of ALWAYS_MAXIMUM_DAMAGE (Bless).
misiokles - 2016-06-09, 21:09

I want to give my creature 'shackles of war' ability. Having these neutral creatures in army, battle prevents hero to escape. So I wrote:
Code:
"enemyCantEscape" :
            {
                "type" : "ENEMY_CANT_ESCAPE",
                "propagator" : "BATTLE_WIDE"
            }

or
Code:
"enemyCantEscape" :
            {
                "type" : "ENEMY_CANT_ESCAPE",
                "propagator" : "HERO"
            }


console says that: Error: invalid ability type ENEMY_CANT_ESCAPE

Is any trick to do give creature this artifact's ability?

Warmonger - 2016-06-09, 21:34

The bonus for Shackles Of War is called BATTLE_NO_FLEEING. Will fix Wiki.
misiokles - 2016-06-09, 22:16

Oh, man. It works like hell with propagator BATTLE_WIDE (icon retreat is inactive)!

So one more question. Is any way to show such exotic abillities in creature window? In creature format there's no info about code to add new pcx and new infos...

Warmonger - 2016-06-10, 17:06

Quote:
Is any way to show such exotic abillities in creature window?

Not really. Some info can be added via config\bonuses_texts.json, but images are more complicated.

Also keep in mind that orginal hero / artifacts bonuses would look odd on creatures.

misiokles - 2016-06-10, 19:40

I keep in mind. But giving neutral creatures such odd abilities I want to make battles with them more interesting/challenging and worth considering to hire them to the army. Some results you'll see for few weeks, I hope:)
misiokles - 2016-08-29, 17:14

Command "dice" - in what purposes I can use it? I can't see any 'manual' for it...
Warmonger - 2016-08-29, 18:33

misiokles wrote:
Command "dice" - in what purposes I can use it? I can't see any 'manual' for it...

In what context?

misiokles - 2016-08-29, 20:08

Er... my english :(
I ask in which contexts dice can be used and how this formula works.

SXX - 2016-08-29, 21:24

It's only used here, but I not exactly understand if this code actually doing anything:
https://github.com/vcmi/vcmi/blob/develop/lib/mapObjects/CRewardableConstructor.cpp#L51

AVS - 2016-08-29, 23:53

misiokles wrote:
Er... my english :(
I ask in which contexts dice can be used and how this formula works.


1) Two rewards with same "dice" have same random value. This allows to create mutually exclusive and independent rewards.
2) It is not used in any objects configuration yet.
3) for now it actually may be used in mods _only_ for _new_ map objects for vcmi map format.

misiokles - 2016-09-01, 22:11

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...
Like this:
Code:
{
    "core:creatureBank" : {
        "types" : {

            "core:shipwreck" : {
                "levels": [
                    {
                        "chance": 25,
                        "guards": [
                            { "amount": 5, "type": "abyssSandCrab" },
                            { "amount": 5, "type": "abyssAbyssalCrab" },
                            { "amount": 5, "type": "abyssAbyssalCrab" },
                            { "amount": 5, "type": "abyssSandCrab" },
                            { "amount": 5, "type": "abyssAbyssalCrab" }
                        ],
                        "combat_value": 31,
                        "reward" : {
                            "value": 2000,
                            "resources":
                            {
                                "gold" : 2000
                            }
                        }
                    },


Or this:
Code:
{
    "core:creatureBank" : {
        "types" : {

            "shipwreck" : {
                "levels": [
                    {
                        "chance": 25,
                        "guards": [
                            { "amount": 5, "type": "abyssSandCrab" },
                            { "amount": 5, "type": "abyssAbyssalCrab" },
                            { "amount": 5, "type": "abyssAbyssalCrab" },
                            { "amount": 5, "type": "abyssSandCrab" },
                            { "amount": 5, "type": "abyssAbyssalCrab" }
                        ],
                        "combat_value": 31,
                        "reward" : {
                            "value": 2000,
                            "resources":
                            {
                                "gold" : 2000
                            }
                        }
                    },


Or this:

Code:
{
    "creatureBank" : {
        "types" : {

            "core:shipwreck" : {
                "levels": [
                    {
                        "chance": 25,
                        "guards": [
                            { "amount": 5, "type": "abyssSandCrab" },
                            { "amount": 5, "type": "abyssAbyssalCrab" },
                            { "amount": 5, "type": "abyssAbyssalCrab" },
                            { "amount": 5, "type": "abyssSandCrab" },
                            { "amount": 5, "type": "abyssAbyssalCrab" }
                        ],
                        "combat_value": 31,
                        "reward" : {
                            "value": 2000,
                            "resources":
                            {
                                "gold" : 2000
                            }
                        }
                    },

I'm lack of ideas...

Macron1 - 2016-09-01, 22:48

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

AVS - 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 - 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" }

misiokles - 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 - 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"
                        }]

                    }
                }]
            },
}

misiokles - 2016-09-02, 08:23

You are right. Now, shiwrecks work as intended. Thank you gorgously :)
Andrettin - 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 - 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 - 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.

Andrettin - 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 - 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:-)

misiokles - 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 - 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 - 2016-10-28, 08:00

Doesn't work either :(
SXX - 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 - 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?

Warmonger - 2017-03-25, 10:28

Macron1 wrote:
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?

No. Immunity for Vision is never checked.

AVS - 2017-03-26, 05:24

Macron1 wrote:
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?

No immunities do not work on adventure spells.

misiokles - 2017-05-18, 09:10

I wanted to introduce HotA's Warehouses into VCMI. So I've written code:

Code:
{
    "warehouses" :{   
        "name": "Warehouses",
        "handler": "oncePerWeek",
        "types" : {
            "crystalWarehouse" : {
                "name": "Warehouse of Crystal",
                "producedResources" : "crystal",
                "producedValue" : 6,
                "rmg" : {
                    "value"        : 500,
                    "rarity"    : 70
                },
                "templates" : {
                    "avwrhscr" : { "animation" : "avwrhscr",
                    "visitableFrom" : [ "---", "+++", "+++" ],
                    "mask" : ["0VV","VVV","VBA"],
//                    "allowedTerrains": ["sand"]
                    }                   
                }
            }           
        }   
    }
}


In random maps object appears, can be visited but doesn't produce anything... Any ideas what is wrong?

Warmonger - 2017-05-18, 09:34

Nothing is wrong, adding objects with new properties is not supported.
misiokles - 2017-05-18, 19:25

But I suggested the example from wiki:
http://wiki.vcmi.eu/index...ect_type_format

In town section code "produce" is working, so I thought that "producedResources" and "producedValue" work too...

AVS - 2017-05-19, 05:04

misiokles wrote:
But I suggested the example from wiki:
http://wiki.vcmi.eu/index...ect_type_format

In town section code "produce" is working, so I thought that "producedResources" and "producedValue" work too...


Handler "oncePerWeek" has no configuration. It used only for MYSTICAL_GARDEN, WINDMILL, WATER_WHEEL

For new objects please try to use "configurable" handler, it is undocumented though.

AVS - 2017-05-19, 05:11

The code located here: https://github.com/vcmi/vcmi/blob/develop/lib/mapObjects/CRewardableConstructor.cpp#L47
Warmonger - 2017-05-19, 07:17

Keep in mind that someday this code might be finished, refactored and current not-supported mods might stop working.
misiokles - 2017-05-19, 08:22

Noted that, thank you both guys!
misiokles - 2017-05-30, 18:43

Hi again!
I've found over the net a pack with new custom boat sprites. I've wanted to make mod that adds these sprites to the 'core' of existing boat graphics and allow game to randomly choose these ones in the moment of buiyng. So I've wriiten such code:
Code:
{
    "core:boat" : {
        "base" : {
            "base" : {
                "visitableFrom" : [ "+++", "+-+", "+++" ],
                "mask" : [ "VVV", "VAV" ]
            }
        },
        "types" : {
            "evil" : {
                "templates" : {
                    "AB01_.def" :
                    { "animation" : "AB01_.def", //original h3 evil def
                      "editorAnimation": "avxboat0.def"
                    },
                    "boat07.def" :
                    { "animation" : "boat07.def",
                      "editorAnimation": "boat07ed.def"
                    },
                    "boat10.def" :
                    { "animation" : "boat10.def",
                      "editorAnimation": "boat10ed.def"
                    },
                    "boat11.def" :
                    { "animation" : "boat11.def",
                      "editorAnimation": "boat11ed.def"
                    },
                    "boat20.def" :
                    { "animation" : "boat20.def",
                      "editorAnimation": "boat20ed.def"
                    },
                    "boat0a.def" :
                    { "animation" : "boat0a.def",
                      "editorAnimation": "boat0aed.def"
                    },
                    "boat0c.def" :
                    { "animation" : "boat0c.def",
                      "editorAnimation": "boat0ced.def"
                    },
                    "boat0f.def" :
                    { "animation" : "boat0f.def",
                      "editorAnimation": "boat0fed.def"
                    },
                    "boat0l.def" :
                    { "animation" : "boat0l.def",
                      "editorAnimation": "boat0led.def"
                    }   
                }
            },   
            "good" : {
                "templates" : {
                    "AB02_.def" :
                    { "animation" : "AB02_.def", //original h3 good def
                      "editorAnimation": "avxboat1.def"
                    },
                    "boat00.def" :
                    { "animation" : "boat00.def",
                      "editorAnimation": "boat00ed.def"
                    },
                    "boat01.def" :
                    { "animation" : "boat01.def",
                      "editorAnimation": "boat01ed.def"
                    },
                    "boat02.def" :
                    { "animation" : "boat02.def",
                      "editorAnimation": "boat02ed.def"
                    },
                    "boat04.def" :
                    { "animation" : "boat04.def",
                      "editorAnimation": "boat04ed.def"
                    },
                    "boat06.def" :
                    { "animation" : "boat06.def",
                      "editorAnimation": "boat06ed.def"
                    },
                    "boat09.def" :
                    { "animation" : "boat09.def",
                      "editorAnimation": "boat09ed.def"
                    },
                    "boat0i.def" :
                    { "animation" : "boat0i.def",
                      "editorAnimation": "boat0ied.def"
                    },
                    "boat0j.def" :
                    { "animation" : "boat0j.def",
                      "editorAnimation": "boat0jed.def"
                    },
                    "boat0m.def" :
                    { "animation" : "boat0m.def",
                      "editorAnimation": "boat0med.def"
                    }
                }
            },   
            "neutral" : {
                "templates" : {
                    "AB03_.def" :
                    { "animation" : "AB03_.def", //original h3 neutral def
                      "editorAnimation": "avxboat2.def"
                    },
                    "boat03.def" :
                    { "animation" : "boat03.def",
                      "editorAnimation": "boat03ed.def"
                    },
                    "boat05.def" :
                    { "animation" : "boat05.def",
                      "editorAnimation": "boat05ed.def"
                    },
                    "boat08.def" :
                    { "animation" : "boat08.def",
                      "editorAnimation": "boat08ed.def"
                    },
                    "boat0b.def" :
                    { "animation" : "boat0b.def",
                      "editorAnimation": "boat0bed.def"
                    },
                    "boat0d.def" :
                    { "animation" : "boat0d.def",
                      "editorAnimation": "boat0ded.def"
                    },
                    "boat0e.def" :
                    { "animation" : "boat0e.def",
                      "editorAnimation": "boat0eed.def"
                    },
                    "boat0g.def" :
                    { "animation" : "boat0g.def",
                      "editorAnimation": "boat0ged.def"
                    },
                    "boat0h.def" :
                    { "animation" : "boat0h.def",
                      "editorAnimation": "boat0hed.def"
                    },
                    "boat0k.def" :
                    { "animation" : "boat0k.def",
                      "editorAnimation": "boat0ked.def"
                    }                   
                }
            }   
        }
    }
}

New sprites appear in the editor map (see screenshot) but in game there aren't any changes - when I buy the boat - standard h3 defs are show :( Did not I understand what is "template" command for?
:(

Warmonger - 2017-05-30, 20:15

Boat type for Shipyard is hardcoded and can't be changed via config.
misiokles - 2017-05-31, 19:42

Oh, too bad...
So let this mod can be treated as map editor plugin and in the future let mapmakers put these sprites on their maps :)
http://www.mediafire.com/...prites_v1.0.zip

misiokles - 2017-06-08, 20:25

Hm.. I've made another mod, which doesn't work and I don't know why :(
Some time ago, J.M.Sower made Castle graphic depending on terrain.




Because VCMI can allow spawning objects depends on terrain type so I wrote a code:
Code:
{
    "core:castle" :
    {
        "town" :
        {
            "mapObject" :
            {
                "castle" : {
                    "templates" : 
                        {
                            "dirt" :
                                {
                                    "animation" : "castle-dirt/dirtCastleCastle.def",
                                    "allowedTerrains": [ "dirt" ]
                                },
                            "snow" :
                                {
                                    "animation" : "castle-snow/snowCastleCastle.def",
                                    "allowedTerrains": [ "snow" ]
                                },
                            "grass" :
                                {
                                    "animation" : "castle-grass/grassCastleCastle.def",
                                    "allowedTerrains": [ "grass" ]
                                },
                            "lava" :
                                {
                                    "animation" : "castle-lava/lavaCastleCastle.def",
                                    "allowedTerrains": [ "lava" ]
                                },
                            "rough" :
                                {
                                    "animation" : "castle-rough/roughCastleCastle.def",
                                    "allowedTerrains": [ "rough" ]
                                },
                            "sand" :
                                {
                                    "animation" : "castle-sand/sandCastleCastle.def",
                                    "allowedTerrains": [ "sand" ]
                                },
                            "subterra" :
                                {
                                    "animation" : "castle-subterra/subterraCastleCastle.def",
                                    "allowedTerrains": [ "subterra" ]
                                },
                            "swamp" :
                                {
                                    "animation" : "castle-swamp/swampCastleCastle.def",
                                    "allowedTerrains": [ "swamp" ]
                                }
                        }
                    },   
                "citadel" : {
                    "templates" :
                        {
                            "dirt" :
                                {
                                    "animation" : "castle-dirt/dirtCastleCitadel.def",
                                    "allowedTerrains": [ "dirt" ]
                                },
                            "snow" :
                                {
                                    "animation" : "castle-snow/snowCastleCitadel.def",
                                    "allowedTerrains": [ "snow" ]
                                },
                            "grass" :
                                {
                                    "animation" : "castle-grass/grassCastleCitadel.def",
                                    "allowedTerrains": [ "grass" ]
                                },
                            "lava" :
                                {
                                    "animation" : "castle-lava/lavaCastleCitadel.def",
                                    "allowedTerrains": [ "lava" ]
                                },
                            "rough" :
                                {
                                    "animation" : "castle-rough/roughCastleCitadel.def",
                                    "allowedTerrains": [ "rough" ]
                                },
                            "sand" :
                                {
                                    "animation" : "castle-sand/sandCastleCitadel.def",
                                    "allowedTerrains": [ "sand" ]
                                },
                            "subterra" :
                                {
                                    "animation" : "castle-subterra/subterraCastleCitadel.def",
                                    "allowedTerrains": [ "subterra" ]
                                },
                            "swamp" :
                                {
                                    "animation" : "castle-swamp/swampCastleCitadel.def",
                                    "allowedTerrains": [ "swamp" ]
                                }
                        }
                    },   
                "fort" : {
                    "templates" : 
                        {
                        "dirt" :
                                {
                                    "animation" : "castle-dirt/dirtCastleFort.def",
                                    "allowedTerrains": [ "dirt" ]
                                },
                            "snow" :
                                {
                                    "animation" : "castle-snow/snowCastleFort.def",
                                    "allowedTerrains": [ "snow" ]
                                },
                            "grass" :
                                {
                                    "animation" : "castle-grass/grassCastleFort.def",
                                    "allowedTerrains": [ "grass" ]
                                },
                            "lava" :
                                {
                                    "animation" : "castle-lava/lavaCastleFort.def",
                                    "allowedTerrains": [ "lava" ]
                                },
                            "rough" :
                                {
                                    "animation" : "castle-rough/roughCastleFort.def",
                                    "allowedTerrains": [ "rough" ]
                                },
                            "sand" :
                                {
                                    "animation" : "castle-sand/sandCastleFort.def",
                                    "allowedTerrains": [ "sand" ]
                                },
                            "subterra" :
                                {
                                    "animation" : "castle-subterra/subterraCastleFort.def",
                                    "allowedTerrains": [ "subterra" ]
                                },
                            "swamp" :
                                {
                                    "animation" : "castle-swamp/swampCastleFort.def",
                                    "allowedTerrains": [ "swamp" ]
                                }
                        }
                    },   
                "village" : {
                    "templates" :
                        {
                        "dirt" :
                                {
                                    "animation" : "castle-dirt/dirtCastleVillage.def",
                                    "allowedTerrains": [ "dirt" ]
                                },
                            "snow" :
                                {
                                    "animation" : "castle-snow/snowCastleVillage.def",
                                    "allowedTerrains": [ "snow" ]
                                },
                            "grass" :
                                {
                                    "animation" : "castle-grass/grassCastleVillage.def",
                                    "allowedTerrains": [ "grass" ]
                                },
                            "lava" :
                                {
                                    "animation" : "castle-lava/lavaCastleVillage.def",
                                    "allowedTerrains": [ "lava" ]
                                },
                            "rough" :
                                {
                                    "animation" : "castle-rough/roughCastleVillage.def",
                                    "allowedTerrains": [ "rough" ]
                                },
                            "sand" :
                                {
                                    "animation" : "castle-sand/sandCastleVillage.def",
                                    "allowedTerrains": [ "sand" ]
                                },
                            "subterra" :
                                {
                                    "animation" : "castle-subterra/subterraCastleVillage.def",
                                    "allowedTerrains": [ "subterra" ]
                                },
                            "swamp" :
                                {
                                    "animation" : "castle-swamp/swampCastleVillage.def",
                                    "allowedTerrains": [ "swamp" ]
                                }
                        }
                    },   
                "capitol" : {
                    "templates" :
                        {
                        "dirt" :
                                {
                                    "animation" : "castle-dirt/dirtCastleCapitol.def",
                                    "allowedTerrains": [ "dirt" ]
                                },
                            "snow" :
                                {
                                    "animation" : "castle-snow/snowCastleCapitol.def",
                                    "allowedTerrains": [ "snow" ]
                                },
                            "grass" :
                                {
                                    "animation" : "castle-grass/grassCastleCapitol.def",
                                    "allowedTerrains": [ "grass" ]
                                },
                            "lava" :
                                {
                                    "animation" : "castle-lava/lavaCastleCapitol.def",
                                    "allowedTerrains": [ "lava" ]
                                },
                            "rough" :
                                {
                                    "animation" : "castle-rough/roughCastleCapitol.def",
                                    "allowedTerrains": [ "rough" ]
                                },
                            "sand" :
                                {
                                    "animation" : "castle-sand/sandCastleCapitol.def",
                                    "allowedTerrains": [ "sand" ]
                                },
                            "subterra" :
                                {
                                    "animation" : "castle-subterra/subterraCastleCapitol.def",
                                    "allowedTerrains": [ "subterra" ]
                                },
                            "swamp" :
                                {
                                    "animation" : "castle-swamp/swampCastleCapitol.def",
                                    "allowedTerrains": [ "swamp" ]
                                }
                        }
                }   
           
            }
        }
    }
}


Aim was to generate diffirent Castle defs at particular terrains in random maps. But... mod doesn't work :(
Castle always is set with standard grass base and defs aren't placed in map editor.
Maybe someone skilled will look at my mod in free time...
http://www53.zippyshare.com/v/iM4b7ZuS/file.html


Powered by phpBB modified by Przemo © 2003 phpBB Group