Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
#2008
Auto-translated
Click on the hero in the editor, go to ObjectPropretiesTree (the panel on the left). Find the line "Shared". Click on the line, click on the "..." button that appears to edit the hero (or "new" to create a new one). In the window that opens, you need to change the hero's class from "barbarian" to something else, and also change the initial skills and abilities to barbarian skills. Something like that.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
#2009
Auto-translated
Asket2,

Here, I've made a campaign template. Each file has its own functionality.

1. campaign.xdb - the campaign itself.
Tags to fill in:
InternalName - internal name of the campaign, in this template = Asket2Campaign
NameFileRef, FullNameFileRef, NameCommentFileRef - links to files with the campaign name and description. The links are set, you only need to change the texts themselves.
DependentCampaigns - campaigns that must be fully completed for this one to work. Leave this tag empty.

Missions - campaign missions. The tag consists of 1-5 Item subtags.
Each Item contains:
NameFileRef, NameCommentFileRef - links to texts with the mission name and its comment.
MissionTag - link to the map-tag.xdb file; for convenience, each map (contents of maps/singlemissions/*mapname*/) is located in folders M1-M5.
Bonuses - bonus awarded before the start of the campaign.
The tag consists of 0-3 Item subtags, each Item contains:
<Target>
<Hero/> скриптовое имя героя, получающего бонус
</Target>
<Type>E_BONUS_ARTIFACT</Type> тип бонуса
<BonusArmy> тип и кол-во существ
<Creature>CREATURE_UNKNOWN</Creature>
<Count>0</Count>
</BonusArmy>
<BonusArtifactID>GOLDEN_HORSESHOE</BonusArtifactID> артефакт
<BonusResources> ресурс
<Wood>0</Wood>
<Ore>0</Ore>
<Mercury>0</Mercury>
<Crystal>0</Crystal>
<Sulfur>0</Sulfur>
<Gem>0</Gem>
<Gold>0</Gold>
</BonusResources>
<BonusSpellID>SPELL_NONE</BonusSpellID> заклинание
<Building>TB_TOWN_HALL</Building> строение
HeroesPool - heroes that carry over from one mission to another. Count - the number, Heroes consists of Items:
HeroScriptName - script name of the hero
TargetCampaign - the campaign the hero moves to. If it's the same one, it can be left empty.
TargetMission - mission number minus 1.

Next are the tags for mission music:
startMusics - music at the start, presumably of the mission
additionalAdventureMusics - additional music on the map
additionalWaitMusics - additional music during the computer player's turn
additionalCombatMusics - additional battle music

Music tags for the entire campaign:
AdventureMusic - on the map
WinMissionMusic - victory
LoseMissionMusic - defeat

The music tags in the template are filled with the corresponding links from the campaign "In Honor of Our Fathers".

DescriptionFileRef - campaign description
Icon - campaign icon
UserCampaign - whether the campaign is user-made.

2. M1-M5 - folders for maps.
3. The remaining files - mostly described in item 1.
Attachments 1
1 file attached • Total size: 5.9 KB
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
#2010
Auto-translated
Wow, thanks.

Added after 2 hours and 34 minutes
I need a script that awards victory to the first player to find the artifact.
In reply to Аскет2
User Avatar
#2011
function checkArtefact()
while 1 do
for i, hero in GetPlayerHeroes(1) do
if HasArtefact(hero, id_артефакта) then
Win(1)
return
end
end
sleep(10)
end
end

startThread(checkArtefact)
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
#2012
Auto-translated
Oh yeah, by the way. I found something, let's just say, a feature: after I downloaded the Template from RedHeavenHero, a map (so far, only one) started being added to any campaign under any name. Has anyone else encountered this?

Added after 17 hours and 43 minutes
Um, how do you create a topic if the map is unfinished, but you want to upload it to see what to add, simplify, fix, etc.?

Added after 12 minutes
And can a map be named with numbers?

Added after 12 minutes
And another question: how do you leave artifacts with a hero?

Added after 1 minute
And another question: how do you leave artifacts with a hero?

Added after 34 seconds
Sorry for the copy, it lagged for some reason.
#2013
Auto-translated
By the way, I'll upload the second map of the campaign soon. If anyone wants to test it, write me a private message. You can also send your suggestions there, and if you have time, you can offer your help.

Added after 14 hours and 52 minutes
I need help: the hero doesn't move to the second mission in the campaign. How can I make him move to it?

Added after 20 minutes
I also need a script that will take a certain amount of resources.
User Avatar
#2014
Auto-translated
1. Let's see the campaign.xdb file! 2.
SetPlayerResource(PLAYER, RESOURCE_TYPE, GetPlayerResource(PLAYER, RESOURCE_TYPE) - AMOUNT)
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
#2015
Auto-translated
But the thing is, when I do it through the editor, it seems to be transferred.
Attachments 1
1 file attached • Total size: 1015 B
#2016
Auto-translated
So? What’s wrong? Or is it the maps?

Added 12 hours and 3 minutes ago
If there are several resources, should I add the resource type?

Added 5 minutes ago
By the way, a character with the Goblin King skill cannot be created on the map. Could this be why he doesn’t switch sides?

Added 48 minutes ago
function Newday()
local day, wday, week, month = GetDate(DAY), GetDate(DAY_OF_WEEK), GetDate(WEEK), GetDate(MONTH)
if wday == 2
then MessageBox(GetMapDataPath().."Newday.txt")
Trigger(NEW_DAY_TRIGGER, "Newday")
SetPlayerResource(1, GOLD, ORE, GEMS, CRYSTALS, MERCURY, SULFUR, WOOD, GetPlayerResource(ORE, GEMS, CRYSTALS, MERCURY, SULFUR, WOOD) - 5, GetPlayerResource(1, GOLD) - 5000)
end
end

Trigger(NEW_DAY_TRIGGER, "Newday")
What is wrong with this script?
In reply to Аскет2
User Avatar
#2017
Auto-translated
Aescet2
If there are several resources, should we add the resource type?

here
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
#2018
Auto-translated
Oops, there’s a virus there.
User Avatar
#2019
Auto-translated
SetPlayerResource(1, GOLD, ORE, GEMS, CRYSTALS, MERCURY, SULFUR, WOOD, GetPlayerResource(ORE, GEMS, CRYSTALS, MERCURY, SULFUR, WOOD) - 5, GetPlayerResource(1, GOLD) - 5000)

Everything is wrong in this line. Please refer to the manual.
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
#2020
Auto-translated
Well, my repack doesn't include the Russian manual.
In reply to Аскет2
User Avatar
#2021
Auto-translated
Aset2
Well, my repack doesn't include a Russian manual.

/files/10086/>
try downloading it here

Added 1 minute ago
And yes, why declare the newday trigger twice? It's enough to declare it only once for the entire game

Added 14 minutes ago
You can also take other scenario maps and look at their scripts. This is a great way to learn new things and find out how to write certain functions correctly.
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
#2022
Auto-translated
Regarding the bug: I found it and fixed it, so no help is needed. Phew (a loud sigh of relief).

Added 32 minutes ago
I still don't understand how to transfer heroes.

Added 3 hours 6 minutes ago
I finally achieved my goal. I'll upload the map tomorrow along with the first file and the Campaigns file.

Added 18 hours 46 minutes ago
function QuestPervii()
if HasArtefacts ("Hero9", 76, 79)
then MessageBox (GetMapDataPath().."QuestPervii.txt")
ChandeHeroStat ("Hero9", STAT_DEFENSE, 7)
ReamoveArtefact ("Hero9", 76, 79)
Trigger(OBJECT_TOUCH_TRIGGER, "Pervii", nil)
else MessageBox (GetMapDataPath().."LoseL.txt")
end;
end;

Trigger(OBJECT_TOUCH_TRIGGER, "Pervii", "QuestPervii")

function QuestVtoroi()
if HasArtefacts ("Hero9", 83)
then MessageBox (GetMapDataPath().."QuestVtoroi.txt")
ChandeHeroStat ("Hero9", STAT_OFFENCE, 7)
ReamoveArtefact ("Hero9", 83)
Trigger(OBJECT_TOUCH_TRIGGER, "Vtoroi", nil)
else MessageBox (GetMapDataPath().."LoseLI.txt")
end;
end;

Trigger(OBJECT_TOUCH_TRIGGER, "Btoroi", "QuestVtoroi")
Can you tell me where the error is here? Because the scripts that follow aren't working.

Added 6 minutes ago
I found the error, no help is needed. I just needed to remove something

Statistics

Welcome our newest member: leyu