Working on a custom town and need some help with buildings

Ok so i’ve been learning the ropes by porting over a heroes 2 town to vcmi and so far i’ve got just about everything done. The one thing that’s kicking my arse is making a building give you certain things. Like how do i tell the game to increase centaur production by 8 when i make a water fall or to give 250 gold a day when i build a well. I’ve searched and found things like “provides” : { “gold” : 250 }, that should be working but i can’t seem to figure out where i’m supposed to plug that line. I was thinking it was in the buildings file in where you put the name cost and description of thing but it doesn’t seem to be doing anything. Thank you for your time and here are some screen shots =).




First - I hope you’re aware of Succession Wars mod? They also working on porting H2 to H3 engine. You may want to contact them to avoid duplicating all work.

As of now most of town building functions are still hardcoded and based on ID, e.g. building with id = 0 is always mages guild 1, shipyard always have ID 6 and so on. For objects that give bonus to creatures you can use buildings #18 and #24 - check our own config files or Hota/Cove mod for details on how it looks like.

For objects that produce resources - you’re almost right. Check documentation on our wiki: wiki.vcmi.eu/index.php?title=Tow … lding_node
What you need is entry named “produce”. And yes - it should be placed in the same location as building costs

Ok perfect, that helps me a lot. Yeah Succession wars is awesome and i hope to see it one day hit vcmi. Right now this is just me experimenting with the process using existing mods as a guide/template. Thanks alot for the tips and i’m going to have to ask sucession wars to let me borrow their def files if possible =). I ended up doing all of the building work on my own before noticing what they had made.

Ok so i got the building to spit out the gold which is awesome, but now i’ve hit a snag with the hordes hehe. So the rank 1 creature has “horde” : 8, in it’s json file I’ve got “horde” : 1 ], under the town section and “horde1” has an id of 18. From what i’ve been reading and seeing it should trigger the centaurs to spawn 8 more a week. Sorry this is all new to me and i’m wrapping my head around it. My next question is lets say i want 1 building to give 1 creature +8 growth and then i want another one to give all my creatures +2 is that possible or are you stuck with only the 1 horde line on the creature file.

Yes, that should make your horde functional. Nothing is missing IIRC.

Unfortunately no. As of now you’re limited with 2 hordes, each giving bonus to growth of one creature. You’ll have to wait for somebody from programmers to implement better approach here.

If you want horde for 1 level ceature, you must write “horde” : [0,-1] (level number minus 1)

How’s process going on converting this HMM2 town to VCMI?
PS You can already use 6 levels instead of 7 levels for town. Just leave corresponding ] black in “creatures”: ],],],],],],] ] data.