SoD files mod like


#141

On heroes/icons:
In total there are 4 icons: portrait and specialty, each comes in small and big versions. Probably needs 4 directories instead of one.

On town configs merging:
Do as you want to. For me it works fine either way.


#142

Here all factions updated.

  • Spell probability in guild is now in.
  • Hero class probability in tavern now is in.
  • Music files for factions double-checked.

Still missing Hero Specialties! They are hard-coded. If someone with knowledge of that part would volunteer to translate them to mod structure…

How do you want the file structure to look like starting from /Mod/ ? Maybe with minimods in mind?
Is there no way to put this mod under SVN? (even if not active ?)

Tomorrow I will update the lod moving script (where needed) with the new paths.
factions.zip (370 KB)


#143
<vcmi data dir>/
   Mods/
      sod/
         mod.json
         Resources/ (if needed)
         Overrides/ (if needed)
         Mods/ (sod direct submods)
            factions/
               mod.json
               Resources/ (if needed)
               Overrides/ (if needed)
               Mods/ (submods of Factions mod - H3 towns)
                  castle/
                     mod.json
                     ...
                  rampart/
                     mod.json
                     ...
                  ...

I’d rather avoid this until mod is functional.

And there are still some situations where your mod won’t work:

  • creature banks. Probably must be split into multiple mods. Othervice disabling (for example) Rampart will break this submod because it needs access to dwarves.

  • H3 maps. A lot of them use factions-specific dwellings or creatures even if player can play with any town.

  • Golem Factory requires not only Tower but also neutral creatures.

And there may be other problems which I can’t remeber right now.


#144

Or maybe all standard creatures can be set to “neutral” faction when moved to mods.
And when town mod is chosen to load, it will override faction like in conflux-tweaks:
“core”:“archer” {“faction”:“castle”}

Please, do not quote whole post unless needed.


#145

For maps, or dwellings, or banks or other issues…

If we allow core factions to be turned off (and we should because I can easily imagine a mod that replaces one faction, or players wanting to play some specific factions, getting rid of conflux for example) than these issues have to be resolved. Otherwise only problems will result.

I went about this problem this way: I want to make a new building that has 4 existing dragons inside.

  • I can make a mod that depends on those 4 FULL factions
  • I can Overwrite those 4 dragons in my mod, allowing those factions to be disabled (I think this one is more nicer).

And for a map don’t we/can’t we check that all the resources are available with players current mod environment?


#146

Macron1 Raised a point that I missed at that time. But now it is more clear: What if I want to use only resources from another mod?

One example: I want to have HotA disabled but still use the town (or 1 creature) in another mod? For this besides mod is active I imagine we would need a “mod_is_installed/present”? After all there are copyrights.


#147

Barely. For H3 maps you need to manually check any instance where object ID’s can be used. And there are a lot of such cases. Creatures/banks are the most obvious but you also need to check all armies, seer hut/quest guards, events…

Theoretically won’t be a problem with RMG but it is still in unfinished state.

There is one huge problem: updates. If mod with such creature got update you must trace all places where such creatures are in use. It may also trigger for H3 creatures in case if we’ll update something in config file (e.g. missing ability)

You can’t. When mod is not loaded/disabled VCMI will not load files from it at all.

Alternative solution would be possibility to mark all objects as “special” similar to current fields in creature and hero configs: object will not appear in-game randomly but still can appear if placed manually.

In this case there won’t be need to disable mod itself - just add small mod that will add or remove “special” : true from all objects.


#148

We have spell_info and spell_sounds configs. Can these be merged?


#149

I think yes. You may also merge spell sounds into CSpell class.

And perhaps upload this as separate diff - I’ll commit it to svn.


#150
  1. If I want to add also to spellInfo.json info about spells graphics how should an entry look like?

  2. Is this from WoG? (spellinfo.json)

			"graphics":{
				"iconImmune":"ZVS/LIB1.RES/E_SPDISP"
			}
  1. “Name” field from spellSounds.json… what is the purpose of that one? Should it be a part of spellInfo as-well?

#151
  1. Add field into “graphics” entry. Although right now animations are stored separately - check battles_graphics.json and how game handles that data while icons are hardcoded to be one frame in def*
  2. Partially. Some of the icons are also included into vcmi package. Used in creature window.
  3. Most likely remains from ancient pre-json config system - txt’s with unused strings acting as comments.
  • if you wish to change this - check how icons are working in other objects. Consists from 2 parts:
  1. loadObject() function in handlers
  2. Graphics::initializeImageLists() function

#152

@Ivan. Now I am asking for favors :). My impression is that in the end the SoD mod will be wanted/used. If so, can you please take a look at minimods with a higher priority? Here’s why…

Until now I thought that I will do the mod and whenever anyone has time to implement code support for it or missing mod features I will just update it and that’s that. The problem is that I use a state of the whole .json structure from a given point in time. People correct bugs in .json configs left and right and while I can manually keep them up to date, it will be tedious to do that for a long period of time.

My proposal on implementing the SoD mod would be to do it gradually. First the faction related things, then artifacts/spells, and later the rest.


#153

The problem is that switching to minimods will mean that some other feature won’t be in time for 0.94. Submods are already as high as possible in my todo list, just after mod manager + zip support which are must-have for next release (imo).


#154

I was asking also because besides SoD I would also like to start work on Succession Wars, alternate upgrades and it would have been nice to have the new structure working, instead of some folders where I hoard .json files :(.


#155

That’s the point of directory structure I’m proposing for mods - to add some organization to countless files. Using it it is completely possible to put whole SoD into one mod without getting a complete mess. This won’t give you what you want with SoD mod (like disabling specific towns) but it should work OK for Succession Wars/alt upgrades. At least SW is a solid mod without any optional components so placing everything here in one mod sounds logical for me. Main point of submods is to allow user to disable part of mod.


#156

Why SW is different? SW is also good splitted to towns, I guarantee.


#157

For SW my proposal is (not approved nor disapproved by none) to do it in 2 steps:

  1. Everything H3 but with H2/H2_like graphics (my personal interest)
  2. SW towns and creatures.

So I see this as 3 :slight_smile: mods.

  1. One common mod to change interface, Sounds
  2. One mod adding on top of 1) H3 factions
  3. One mod adding on top of 1) SW factions

Would this be possible? (Asking from file system perspective. I am aware that interface mods are not here yet).


#158

Sure. Why not? Moreover - mods 2 & 3 may be independent from 1 since they’re completely separate.

IIRC SW only replaces graphical files without any actual changes in UI. This part is possible in VCMI.

So this would give you 3 mods with some dependencies between them - submods are not necessary here (although they can be used to group these mods into one)


#159

@ Ivan: How to translate:

std::unique_ptr<CInputStream> & inputStream = load(entry.name);?

now it expects a ResourceID? how to get it?


#160

load() accepted ResourceID as only parameter even before my changes.

Something like this I suppose?

std::unique_ptr<CInputStream> inputStream = load(ResourceID(entry.name));

ResourceID can be constructed from:
A) string that contains full path including extension e.g. ResourceID(“config/settings.json”)
B) string with path and type of resource you want to load, extension ignored e.g. ResourceID(“config/setttings”, EresType::TEXT)

And IIRC inputStream should be a normal variable instead of reference.