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

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

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

Joined: 12 Nov 2015
Posts: 146
Posted: 2017-02-09, 16:16   

I suggest you manually define masks (yellow, red and transparent squares) for every dwelling ("visitableFrom" may stay as base for every dwelling). Look: castle's dwellings have various masks.

For example - mask for Halbardiers' dwelling is [ "VVV", "VBV", "VBA" ] , for Angels' dwelling is [ "VVVV", "VBAV" ], for monks' dwelling is [ "VVV", "VVV", "VBA" ] and so on.

And browse this mod:
http://www.mediafire.com/...tsPack_v1.0.zip
There you can find hundreds configured new objects. Maybe something makes you things clearer.
 
     
Warmonger 
VCMI programmer


Age: 27
Joined: 07 Jun 2008
Posts: 1528
Location: Warsaw, Poland

Posted: 2017-02-09, 16:28   

VCMI copies all dwelling masks from Guardhouse (first on the list). The problem is that Random Dwellings objects may become inaccessible if different mask is picked:
http://bugs.vcmi.eu/view.php?id=900
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
krs


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

Quote:
VCMI copies all dwelling masks from Guardhouse (first on the list).


This is what was puzzling me. Why the serialized version of dwellings from VCMI looks the same for all buildings.

I will leave the files with the Guardhouse masks for now. Once I have something working I will try to update those.

One question tough... From the screenshot above, it looks like the editor has this information already. Can I get this information from the editor somehow?
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 146
Posted: 2017-02-09, 17:26   

Quite opposite. First you must manually write masks, then editor reads them and shows appriopate yellow/red squares. Writing mask is reletive easy, only some practise.

But standard h3 dwellings have configured masks, that's way can be readable from editor.
 
     
krs


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

Then the question is... where can I get those masks from? Can I obtain them in a serialized form?
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 146
Posted: 2017-02-09, 19:35   

I can only tell you how I write masks.

I have bmp file with my adventure map objects. I open Def maker, load this bmp in it and click reposition tab.


So you can see 20 square parts in four rows. Each row has 5 squares.
And you have three mask parameters.
V - visible, transparent square
B - blocked square (red in map editor)
A - visitable by hero square (yellow in map editor)

So first square in first row is visible - V
second square - visible - V
...
fifth square - visible - V

Mask for first row is then: VVVVV

Second row:
first square - V
second square - blocked/red - B (or V, you must decide and then test proper visibility in game)
third square - B
fourth square - B (or V, reason as above)
fifth square - V

So mask for second row is: VBBBV

analogically mask for third row should be: VABBV
a fourth row: VVVVV

so your code is:
Code:
"mask" : [
                "VVVVV",
                "VBBBV",
                "VABBV",
                "VVVVV"
            ],


As you see, it's no simple way to obtain masks, you must make them patienty. I think maybe someday someone write handy tool for easy mask design like Object Editor Tool for ERA platform.

But, if you open SoD map editor and place SoD dwelings on the ground, you can easily "read" all visible, red and yellow squares and easily write proper masks by yourself.
Last edited by misiokles on 2017-02-09, 19:55; edited 1 time in total  
 
     
misiokles 

Joined: 12 Nov 2015
Posts: 146
Posted: 2017-02-09, 19:50   

And here's example of inproper mask configuration - in game cactuses are cut and don't display correctly.
 
     
krs


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

Thank you for the explanation on how to get them from def files. Maybe the above example could be linked into/from wiki?

But if they exist already in code for SoD objects, that means that at some point in the code I can get them out serialized in json file. So I do not have to build them by hand.

@Warmonger Is there any place I can get them in code or are they really copies of Guardhouse?
 
     
Display posts from previous:   
Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

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