I noticed a peculiarity: when I create a treasure with a specific scripted name:
CreateTreasure('some_name', TREASURE_CHEST, 10, 111, 118, GROUND, 0)
and then try to access it using that name:
print(IsObjectExists('some_name'))
it returns nil, meaning it doesn't find an object with that name, even though the treasure itself appears on the map. In a similar function, CreateStatic, everything works as expected. Is this a misunderstanding on my part, or a bug in the developers' code?
I don't understand why print and similar functions are even needed, but I do have a thought about why it returns nil. Do these two lines in your script run sequentially? If so, there's nothing surprising. There should be at least some time delay between them, such as sleep(1);. The game simply doesn't have time to place 'some_name' in the list of objects and then immediately perform an operation with it. There might be another reason, and other people can offer suggestions.
Пробуждение зла
Нашествие из Преисподней
Смена эпох
Скачать все кампании одним архивом: Яндекс.Диск Google.Диск
You can download the set of 3 Campaigns (English version) here
Одиночные сценарии Heroes V 3.1:
Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы
Мультиплеерные карты для Heroes V 3.1:
Легендарная война
Сердце вулкана
Передел мира