Posts from Scripts
Auto-translated
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
function burn()
----
for i, hut in GetObjectNamesByType('PEASANT_HUT') do
Trigger(4, hut, 'hutF')
end
-----
startThread(burn2)
end
startThread(burn)
---
fires = 0
function burn2(hero, hut)
while 1 do
sleep(1)
if GetCurrentPlayer() == 1 and fires == 0 then
SetObjectEnabled(hut , nil)
fires = 1
elseif GetCurrentPlayer() == 2 or GetCurrentPlayer() == 3 or GetCurrentPlayer() == 4 then
SetObjectEnabled(hut , true)
fires = 0
end
end
end
----
hutt = 0
----
fire2 = 0
function hutF(hero, hut)
if GetCurrentPlayer() == 1 and fire2 == 0 then
sleep(1)
QuestionBox ( "/Maps/SingleMissions/NewRandomMap 43/burn1.txt" , 'burnok' , 'burnno');
sleep(1)
end
end
function burnok(hero, hut)
sleep(1)
BlockGame()
--burn hut effects
hutt = hutt + 1
Trigger(4, hut, nil)
UnblockGame()
end
function burnno(hero, hut)
sleep(1)
fire2 = 1
SetObjectEnabled(hut, true)
sleep(1)
MakeHeroInteractWithObject('Nymus' , hut)
sleep(1)
SetObjectEnabled(hut, nil)
fire2 = 0
endBasically, what I'm most interested in is how to make the script read the name of the hut and use it in other functions. If I write it in parentheses after the function name, it somehow doesn't work.
You can ignore the variables; there aren't any functions that use them yet.
I tried using GameVar to output the hut, but it doesn't read it.
And when I put it in quotes, it stops recognizing the object altogether
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
---
hut3 = GetGameVar('hut2')
---
SetObjectEnabled('hut3', true)
Is this correct? (quotes and everything)
Added 55 seconds later
By the way, why so many hyphens between the lines?
It's necessary. I'm tired and starting to get confused, I can't tell one thing from another. That's why I put in line breaks and hyphens)))
I need to. I'm tired and starting to get confused, I can't tell one from the other. That's why I'm putting in line breaks and minuses.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Okay.
So, why isn't it working then?))
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Also: startThread(burn2) should be written inside the loop.
Yeah, I missed that. I'll fix it.
Added 6 minutes later
Still don't understand why it doesn't work. Since the function is global, does that mean quotes aren't needed? But even so, 'enabled' isn't being set.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4