Auto-translated
Posts from Scripts
Auto-translated
In my opinion, the talkbox still doesn't work in version 3.1. The game also doesn't recognize it as a command.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
Auto-translated
Auto-translated
The console displays "value was nil when getting global with name TalkBoxForPlayers".
This means the game doesn't recognize it as a command. But I'm using version 3.1.
Provide your code snippet – it seems like your script is poorly written.
Auto-translated
share your code snippet - because it looks like your script is poorly written
Auto-translated
TalkBoxForPlayers(1, "face_Dugal", "kuzn_might", "otv", 0, "mes", GetMapDataPath().."mes2", 2);
Now, let's play a game of 'find five differences':smile09:
Auto-translated
TalkBoxForPlayers (PLAYER_1,face_Dugal,bio_Dugal,nil,nil,'TALK',0,name_Dugal,GetMapDataPath().."names_and_desc/q000.txt",1,GetMapDataPath().."dialogs/derin001.txt");
Now let's play a game of 'find five differences':smile09:
Auto-translated
I'm an idiot!!!!! I have version 3.0!!!:smile35:
:)
--------------
The command: EnableAutoFinish() doesn't work for me. I set it to nil, but the battle ends when unsummoned creatures are destroyed... Does anyone know how to use it correctly?)
Added 15 minutes later
I'm an idiot!!!!! I have version 3.0!!!:smile35:
:)
--------------
The command: EnableAutoFinish() doesn't work for me. I set it to nil, but the battle ends when unsummoned creatures are destroyed... Does anyone know how to use it correctly?)
============
I'm also interested in how the wait function works, what parameters does it have? For example, the situation is as follows:
There is a function - AttackerCreatureDeath. When the creature I need dies, I summon another creature to its position (for now, it's simple), but I also remove its body, and that's where the fun begins)). No matter how many seconds of delay I set (sleep(1-100)), the body disappears before the creature (which is still alive) is actually hit. Visually, it looks like an enemy creature is hitting an empty space, from which the number of dead creatures flies away, and then other creatures are summoned. So I decided to try using wait, but I can't understand how this function works and what parameters it can have.
P.S. sorry for the long text :smile26:
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Auto-translated
I'm not very good with combat scripts. I've encountered a similar problem, but I managed to work around it without finding a solution. In general, I think it's better not to change the victory conditions in battles; nothing good will come of it anyway. For example, in the developers' map (campaign 6, mission 5 – by the way, that's the best place to look at combat scripts, as there weren't any more complex scripts in the entire game), the "banishment" spell allowed you to end the battle as soon as it was your hero's turn, which is, to put it mildly, imbalanced.
Auto-translated
Not very strong in combat scripts. I also encountered a similar problem, but I somehow managed without solving it. In general, I think it's better not to change the victory conditions in battle; nothing good will come of it anyway. For example: on the developers' map (campaign 6, mission 5, by the way, it's best to look at combat scripts there, as there were no more complex scripts in the entire game), the "banishment" spell allowed you to end the battle as soon as your hero's turn came, which is, to put it mildly, imbalanced.
By the way, I've been wanting to know for a long time where the scripts from the original Heroes 5 campaigns are located? I only find the campaigns from the 2nd add-on "Hammers of Fate" in data.pak, and there are no campaigns from the 3rd add-on "Tribes of the East" either.
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Auto-translated
Actually, this applies to the original Heroes of Might and Magic V. If you don't have them, you can get the necessary files here.
Auto-translated
The command EnableAutoFinish() doesn't work for me. I set it to nil, but the battle ends when unsummoned creatures are destroyed... Does anyone know what I'm doing wrong?
Put it in the Start() function.
As for the creature death function, it's simple: it's called when the creature is already dead - it was given the task to attack - that's it, it's immediately considered dead. But the computer doesn't have time to play the animation, and it doesn't look good visually :smile18:
It's better not to use sleeps at all - they are not very useful in combat. I haven't encountered any problems with wait. :)
Auto-translated
So, it just didn't work ;)
Put it in the Start() function.
As for the function that handles creature death, it's simple: it's called when the creature is already dead – you give it the task to attack, and it's immediately considered dead. But the computer doesn't have time to play the animation, and it doesn't look good visually :smile18:
It's better not to use sleeps at all – they're not very useful in combat. I haven't encountered any problems with wait. :)
Well, maybe they're not *that* useful, but without them, you can't cast spells properly... So, I decided to use a delay in the function, and it seems logical:
function AttackerCreatureDeath(creatureName)
if GetCreatureType(creatureName) ~= 36 then
AttackerDeathCount = AttackerDeathCount-1;
count = GetCreatureNumber(creatureName);
spawnCount = count/3;
if spawnCount ~= 0 then
local x, y = GetUnitPosition(creatureName);
sleep(50);
removeUnit(creatureName);
sleep(5);
SummonCreature(ATTACKER, 36, spawnCount, x, y);
end;
end;
end;But sleep(50) is a whole 10 seconds, and all this happens in 2 seconds... What could be wrong here? Maybe I messed something up :smile39: ?Added 7 minutes later
By the way, while I was browsing the common scripts, I came across a function that wasn't mentioned in any of the guides (or maybe I just didn't look hard enough): showMessage(parameter, some number)
If I understand correctly, this command can be used to send a message to the combat log (where it shows who hit whom and for how much)
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Auto-translated
No, this is needed for the training battle mode. The combat functions are best viewed in data.pak/scripts/combat-startup.lua. Oh, well, you probably looked there already.
Auto-translated
Well, it doesn't really help; without them, you can't cast spells properly (for example)... So, I decided on the function and logically implemented it using a delay:But sleep(50) is a whole 10 seconds, and all this happens in 2 seconds... What could be wrong here? Maybe I messed something up :smile39: ?function AttackerCreatureDeath(creatureName)
if GetCreatureType(creatureName) ~= 36 then
AttackerDeathCount = AttackerDeathCount-1;
count = GetCreatureNumber(creatureName);
spawnCount = count/3;
if spawnCount ~= 0 then
local x, y = GetUnitPosition(creatureName);
sleep(50);
removeUnit(creatureName);
sleep(5);
SummonCreature(ATTACKER, 36, spawnCount, x, y);
end;
end;
end;
Added 7 minutes later
By the way, while browsing the common scripts, I came across a function that isn't mentioned in any guide (or maybe I just didn't look hard enough): showMessage(parameter, some number)
If I understand correctly, this command can be used to send a message to the combat log (where it shows who hit whom and for how much).
Statistics
Welcome our newest member:
Emil
