Skip to content

Posts from Scripts

4.8 (8 ratings)
Auto-translated
function privet1F()
MessageBox("Maps\SingleMissions\xXx\Privet1D.txt");
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "privet1", nil);
end;

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "privet1", "privet1F");

Error
function privet1F not defined, line 1

Help, please, why is there an error and how can I fix it? :(

There is a region called privet1, and when you enter it, the message Maps\SingleMissions\xXx\Privet1D.txt appears.
User Avatar
Auto-translated
function privet1F not defined, line 1
This is not an error; the debugger in the editor is simply malfunctioning. It shouldn't be trusted.
 

К А
Стикеры GBF в Telegram
In reply to Победитель
User Avatar
Auto-translated
Help, none of the scripts are working! I tried it at a friend's place, and it didn't work there either, but at least the hero stopped when entering the region. Could it be because I have a licensed version of Heroes 5?
Auto-translated
Could you be more specific? Can you share the script?
And what does the license have to do with it? Do you think it will work better on a pirated copy? No.
Sincerely.
UPD: By the way, I have a question – what parameters are specified in what order for SetMonsterCouragenandMood and MakeHeroInteractWithObject?
Мои карты:
SinglePlayer: Выбор Зехира
Падение Стедвика(pre-release)
Готовится: Зима Титанов, Столетняя война
In reply to djulian13
User Avatar
Auto-translated
djulian13
By the way, I have a question: what parameters and in what order are specified for SetMonsterCouragenandMood and MakeHeroInteractWithObject?
I'm curious: why doesn't anyone want to use the standard manuals that come with the game or third-party ones? Or even just Google or search on this forum.
Янеч

function privet1F not defined, line 1
In the standard editor, the function must обязательно return something.
Instead of function privet1F () - function privet1F (bla), for example.
But essentially, this is not necessary, so you shouldn't pay attention to this warning from the editor, as Ment pointed out.

Maybe someone wants me to upload "everything for the editor" in one package?
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
Auto-translated
"I'm curious: why doesn't anyone want to use the standard manuals that come with the game or third-party ones?"
It's not mentioned in the official manual, nor in Novikov's.
And by the way, the last quote is definitely not from me.
Мои карты:
SinglePlayer: Выбор Зехира
Падение Стедвика(pre-release)
Готовится: Зима Титанов, Столетняя война
User Avatar
Auto-translated
In the second case, the first parameter is the hero's name, and the second is the object's name (which can also be a hero). Everything is as usual.
By the way, in the first case, everything is in the manual, you shouldn't have worried:
SetMonsterCourageAndMood – allows setting the monsters Courage and Mood with respect to
the specified player.
Syntax
{{{
SetMonsterCourageAndMood( monsterName, playerID, courage, mood )
}}}
Description
Sets the monster’s "monsterName" attitude to the heroes of the player "playerID" to the
values of "courage" and "mood".
The values (also described in "HOMM5_A2_IDs_for_Scripts.pdf"):
* "MONSTER_COURAGE_ALWAYS_JOIN"
* "MONSTER_COURAGE_ALWAYS_FIGHT"
* "MONSTER_COURAGE_CAN_FLEE_JOIN"
* "MONSTER_MOOD_FRIENDLY"
* "MONSTER_MOOD_AGGRESSIVE"
* "MONSTER_MOOD_HOSTILE"
* "MONSTER_MOOD_WILD"
The meanings of the values are similar to the "Courage" and "Mood" settings for the monsters
in the editor.
 

К А
Стикеры GBF в Telegram
In reply to djulian13
User Avatar
Auto-translated
Function deadstF()
MessageBox("Maps/SingleMissions/Town/Deadst.txt");
Trigger(REGION_ENTER_AND_STOP_TRIGGER, “deadst”, nil);
end;

Trigger(REGION_ENTER_AND_STOP_TRIGGER, “deadst”, "deadstF");

Here is the script. Could it be that it only works in the Heroes 5 editor, while I'm using the Tribes of the East editor?
User Avatar
Auto-translated
Here's the script. Maybe it only works in the Heroes 5 editor, but I'm using the Tribes of the East editor?
It's definitely not because of that.
There are several possible reasons. The best way to debug is to use the console. I personally had problems once because of an incorrect encoding of the .txt file (this is relevant if you printed it using Notepad instead of an editor; in that case, you need to consider that the game requires Unicode). Also, I'm not sure if "Maps/SingleMissions/Town/Deadst.txt" will work. It's better to write it like this: "/Maps/SingleMissions/Town/Deadst.txt", and even better: GetMapDataPath().."Deadst.txt".
 

К А
Стикеры GBF в Telegram
In reply to Победитель
User Avatar
Auto-translated
Hooray, hooray! There was one mistake there, and I kept repeating it. Now I want to create a script for a battle; can you tell me how to include the units that will be fighting?
User Avatar
Auto-translated
StartCombat(hero name, opponent hero name or nil, number of units, ID of the first unit, number of creatures in the first unit, ..., path to the script during combat or nil, trigger upon combat completion or nil, arena name or nil, allow quick combat);
 

К А
Стикеры GBF в Telegram
In reply to djulian13
User Avatar
Auto-translated
djulian13
"I'm curious: why doesn't anyone use the standard Manuals that come with the game or third-party ones?"
It's not mentioned in the official Manual, nor in Novikov's.
HOMM5_A2_Script_Functions

MakeHeroInteractWithObject
MakeHeroInteractWithObject – makes the hero interact with the specified object immediately,
even if the hero is not close to the object.


Syntax

{{{
MakeHeroInteractWithObject( heroName, objectName )
}}}

Description

The hero "heroName" interacts with the object "objectName" at the moment of the
command’s execution, regardless of his current position on the map.
HOMM5_A2_Script_Functions

SetMonsterCourageAndMood
SetMonsterCourageAndMood – allows setting the monsters' Courage and Mood with respect to
the specified player.

Syntax
{{{
SetMonsterCourageAndMood( monsterName, playerID, courage, mood )
}}}

Description

Sets the monster’s "monsterName" attitude to the heroes of the player "playerID" to the
values of "courage" and "mood".

The values (also described in "HOMM5_A2_IDs_for_Scripts.pdf"):

* "MONSTER_COURAGE_ALWAYS_JOIN"
* "MONSTER_COURAGE_ALWAYS_FIGHT"
* "MONSTER_COURAGE_CAN_FLEE_JOIN"

* "MONSTER_MOOD_FRIENDLY"
* "MONSTER_MOOD_AGGRESSIVE"
* "MONSTER_MOOD_HOSTILE"
* "MONSTER_MOOD_WILD"

The meanings of the values are similar to the "Courage" and "Mood" settings for the monsters
in the editor.
Both are in the standard Manual ;)
Although the best reference is Ment :smile04:
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
Auto-translated
Thank you. I have another question: how do I bury the Tear of Ashi?
In reply to Олегарх
Auto-translated
Oligarch
how to bury Ash's tear?
you take a shovel and go bury it :smile04: ...
Just place the 'Ash's tear' artifact in the desired location - it will bury itself.

Statistics

Welcome our newest member: Emil