спасибо, помогло.
Добавлено через 7 минут
ну, и (очень надеюсь) последний вопрос на сегодня:
Ув. RedHeavenHero - вот немного видоизмененный код вашей функции на превращение двеллингов людей.
Собственно говоря, я бы хотел, чтобы все это великолепие начинало свое работу, когда небольшая и скромная переменная, dwel её название в скрипте, приравнивалась к гордой и непокорной единице (dwel = 1). Однако, в следствии моего тугого соображения и полного не знания данных функций скрипта, никак у меня не получается совладать и подчинить своей воле непокорный цикл с for и тп и тд. Прикладываю код сейчасшней функции и надеюсь на скорую помощь. =)
function starthut()
if dwel == 1 then
for i,hut in GetObjectNamesByType('PEASANT_HUT') do
SetObjectEnabled(hut, nil)
Trigger(4, hut, 'replace_hut')
end
end
end
startThread(starthut)
function replace_hut(hero, hut)
if hero == 'Berein' and dwel == 1 then
Trigger(4, hut, nil)
SetObjectEnabled(hut, 1)
ReplaceDwelling(hut, 4)
sleep (1)
MakeHeroInteractWithObject (hero , hut)
end
end
----------------------------------------
function starthut2()
if dwel == 1 then
for i,hut2 in GetObjectNamesByType('ARCHERS_HOUSE') do
SetObjectEnabled(hut2, nil)
Trigger(4, hut2, 'replace_hut2')
end
end
end
startThread(starthut2)
function replace_hut2(hero, hut2)
if hero == 'Berein' and dwel == 1 then
Trigger(4, hut2, nil)
SetObjectEnabled(hut2, 1)
ReplaceDwelling(hut2, 4)
sleep (1)
MakeHeroInteractWithObject (hero , hut2)
end
end
----------------------------------------
function starthut3()
if dwel == 1 then
for i,hut3 in GetObjectNamesByType('BARRACKS') do
SetObjectEnabled(hut3, nil)
Trigger(4, hut3, 'replace_hut3')
end
end
end
startThread(starthut3)
function replace_hut3( hero , hut3)
if hero == 'Berein' and dwel == 1 then
Trigger(4, hut3, nil)
SetObjectEnabled(hut3, 1)
ReplaceDwelling(hut3, 4)
sleep (1)
MakeHeroInteractWithObject (hero , hut3)
end
end
--------------------------------------
function starthut4()
if dwel == 1 then
for i,hut4 in GetObjectNamesByType('HEAVEN_MILITARY_POST') do
SetObjectEnabled(hut4, nil)
Trigger(4, hut4, 'replace_hut4')
end
end
end
startThread(starthut4)
function replace_hut4(hero, hut4)
if hero == 'Berein' and dwel == 1 then
Trigger(4, hut4, nil)
SetObjectEnabled(hut4, 1)
ReplaceDwelling(hut4, 4)
sleep (1)
MakeHeroInteractWithObject (hero , hut4)
end
end