And is the trigger for interaction TOUCH_TRIGGER? Is it also suitable for movable objects?
And is the trigger for interaction TOUCH_TRIGGER? Is it also suitable for movable objects?
New here? I'm Roha — want a quick tour?
How is it possible that an AI hero, with 100 megamonsters and a million HP, loses to a computer with 1000 black dragons? I checked, and the dragons naturally defeat them in one hit. But when two AIs fight, the second one wins...
All the computers, as expected, pass by. Except for one. It bumps into this object and... its turn lasts infinitely long. That is, there is a progress bar for its turn, but it stands still, and the bar doesn't move. After 20 minutes, it ends its turn...
Either the objects need to have their priorities reset (this is, in my opinion, somewhere in data.pak), or an impassable area for the AI needs to be created around them; otherwise, they will keep trying to interact with the object until they do.
function mask_check(attacker, defender)
if HasArtefact(attacker, ARTIFACT_MASK_OF_DOPPLEGANGER) then
SetObjectEnabled(defender, 1)
Trigger(16, defender, nil)
MakeHeroInteractWithObject(attacker, defender)
local index = GetLastSavedCombatIndex()
while index == GetLastSavedCombatIndex() do
sleep()
end
if IsHeroAlive(defender) then
SetObjectEnabled(defender, nil)
Trigger(16, defender, 'mask_check')
end
end
end
SetObjectEnabled('hero1', nil)
Trigger(16, 'hero1', 'mask_check')