Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
aha) damn, that part of the message wasn't even sent, I had to delete it))

Whatever
In reply to Heroist
User Avatar
Это?
for i, hut in GetObjectNamesByType("PEASANT_HUT") do
Trigger(4, hut, "func")
SetObjectEnabled(hut, nil)
end
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
And I don't like the "enabled" option – is it mandatory? Can't I just leave one trigger?

Whatever
User Avatar
Auto-translated
Well, it's still better than blocking the object for everyone. By the way, is there no way to enable it only for the first player?)

Added 17 minutes later
Oh, no, I have a different idea:

--add a check on GetCurrentPlayer, including all huts, and disabling it for the first player.
--when touching a hut, if the mission hasn't been taken yet, but the player is the first, then unblock the hut, then makeHeroInterractWithObject, then immediately block it again.
--if the player is the first and the mission is in progress, then immediately go to the scripted function.

Will that work?

Whatever
User Avatar
Auto-translated
Disable it for the duration of the first player's turn? Sure, that's possible.

Added 2 minutes later
I used to have the dwarven garrison work that way.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
Yeah, I get it. Thanks for the help. I'm just having some trouble with arrays and for loops, and things like that.

Whatever
User Avatar
Auto-translated
Wouldn't that Lua manual link I provided earlier be helpful? It explains loops, tables, and other things quite clearly.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
it will probably help) I just don't have much time, and I'm very, very lazy – it's easier for me to ask =)

Added 7 hours and 3 minutes ago
yes, here's another super-mega-question: how do I make a pop-up image? For example, I add resources, but it's not visible that they are flying away from the hero; instead, only the value on the resource panel changes.

Whatever
User Avatar
Auto-translated
Wow! Thanks!

Okay. And will AddHeroCreature work?! I want monster icons!!))

Added 3 minutes later
RedHeavenHero
Make the 4th argument of SetPlayerResource the name of the hero from which the image will appear.

It didn't work.
SetPlayerResource (1, 1, GetPlayerResource(1, 1) - res2, 'Nymus')

Or is it not converting the variable to a number?

Whatever
User Avatar
Auto-translated
That's a shame. Is there a way to do the same thing with the troops?

Whatever

Statistics

Welcome our newest member: Emil