Proposal for creature config

In your case something like this should work:

"CONFIG/" :  <- this is directory where all files will be placed after initialization
          
             {"type" : "dir", "path" : "ALL/MODS/HOTA/CONFIG"} <- this is path to directory, relative to H3 root directory. Prefix "ALL" is needed for user-specific directories on Linux.
         ]

This should make files in mods/hota/config directory available via “CONFIG/filename” URI from game.
In case of multiple mods with such config only file from last mod (alphabetically) will be available. To get all files check CAnimation::init();

True. This is main problem with URI’s right now. But this is true for graphical content as well.
Let’s imagine mod with 1 creature. What is the most logical name for creature icon? Icon.png? And half of mods will have such name…

Right now nearly all mods are in fact targeted to era (including HotA in future versions). Era has same issue with filenames. So requiring unique resource names wont be surprise for modders. OTOH this is an issue anyway.

It didn’t, so i restored last working configuration in r2896.

Have a look at new mod & filesystem.
config.rar (4.09 MB)

Reuploaded archive, same link: dl.dropbox.com/u/22372764/vcmi/hotapackage.zip
Just unpack it into root directory.

Main config is available as

ResourceID("CONFIG/mod", EResType::TEXT) <- in this case extension not needed
ResourceID("CONFIG/mod.json") <- type will be determined from extension

Thanks, now it works in Mods folder.

But you included old mod.json file in package, it can’t even be parsed correctly. I also added some info (creature upgrades) in new version.

It works!


At least until it crashes. Well, beginnings are hard.

Updated archive attached.
HotA.rar (4.09 MB)

Updated config with creature sounds.
HOTAmod.rar (1.4 KB)

Bump. Fixed some defs and added creature abilities.

At least one more version is expected, with some stack experience bonuses. I won’t do it anytime soon, though.

Ivan, please take care of creature portraits (big and small).
HOTAmod.rar (1.74 KB)

Ok. But this have one problem: portraits have to be in same def files is H3 (e.g. TWCPORT.def).

Easiest way for now is to add into CCreature field “iconIndex”. Same as ID for H3 creatures, set in Json for mods. VCMI allows empty frames in def so this should work until better solution will be implemented. Resource manager from unfinished branch would solve this problem perfectly but it needs a lot of work.

Done. Same link for updated package: dl.dropbox.com/u/22372764/vcmi/hotapackage.zip
Check for crashes in case if I missed something.

Ivan. You aded fixed number “icon index” to config file, which will not and can’t work when there are more mods. Indexes for creatures are generated at run time in CModHandler::recreateHandlers() function. It is true for example for adventure map def info.

We only need to make sure that right indexes are assigned to right pictures.

Best solution (something like URI to icon) is not possible right now. Runtime generation of list of icons is not possible either.

This is the only viable option I found. Note that you can use any id’s for icons - for example cove creatures use id’s 250-264 with huge hole before them (200-250 are missing). As long as index is not insanely huge it will work and later there will be way to fix this and use URI instead.

Can’t we just ignore def frames and create separate vector (array?) of images / image references?
Or something like “if creature index is within TWCPORT size, use that def, if it’s greater, use def from string”.
It may be just workaround to make creature indexing transparent for user.

I think its better to unpack icons from defs and use filenames. Is this a problem?

Right now it has to be def (or its json replacement) - most of places in code can only use them.

This is how current json replacement works: if entry with file name not present in json - use image from def.
But creating that json in runtime is not possible right now. And we need this to get numeric id’s generated in runtime.
That unfinished resource manager can fix this perfectly but it needs a lot of work.

Attaching new mod with some of icons fixed, stack experience and projectile properties. All necessary properties specified by creature format should be handled.

I don’t really get the meaning of projectile offsets and stuff, hopefully it’s a minor thing.
Horde growth & turret creature are not necessary now I believe, if ever.

Also, attaching little test map with random creatures. Please add it to nearest releases.
Game crashes as soon as new units join our army, which didn’t happen for a while. Together with missing abilities from creature window, I smell client-server desync. Needs testing.

Also, are .msk, .msg files needed anymore?
hotaPackage.rar (4.19 MB)

Values from cranim.txt? They may cause some incorrect positioning but nothing else.
I know how to get correct values from hota files - will fix this later.

Kinda. Right now engine will crash if neither msk nor msg were found.
But these files are almost unused - all vcmi needs is width and height of the object. Which can be moved somewhere else if needed.
Think this should be part of new objects for adventure map format instead of creatures. Unless you really want to get rid from them.

Fixed mod with Pirate sounds and teleporting Nymph.
HoTAmod.rar (2.41 KB)

One more update: dl.dropbox.com/u/22372764/vcmi/ … atures.zip
Changes:

  • correct projectiles for pirates\sorceresses (note that pirates bullet is small and hard to notice)
  • imported values from cranim.txt
  • test map is part of mod, does not need manual placing into maps directory
  • proper plural names for creatures

Meh, still buggy :o

-Fixed Ayssid large icon
-Fixed Corsair -> Seadog upgrade

dropbox.com/s/wq28dkdsnrcot … ackage.rar