Skip to content
User Avatar
#2919
Auto-translated
Gerter
Okay, I don't know what your general knowledge of scripts is, so I'll try to explain it simply:

First, you need to assign script names to the desired units in the editor and configure them so that they are guaranteed to join the heroes of the player you want (the relevant items are highlighted in the screenshot).



Then, in the script, for convenience, create a table through which it will determine the presence of units on the map:
stacks = {'script_name_of_unit_1', 'script_name_of_unit_2'... and so on

Then, use a new day trigger to check daily for the existence of units:
function NewDay()
if GetDate(DAY) == 'day when the check needs to be performed' then
-- further check for the existence of units and transfer to the desired hero
for i, stack in stacks do
if IsObjectExists(stack) then
MakeHeroInteractWithObject('Script_name_of_the_desired_hero', stack)
end
end
end
end

Trigger(NEW_DAY_TRIGGER, 'NewDay')

Thank you for the answer.
I didn't know that it is possible to set different attitudes of a creature towards different players.
I created the table of creatures shown above, but the specified creatures may be destroyed before the specified time, according to the quest, which means, as I understand it with my poor mind, I still need a function to check for the existence of these creatures in principle, in order to complete the task before the specified day

Statistics

Welcome our newest member: artem

Users Online 2 users 1538 guests

Today's Visitors 0

No visitors yet today.