Hello everyone, can anyone help me understand the command:
CreateStatic
Example from the description:
CreateStatic(scriptName, DataFile, x, y, floorId, rotation, terrainAligned, scalePercent);
All parameters are clear except for DataFile
I somehow assumed that the path to the extracted object should be specified, but there seems to be something else (I need the name, but I don't understand what kind of name it is...)
Posts from Scripts
Auto-translated
Added after 34 minutes
In short, I figured it out; I should have paid attention to the object type right away; the whole problem was in that. I recreated the object with the "Static" type, and now it works ;) (and I was foolishly starting to think that the command wasn't working).
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Force it into an infinite loop, and if the result is negative, display a message and exit the loop (to avoid wasting resources).
I don't know if it returns nil or false, but it's more likely the latter. This option will definitely work:
~=true then
RACE_HEAVEN, RACE_PRESERVE, etc., are not declared; that is, the numbers representing the constants are missing. Or do I need to include a separate file with the script? I haven't found where these factions are declared...
================
Another question of this nature: if I give a player three cities at the start, but when loading the map and scripts, I take away two castles, is there any way to close the fog of war for these two cities?), because in practice, the rights to both cities have passed to another player, but the cities remain visible to the first player.
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
TOWN_HEAVEN = 0
TOWN_PRESERVE = 1; -- Sylvan
TOWN_ACADEMY = 2
TOWN_DUNGEON = 3
TOWN_NECROMANCY = 4
TOWN_INFERNO = 5
TOWN_FORTRESS = 6
TOWN_STRONGHOLD = 7
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
AllowHeroHiringByRaceInTown('humanTown', TOWN_HEAVEN, 1);
AllowHeroHiringByRaceInTown('elvenTown', TOWN_PRESERVE, 1);
and I'm also using a loop to prevent the hiring of heroes of other races in these towns. As a result, in the first town where the player starts (e.g., the human town), heroes of the human race can be hired, and everything is normal, but in the second town, there are no heroes at all. I'm not sure what the problem is.
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
blockedTavern.n = length(blockedTavern);
allTown = {'AcademyTown', 'HeavenTown', 'SylvanTown', 'DwarvenTown', 'NecropolisTown', 'InfernoTown', 'HordeTown', 'DungeonTown'};
for i = 1, blockedTavern.n do
for j = 1, length(allTown) do
AllowHeroHiringByRaceInTown(allTown[j], blockedTavern, 0);
end;
end;
AllowHeroHiringByRaceInTown('AcademyTown', TOWN_ACADEMY, 1);
AllowHeroHiringByRaceInTown('HeavenTown', TOWN_HEAVEN, 1);
AllowHeroHiringByRaceInTown('SylvanTown', TOWN_PRESERVE, 1);
AllowHeroHiringByRaceInTown('DwarvenTown', TOWN_FORTRESS, 1);
AllowHeroHiringByRaceInTown('NecropolisTown', TOWN_NECROMANCY, 1);
AllowHeroHiringByRaceInTown('InfernoTown', TOWN_INFERNO, 1);
AllowHeroHiringByRaceInTown('HordeTown', TOWN_STRONGHOLD, 1);
AllowHeroHiringByRaceInTown('DungeonTown', TOWN_DUNGEON, 1);That is, I first prohibit hiring any heroes in all cities, and then allow hiring heroes of that city's race in each city separately. Most likely, the loop is not correct; I think it is wrong to prohibit hiring all heroes. Perhaps there is a way to select individual values from the blockedTavern list for each case?
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация