I suggest the following: process the map.xdb file, give names to unnamed garrisons and Preserves, and save them in a separate lua file that will be for each map, but will have the same name. This file will contain an array of names, including those given by the author. If necessary, I can also process the default maps, not manually, of course.
Added 5 minutes ago
Thus, in the file Maps/Multiplayer/***/NHF-Names.lua, there will be approximately the following:Sequential numbers can be replaced with random ones.NHF_UNNAMED_OBJECTS = {
DWARVEN_WARREN = {
'NHF-DwarvenWarren-0001',
'NHF-DwarvenWarren-0002',
},
GARRISON = {
'gar1',
'gar2',
'NHF-Garrison-0001',
'NHF-Garrison-0002',
'NHF-Garrison-0003',
'NHF-Garrison-0004',
},
}
Added 7 minutes ago
To save memory, unnamed objects can be omitted from the array, and only the number of these objects can be written.NHF_UNNAMED_OBJECTS = {
DWARVEN_WARREN = {
NAMED = {
},
UNNAMED_N = 2,
},
GARRISON = {
NAMED = {
'gar1',
'gar2',
},
UNNAMED_N = 4,
},
}
If you want, you can also process the standard ones.
Added 9 minutes ago
In general, a large function for interacting with the necessary objects will be required for unification. But the problem is that scripts work with objects differently. For example, the trigger for touching a Castle needs to be completed upon visiting and then updated again. The trigger for touching a mine does not require this. In the latest version, I have already combined the battle script with the Castle, hero, and monsters. It is now universal. You can try to move functions to resemble classes to reduce the load and the number of script lines.
Previously, the project was assembled piece by piece, and different scripts for the same situation were the norm. Now there is a lot of similarity. Unification is needed.
RedHeavenHero, what do you think about merging the project with part of NCF and even creating new maps with multiplayer scenarios for these heroes?
Added 17 minutes ago
Ideally, of course, it is better if all names are stored only with the map.
And only this file is loaded. Then there will be few names.
An array is created in the General NHF file, and in the lua of each map, there will only be an addition to this array.
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...