Posts from Scripts
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.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Added after 2 hours and 34 minutes
I need a script that awards victory to the first player to find the artifact.
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)
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
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.
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.
SetPlayerResource(PLAYER, RESOURCE_TYPE, GetPlayerResource(PLAYER, RESOURCE_TYPE) - AMOUNT)
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
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?
Пробуждение зла
Нашествие из Преисподней
Смена эпох
Скачать все кампании одним архивом: Яндекс.Диск Google.Диск
You can download the set of 3 Campaigns (English version) here
Одиночные сценарии Heroes V 3.1:
Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы
Мультиплеерные карты для Heroes V 3.1:
Легендарная война
Сердце вулкана
Передел мира
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.
Пробуждение зла
Нашествие из Преисподней
Смена эпох
Скачать все кампании одним архивом: Яндекс.Диск Google.Диск
You can download the set of 3 Campaigns (English version) here
Одиночные сценарии Heroes V 3.1:
Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы
Мультиплеерные карты для Heroes V 3.1:
Легендарная война
Сердце вулкана
Передел мира
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.
Пробуждение зла
Нашествие из Преисподней
Смена эпох
Скачать все кампании одним архивом: Яндекс.Диск Google.Диск
You can download the set of 3 Campaigns (English version) here
Одиночные сценарии Heroes V 3.1:
Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы
Мультиплеерные карты для Heroes V 3.1:
Легендарная война
Сердце вулкана
Передел мира
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