Posts from Scripts
Here's the script:
function VisitDeviltavern (heroname)
if heroname == 'Biara' then
if visiter_deviltavern == 0 then
BlockGame ();
GiveHeroSkill ('Biara', 98);
visiter_deviltavern = 1;
SetObjectiveState ('saobj', OBJECTIVE_COMPLETED, 1);
GiveExp ('Biara', 12000);
sleep (30);
UnblockGame ();
else MessageBox (map_path..'deviltavern-visited.txt');
end;
else MessageBox (map_path..'deviltavern-visiternobiara.txt');
end;
end;Everything works perfectly, but the skill isn't being granted. Why?
__________________________________
nginx/0.8.54
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
__________________________________
nginx/0.8.54
for i=1,15 do
Trigger(OBJECT_TOUCH_TRIGGER,"dw"..i,"dwellingF")
end;
cr_count={10,30,20.....20}
cr_type={92,94,96.....105}
cr_cost={20,40,80.....1000}
function dwellingF(hero, obj_name)
n=<how do I get the object number here?>
AddHeroCreatures(hero,cr_type[n],cr_count[n])
SetPlayerResource(1,GOLD,GetPlayerResource(1,GOLD)-cr_count[n]*cr_cost[n]);
end;
Please advise. I have many identical objects on the map, and a hero can buy creatures from them using a script. The object names are "dw1", "dw2", "dw3", etc. Can I assign the same trigger to them so that the function receives the object number as a parameter, represented as a number, when the hero enters. Then, I can define the type, quantity, and cost of creatures for each object using an array.for i=1,15 do
Trigger(OBJECT_TOUCH_TRIGGER,"dw"..i,"dwellingF")
end;
cr_count={10,30,20.....20}
cr_type={92,94,96.....105}
cr_cost={20,40,80.....1000}
function dwellingF(hero, obj_name)
n=<how do I get the object number here?>
AddHeroCreatures(hero,cr_type[n],cr_count[n])
SetPlayerResource(1,GOLD,GetPlayerResource(1,GOLD)-cr_count[n]*cr_cost[n]);
end;
for i=1,15 do
if obj_name=="dw"..i then
n=i
end
end
Added 4 minutes later
That is, should all the skills necessary for it be present? And is there any way to do it without that?
consoleCmd('enable_cheats')
consoleCmd('add_skill 98')
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
I need to pass functions with parameter to the MessageBox and QuestionBox commands. How can I do this?
MessageBox(textPath.."vopros.txt", "function_ok('"..parametr1.."')");
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
I can't disable the circles under the monsters.
Here's what I tried:
SetObjectEnabled("archer1",0)
SetMonsterSelectionType("archer1",0)
The console says:
ScriptError: "archer1" is not disabled
Also, the second argument in SetObjectEnabled should be nil.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Is there a script that sets the maximum number of movement points? It must be above the nominal value.
For example, a standard 2500 would become 5000, but it wouldn't immediately fill the green bar, meaning it would move only halfway, even though it doesn't actually have more movement points.
Try this one:
function movenext()
while GetHeroStat("Ossir",STAT_MOVE_POINTS)>1000 do
sleep(7)
end
print( 'movepoints<1000')
ChangeHeroStat("Ossir",STAT_MOVE_POINTS,1500)
end
function add_move_points()
startThread(movenext)
end
Trigger(NEW_DAY_TRIGGER,"add_move_points");
Adds 1500 points each day.
Try this:It adds 1500 movement points each day.
function movenext()
while GetHeroStat("Ossir",STAT_MOVE_POINTS)>1000 do
sleep(7)
end
print( 'movepoints<1000')
ChangeHeroStat("Ossir",STAT_MOVE_POINTS,1500)
end
function add_move_points()
startThread(movenext)
end
Trigger(NEW_DAY_TRIGGER,"add_move_points");
Added 2 hours 33 minutes later
Is there a command that clears a single line in the console?
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
Is there a command that clears a single line in the console?
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In what sense does it "clear"? Does it delete the previous one?
So that it doesn't appear in the console.
For example, the line "Hitler is kaput" appears in the console. I want to delete it, without affecting the lines before it.
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4