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

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

Previous topic :: Next topic
Help with town editing
Author Message
VampMarcie 
Vampire Queen


Joined: 26 Nov 2016
Posts: 9
Posted: 2017-04-15, 21:00   Help with town editing

Hi, all.

I am a novice modder but long term (~10 years) HoMM player. I set upon making my own custom town for my own use and not to be released as I am using the MDT Forge as framework. All I have done currently is successfully change creatures using other .def files, create custom creature and town portraits, implement custom creature sounds, and add an extra unit. I face no issues with any of those modifications. The trouble now lies within creating an extra unit to be recruited in the town via a new added building. I converted an adventure map def I found to one without a flag and created an area and border for it. Implementing it into the town.json file worked fine and I edited the Building Menu to accomodate for an extra building slot, which worked. I also created an image to be displayed in the slot, which again worked fine.

Screenshot of Build Menu (Gyazo)

Unfortunately, I can't seem to assign the correct unit to be recruited in the building.

Building it returns an error which is the same in both the console AND in-game:

Error ecountered when building dwelling (bid=44):no creature found (upgrade number 2, level 0!
System message: Server encountered a problem: Error ecountered when building dwelling (bid=44):no creature found (upgrade number 2, level 0!


Clicking on it makes me recruit the Level 1 units (changed from Recruits and Militians to Cultists and Assasins):

Screenshot of Recruitment Screen (Gyazo)

I have no idea how to solve this. I've spent a few hours messing around with the .json file for the unit that I have added - Evil Sorceress (which works fine, it's just trying to get it to be placed in the generator is the issue) -, the town.json file and I even used a text scanning tool to look through the entire \Content\ directory to look for anything that may give me a hint as to how to solve this.

Here is a link to the full .zip file on Dropbox: Dropbox

Key files:
Oblivion Town\content\config\forge\creatures\Lvl8Unit.json
Oblivion Town\content\config\forge\town.json
Oblivion Town\content\sprites\forge\townhall.def

Please do note that I will NOT be releasing this town as it contains content created by the Mod Design Team. This is simply a project I am working on myself to build skill and experience in modding for VCMI. All help is appreciated!

UPDATE 15/4/17 @ 21:17
Proof the unit works in combat with new hero added: Combat Example (Gyazo)

UPDATE 23/5/17 @ 17:13
I got it working! Well, kinda. I left this for a bit but recently downloaded the Amethyst Chinese town and dug around the files. I changed the building ID from 43 or 44 to 50, added a few placeholder spaces in the townhall.def file and I could recruit my Sorceresses! Only issue now is that their building is always built in the town and they are recruited from the Doomknight/Dreadlord Pit (Juggernaut Pit). So glad it's working, just need to see if I can get them to be recruited separately!

See:
https://gyazo.com/0387d246e7cfe73f8166f33a8d331d6d
https://gyazo.com/6b6061a8b4f8577d5880d2b5b43cf7d0

-- Marcie
Last edited by VampMarcie on 2017-05-23, 17:16; edited 3 times in total  
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 168
Posted: 2017-04-16, 10:04   

This could be tricky, or even impossible to build 8th level dwelling.
Every building in townscreen has its own ID. Standard townscreen has 44 IDs. id: 0 is for Mage Guild level 1, id: 16 is for blacksmith, id: 43 is for upgrade level 7 dwelling and so on. But in vcmi there's a algorithm beyond id: 43.
Look:
non upg lvl 1 - id: 30
non upg lvl 2 - id: 31
....
non upg lvl 7 - id: 36
upg lvl 1 - id: 37
upg lvl 2 - id: 38
....
upg lvl 7 - id: 43
and now
second upg lvl 1 - id: 44
second upg lvl 2 - id: 45
...
second upg lvl 4 - id: 47 (like Pirats in Cove)
...
second upg lvl 7 - id: 50
and next
third upgrade lvl 1 - id: 51

and next fourth upgrade and so on.

As you can see there's no room for ID for 8th lvl dweling.

I think that you can try to use some empty ID for special dwellings (there's four special dwellings: special1, special2, special3, special4) Every special has it own ID, but none city use all of them. So, maybe there's way to "trick" 8th lvl dwelling.
 
     
VampMarcie 
Vampire Queen


Joined: 26 Nov 2016
Posts: 9
Posted: 2017-04-16, 11:26   

misiokles wrote:
I think that you can try to use some empty ID for special dwellings (there's four special dwellings: special1, special2, special3, special4) Every special has it own ID, but none city use all of them. So, maybe there's way to "trick" 8th lvl dwelling.


So would simply renaming the building ID from "dwellingLvl8" to "special2" do it? I didn't really want to, but I may have to replace a building for it to work. Take the Replicator, for example:

Code:
special2" : {
    "cost" : { "crystal" : 2, "gems" : 2, "gold" : 2500, "mercury" : 2, "ore" : 5, "sulfur" : 2, "wood" : 10 },
    "description" : "The Replicator allows you to replicate Artifacts (not working yet).",
    "id" : 21,
    "name" : "Replicator",
    "requires" : [ "blacksmith" ],
},


Would it be worth me changing this building's use to recruit another unit, or would that not work either? I also can't find any file that gives buildings their uses, but I feel that the VCMI engine processes the text files in a specific way. Aghhh I'm stumped!
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 168
Posted: 2017-04-16, 13:43   

The more I think about this, I am more sure that it\'s impossible to do this, because "special" buildings are empy for now and only command that can be applied under building config is "produce" resources :(

Maybe in the future there will be possible something like:

Code:
special2" : {
    "cost" : { "crystal" : 2, "gems" : 2, "gold" : 2500, "mercury" : 2, "ore" : 5, "sulfur" : 2, "wood" : 10 },
    "description" : "The Replicator allows you to replicate Artifacts (not working yet).",
    "id" : 21,
    "name" : "Replicator",
    "recruit" : "8th lvl monster", //example of function to indicate that building is creature generator.
    "requires" : [ "blacksmith" ],
},
 
     
VampMarcie 
Vampire Queen


Joined: 26 Nov 2016
Posts: 9
  Posted: 2017-04-16, 14:25   

misiokles wrote:
The more I think about this, I am more sure that it\'s impossible to do this, because "special" buildings are empy for now and only command that can be applied under building config is "produce" resources :(


Ahh, fair enough. Guess I'll have to put things on hold until the engine is further developed :/ I haven't even had the opportunity to test out the dwelling on the map as the VCMI Map Editor just crashes opening a standard vanquish all opponents map! Things don't look to bright for the near future...
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 168
Posted: 2017-04-16, 14:41   

On contrary! VCMI map editor released to public some time ago was in very alpha stage. Now AVS (one of vcmi team head master) 'silently' prepare new wersion and I think we'll get quite stable official version.
By the way, testing dwelling is possible in vcmi, all you need is to dowload good map for test :)
Look at the attachment, there's S-sized map called ABC. Launch game, choose this map, choose Oblivion town as starting town. Then go your hero through the portal. Behing portal you can see all seven dwellings connected to starting town, so in these case, your Oblivion's external dwellings.

Test Mapa.h3m
Download 22 Time(s) 6.83 KB

 
     
VampMarcie 
Vampire Queen


Joined: 26 Nov 2016
Posts: 9
Posted: 2017-04-16, 15:42   

misiokles wrote:
Look at the attachment, there's S-sized map called ABC. Launch game, choose this map, choose Oblivion town as starting town. Then go your hero through the portal. Behing portal you can see all seven dwellings connected to starting town, so in these case, your Oblivion's external dwellings.


Ahh thank you! I'll test it out as soon as I can! It's been very annoying not being able to see if the dwelling even worked!
 
     
VampMarcie 
Vampire Queen


Joined: 26 Nov 2016
Posts: 9
Posted: 2017-04-16, 20:10   

As thought, it didn't work. It's a lvl 8 dwelling and the standard map editor goes up to lvl 7 in dwellings. The VCMI editor allows me to place the dwelling but the map either doesn't load in the map select menu in-game, or it crashes when I click it. This happens with any map I edit in the VCMI editor, which is coincidentally the only way for me to place down the dwelling :/ if you download my mod, could you see if you could get it working? Or is the map editor the same for you?
 
     
AVS 

Joined: 25 Feb 2011
Posts: 554
Location: Russia

Posted: 2017-04-17, 14:20   

VampMarcie wrote:
As thought, it didn't work. It's a lvl 8 dwelling and the standard map editor goes up to lvl 7 in dwellings. The VCMI editor allows me to place the dwelling but the map either doesn't load in the map select menu in-game, or it crashes when I click it. This happens with any map I edit in the VCMI editor, which is coincidentally the only way for me to place down the dwelling :/ if you download my mod, could you see if you could get it working? Or is the map editor the same for you?


Even if I release another map editor build right now it will not help, because map format support is not yes finished inside vcmi itself. But you can try special vcmi build from http://vcmi.arseniyshestakov.com/windows/PR/200/
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 168
Posted: 2017-04-17, 16:39   

VampMarcie wrote:
As thought, it didn't work. It's a lvl 8 dwelling and the standard map editor goes up to lvl 7 in dwellings.?


But you've coded external 8lvl dwelling ok in dwellings.json. Without map editor it is hard to test it, but from your side everything is ok. Now you must have lots of luck for random map generator to spawn this building on the map. High lvl external dwellings are rare, but possible. Even in standard H3, Azure Dragon's dwelling is spawned very rare.
 
     
VampMarcie 
Vampire Queen


Joined: 26 Nov 2016
Posts: 9
Posted: 2017-04-17, 22:49   

AVS wrote:
Even if I release another map editor build right now it will not help, because map format support is not yes finished inside vcmi itself. But you can try special vcmi build from http://vcmi.arseniyshestakov.com/windows/PR/200/


I'll try this build an let you know how it goes!

misiokles wrote:
But you've coded external 8lvl dwelling ok in dwellings.json. Without map editor it is hard to test it, but from your side everything is ok. Now you must have lots of luck for random map generator to spawn this building on the map. High lvl external dwellings are rare, but possible. Even in standard H3, Azure Dragon's dwelling is spawned very rare.


I guess I'll pray to RNGesus for the dwelling to spawn but I don't think it will as default maps are coded to spawn level 1 - 7 buildings only. I'll have a look!
 
     
VampMarcie 
Vampire Queen


Joined: 26 Nov 2016
Posts: 9
Posted: 2017-04-19, 13:08   

AVS wrote:
Even if I release another map editor build right now it will not help, because map format support is not yes finished inside vcmi itself. But you can try special vcmi build from http://vcmi.arseniyshestakov.com/windows/PR/200/


It didn't work, surprise surprise(!) If I could find the code behind the Dungeon's Creature Portal I could try to work something out similar to that, but even then I don't know if it'd work...guess I'll put this on hold until VCMI is developed further to allow for more recruitment!
 
     
VampMarcie 
Vampire Queen


Joined: 26 Nov 2016
Posts: 9
Posted: 2017-05-23, 17:12   

***UPDATE***

I got it working! Well, kinda. I left this for a bit but recently downloaded the Amethyst Chinese town and dug around the files. I changed the building ID from 43 or 44 to 50, added a few placeholder spaces in the townhall.def file and I could recruit my Sorceresses! Only issue now is that their building is always built in the town and they are recruited from the Doomknight/Dreadlord Pit (Juggernaut Pit). So glad it's working, just need to see if I can get them to be recruited separately!

See:
https://gyazo.com/0387d246e7cfe73f8166f33a8d331d6d
https://gyazo.com/6b6061a8b4f8577d5880d2b5b43cf7d0
 
     
Draeganfire 

Age: 45
Joined: 15 Sep 2016
Posts: 47
Posted: 2017-05-26, 23:24   

I like the way that crystal palace looks, can't wait to see the whole town in action :->
 
     
VampMarcie 
Vampire Queen


Joined: 26 Nov 2016
Posts: 9
Posted: 2017-05-26, 23:28   

Draeganfire wrote:
I like the way that crystal palace looks, can't wait to see the whole town in action :->


I have a week off this week so I'll be looking to develop this a little further! If I can get it to work, I'll update the thread! I mean I can link you to a download but idk if I can because I've used the same graphics from the MDT Forge team...
 
     
Display posts from previous:   
Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group

Hosting provided by DigitalOcean
Page generated in 0.04 second. SQL queries: 15