Skip to content

Posts from Scripts

4.8 (8 ratings)
Auto-translated
I understand what you want. I hope your price is in gold, right? Because I have no idea how to change a resource.

Added after 7 hours 59 minutes
Regarding artifacts. You can create something like a shop. You place the artifacts that will be sold and you need to give each one a name for the script. And create a one-time trigger for each artifact. Which will call a function, in which: a question is asked, do you want to buy ARTIFACT NAME for ARTIFACT PRICE. If the answer is yes, then it checks for the availability of the required amount of the necessary resource, and if successful, the player receives the artifact and the price is deducted. Otherwise, a message is displayed that there is not enough money. Do you understand?
User Avatar
Auto-translated
Scripting Guide

An updated version (1.04) of the Scripting Guide for Beginner Mapmakers (pdf file, 1 MB) is now available. This is essentially an introductory course for those who would like to use scripts in their Heroes V maps but don't even know where to start. The guide covers typical questions and ways to solve them. The author is a well-known mapmaker, [url="http://forums.ag.ru/?action=viewprofile&username=OgoI"Ogo-i[/url].

Taken from http://heroes.ag.ru/
I hope this helps you find answers to some of your questions.
Тьма - это то, что позволяет смертным не забывать, как ярок бывает свет.
Auto-translated
The manual is mediocre. It TEACHES the basics. Perfect for those unfamiliar with scripts!
User Avatar
Auto-translated
Hello, I'm having trouble with a script that prevents me from fully completing a mission. Here's the code: ``` function Complete_obj_start() while 1 do sleep(10); if (GetObjectOwner("E1") == PLAYER_1) then SetObjectiveState('obj2',OBJECTIVE_COMPLETED); startThread(Objective); sleep(5); break; end; end; end; function Objective() if GetObjectiveState("obj4") == OBJECTIVE_COMPLETED then MessageBox("/Maps/SingleMissions/SecretIsle/MasengDruid.txt"); SetRegionBlocked("blockregion", false, PLAYER_1); end; end; ``` In a similar case (on Nivlov's maps), it works, but in my case, it doesn't react at all. What's wrong with it?
User Avatar
Auto-translated
So, I approach the artifacts shop, and there, for example, a shield and a sword are displayed.
The sword costs 1200 gold, and the shield costs 1100.
The sword gives +3 attack, and the shield gives +3 armor.
I click to buy, and I'm asked: Are you sure you want to buy this?
The sword remains in the shop, and it appears in my backpack. )
Is it possible to do this? (I'm just creating a map similar to Dota Allstars!)
In the future, the map will be really great...
In reply to †G¤bli№†
User Avatar
Auto-translated
:smile45: Those who are well-versed in scripting, please tell me: how can I make it so that all troops are removed from a specific garrison after a condition is met: only one of eight specific heroes survives. Or, as long as more than one hero is alive, the empty garrison cannot be passed through.:smile45:

Added 2 minutes later
Also, are there any guides on scripting for the Stronghold? In version 3.0. For example, from the respected Novik65.
In reply to Ser9K
Auto-translated
Ser9K;132300
Hello, I'm struggling with a script that prevents me from completing a mission.
Here's the snippet:
function Complete_obj_start()
while 1 do
sleep( 10 );
if (GetObjectOwner("E1") == PLAYER_1) then
SetObjectiveState('obj2',OBJECTIVE_COMPLETED);
startThread( Objective );
sleep( 5 );
break;
end;
end;
end;

function Objective()
if GetObjectiveState("obj4") == OBJECTIVE_COMPLETED then
MessageBox("/Maps/SingleMissions/SecretIsle/MasengDruid.txt");
SetRegionBlocked( "blockregion", false, PLAYER_1 );
end;
end;

In a similar case (on Nival maps), it works, but in my case, it doesn't react at all. What's wrong with it?

Well, here's the situation: the first function, as I understand it, is simply copied from some map... Inside the function, there's a request to check the ownership of the object "E1"... Did you add this object? I doubt it, to be honest...

The second function checks the state of the task "obj4"; if it's completed, then it's okay. Is this task present on your map? Then, the function unlocks a separate region... Is it marked on your map? In general, try writing your own script instead of copying it from the standard ones... In my opinion, if you think it through, you'll come up with something even better than what the developers did... :smile42:
User Avatar
Auto-translated
Hooray, now our theme won't be outdated anymore! But still, how can I fulfill my requests mentioned above?
User Avatar
Auto-translated
Hi, does anyone know what the problem is? When I enter the code to call up the console at the end of the autoexec_a1.cfg file — setvar dev_console_password = schwinge-des-todes — I press the tilde key, but nothing happens http://forum.heroesworld.ru/images/smilies/smile32.gif
In reply to camrADD
User Avatar
Auto-translated
camrADD;140950
Hello, does anyone know what the problem is? When I enter the code to activate the console at the end of the autoexec_a1.cfg file - setvar dev_console_password = schwinge-des-todes - and press the tilde key, nothing happens. http://forum.heroesworld.ru/images/smilies/smile32.gif
And it won't work. I tried to enable the console for a week and couldn't. I tried everything. Conclusion: there is probably an error in the console activation code, or the console cannot be activated - it's a developer error.
Let`s play online Heroes.Always in game :smile33:
In reply to Архидемон
User Avatar
Auto-translated
I'm not very good at scripts, so I'd like to learn! I'd like to start with the basics (Nival's introductory guide). My Heroes 5 3.0 game is completely in Russian, but Nival's descriptions are in English.
I would really appreciate it if you could upload or provide a link to Nival's introductory guide.
:smile02: Thank you in advance :smile02:
In reply to Архидемон
User Avatar
Auto-translated
Archdemon;141088
It won't help. I spent a week trying to configure this console and couldn't. I tried everything. Conclusion: there's probably an error in the console call code, or the console can't be called – it's a developer error.


NOPE, it worked for my brother!:D But it disappeared after 2 days of use. And now it doesn't work:confused:
User Avatar
Auto-translated
Guys! Can anyone help me, please? I'm creating a map where I need to make it so that when a specific hero enters a specific area of the map, a garrison joins them (joins the player who is playing as that hero). What do I need to write in the script to make this happen? I wrote this: function Connecting () SetObjectOwner( "Garrison", PLAYER_1 ); Trigger( REGION_ENTER_AND_STOP_TRIGGER, "Connecting", nil ); end; Trigger( REGION_ENTER_AND_STOP_TRIGGER, "Connecting", "Connecting" ); but it doesn't work. Can anyone help me, please? I would be very grateful. :confused:
In reply to Пещерный Владыка
User Avatar
Auto-translated
HELP!!!!! NONE OF MY SCRIPTS ARE WORKING!!!! EVEN THE ONES I JUST COPIED!!!! AAAAA!!!!!
P.S. Here's one of my scripts; if there's an error, please tell me where:
function "unnamed 0" ()
Loose;
Trigger(REGION_ENTER_WITHOT_STOP_TRIGGER, "unnamed 0", nil );
end;
Trigger(REGION_ENTER_WITHOT_STOP_TRIGGER, "unnamed 0","unnamed 0" );

:smile33:

Added 4 hours 45 minutes ago
AAAA!!!! I'M GOING CRAZY!!!! I WANT A SCRIPT!!!! AAAAA!!!! :smile35: :smile35: :smile35: :smile35: :smile35: :smile35: :smile35:
In reply to Adonidi
User Avatar
Auto-translated
Adonidi;156713
HELP!!!!! NONE OF MY SCRIPTS ARE WORKING!!!! EVEN THE ONES I JUST COPIED!!!!
Where are you putting them? You need to use the map properties. Scripts don't work in other places (at least not for me).

Statistics