Skip to content

Posts from Current questions and answers regarding the map editor. Auto-translated

5.0 (12 ratings)
#1758
Auto-translated
Yesterday, I cleverly made transparency, created a new image of the same size, and cut everything out onto it. As a result, the wings are transparent. Photoshop CS 3 is out of order and doesn't want to work; I'm left with Adobe Photoshop 7.0, and I don't even know how to make transparency in it.

Added after 2 hours 12 minutes
Is there a script where, when you kill a peasant, you get his house?
User Avatar
#1759
Auto-translated
zehir12
Is there a script that gives you the peasant's house when you kill him?
What, what? Which peasant, which house?:)
#1760
Auto-translated
You kill a peasant standing near the house, and then the house is transferred to you. How do you transfer the house, and how do you make it so that this happens only after his death?

Added 10 minutes later
Hello, is anyone there?

Added 1 minute later
By the way, what is the purpose of IsObjectEnabled?
User Avatar
#1761
Auto-translated
IsObjectEnabled
Enables or disables standard actions for an object.
Just set a trigger that, upon contact with a peasant, triggers the hut's transition.
 

К А
Стикеры GBF в Telegram
#1762
Auto-translated
I meant that when you kill a peasant, the hut becomes yours. I just asked about IsObjectEnabled out of curiosity.
In reply to HAndOS
User Avatar
#1763
Auto-translated
zehir12
Is there a script that, when you kill a peasant, gives you their house?
You can create a trigger that activates upon the hero winning a battle. Then, you can check if the object exists, and if it doesn't, transfer the building to the player, and set the transfer to zero to prevent it from happening again.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
#1764
Auto-translated
How can I check?
User Avatar
#1765
Auto-translated
IsObjectExists( ObjectName ) -
Returns whether an object with the given name exists on the map.
#1766
Auto-translated
So, if the object exists, nothing happens, but if it doesn't exist, then the structure is passed. Is that correct?
User Avatar
#1767
Auto-translated
If the script is written correctly, then yes, that's how it will work.
#1768
Auto-translated
Thank you very much, I'm trying it now.

Added 5 minutes later
function maxF()
if IsObjectExists('max')
then
else
SetObjectOwner('Bar',PLAYER_1);
Trigger(OBJECT_TOUCH_TRIGGER,'max',nil)
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER,'max','maxF')
Did I write it correctly?
In reply to HAndOS
User Avatar
#1769
Auto-translated
zehir12
Thank you very much, I'm trying it now.

Added 5 minutes later
function maxF()
if IsObjectExists('max')
then
else
SetObjectOwner('Bar',PLAYER_1);
Trigger(OBJECT_TOUCH_TRIGGER,'max',nil)
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER,'max','maxF')
Did I write it correctly?
You need to attach it to a battle trigger, not an object touch trigger. Possibly with a delay.
Or just put it in a While loop...
Otherwise, it turns out that the object is touched, but it no longer exists.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
#1770
Auto-translated
Is the battle trigger OBJECT_CAPTURE_TRIGGER?
In reply to HAndOS
User Avatar
#1771
Auto-translated
zehir12
Is the battle trigger OBJECT_CAPTURE_TRIGGER?
No, this is a trigger that changes the ownership of an object (the word OBJECT kind of hints that it's about an object). Something similar to COMBAT_TRIGGER, I don't remember the exact name, check the documentation.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
User Avatar
#1772
Auto-translated
You can also use a touch trigger:
function touch_peasant(hero)
	repeat
		sleep(1);
		if IsObjectExists("peasant") == nil then
			SetObjectOwner("hizhina", 1);
			break;
		end;
	until IsHeroAlive(hero) == nil
end;

Trigger(OBJECT_TOUCH_TRIGGER, "peasant", "touch_peasant")

In my opinion, using COMBAT_RESULTS_TRIGGER would be too complicated.