I asked my friend Dolgiy to write a script.
Added 3 hours 6 minutes ago
This is sad, although logical. I just think that these manipulations with subtraction are not the right solution.
Although, based on my personal experience and the experience of this entire thread, sometimes there is no right solution, or rather, there is, but it is not feasible.
In any case, thank you, I won't waste time trying to bypass the Nival events.
Added 18 minutes ago
--Name all mines with the same name plus a number starting from 1 and onwards: For example, mine1, mine2, mine3, mine4, etc.
while 1 do
sleep(10);
for i = 1,"number of mines on the map" do --Replace "number of mines on the map" with the number
if GetObjectCreatures("mine"..i,"creature ID") == 0 and GetObjectOwner("mine"..i) ~= 0 then --Replace "creature ID" with the desired creature ID
SetObjectOwner("mine"..i,0);
end;
end;
end;
Added 1 hour 2 minutes ago
However, something is needed to stop the mine from becoming neutral when a hero captures it and places creatures in the garrison. Otherwise, the mine will become neutral, and you will have to fight these creatures. Something like a region around the active tile of the mine and a condition that if there is no hero in the region, then SetObjectOwner("mine"..i,0) is executed. But I think there is a better idea, but it doesn't come to mind yet.