Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to djulian13
User Avatar
14 years ago
Auto-translated
function mmmF()
if HasArtefact("Erasial", 66);
then MessageBox("/Maps/SingleMissions/1/art.txt");
ChangeHeroStat("Erasial", STAT_EXPERIENCE, 10000);
Trigger(OBJECT_TOUCH_TRIGGER, "mmm", nil);
else MessageBox("/Maps/SingleMissions/1/artno.txt");
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER, "mmm", "mmmF");

can you check where the error is?
In reply to Олегарх
14 years ago
Auto-translated
Oligarch

can you check where the error is?
here:
if HasArtefact ("Erasial", 66)==nil then...
or
if HasArtefact ("Erasial", 66)==not nil then...
What's up with the console?
In reply to JonnyP
User Avatar
14 years ago
Auto-translated
JonnyP

What's up with the console?
Which console are you referring to? Yes, what exactly is the error? I tried to fix it, but it didn't work.
In reply to Олегарх
14 years ago
Auto-translated
Oligarch
Which console?
Before you can use the cheat codes, you must first enable the console.
This requires that you edit two files. First, locate the autoexec_a2.cfg
file in your INSTALL FOLDER\Profiles folder. Open this file with Notepad
and add the following line to the end of the file (in the // Startup section):

setvar dev_console_password = schwinge-des-todes

Next, locate the input_a2.cfg file located in the following folder:
\MY DOCUMENTS\MY GAMES\HOMM5TOE\PROFILES\[br][/br]Open this file with Notepad and in the // console section,
add the following line:

bind show_console '`'

Once you've done the above, you can bring up the console by pressing [`]

It allows you to find errors in the script.
User Avatar
14 years ago
Auto-translated
if HasArtefact ("Erasial", 66)==nil then...
or
if HasArtefact ("Erasial", 66)==not nil then...
You can simply use if HasArtefact("Erasial",66) then...
He will understand, the main thing is to remove the semicolon.
In reply to JonnyP
User Avatar
14 years ago
Auto-translated
No, there isn't a console. Maybe there's another way to do it?
In reply to Олегарх
User Avatar
14 years ago
Auto-translated
Oligarch
no. there is no console, maybe it needs to be done differently?
They stole it :)
Yes, yes. Maybe it's because JonnyP's text isn't in Russian, so it's unclear:)
Or maybe you have a 64-bit Windows 7 and an Nvidia graphics card - in some cases, it really does get stolen ;)
The Almighty Google
In the directory where the game is installed, find the file "autoexec_a2.cfg":
...................Heroes of Might and Magic V/profiles/
Open it with a text editor.
Add the following line:

setvar dev_console_password = schwinge-des-todes

to the very end of the file, save the changes in the file.

In this directory, find the file "input_a2.cfg":
C:/Documents and Settings/Your_name/My Documents/My Games/Heroes of Might and Magic V/HOMM5TOE(or something like that)/Profiles/Your_name/
Open it with a text editor.
After the text:

// obsolete, but strictly need for compability with some interfaces
bind close_window 'ESC'
bind confirm_action 'ENTER'
bind confirm_action 'NUM_ENTER'

Add the following line:

bind show_console '`'

Save the changes in the file.

Launch the game, launch any mission, open the console using the '`' key, and type this command in the console:

enable_cheats

Press the "Enter" key.
That's it!
In reply to Dyrman
User Avatar
14 years ago
Auto-translated
Dyrman
They stole it :)
Yes, they did. Maybe it's because JonnyP didn't write it in Russian, so it's unclear:)
Or maybe you have a 64-bit Windows 7 and an Nvidia graphics card - in some such cases, it was indeed stolen ;)
I was doing that. My system is 32-bit Windows 7, and my graphics card is Nvidia.
User Avatar
14 years ago
Auto-translated
A question arose. Is there a trigger that activates if a player has no towns and no heroes, meaning the player has lost? And there's a problem. When the 'obj1' objective is completed, the mission immediately ends with the player winning. What could be causing this?
In reply to Победитель
14 years ago
Auto-translated
Winner
A question arose. Is there a trigger that activates if a player has no towns and heroes, meaning the player has lost? And there's a problem. When the 'obj1' task is completed, the mission immediately ends with the player winning. What could be causing this?
It's not exactly a trigger, but you can do it this way:
function lost_PL4()
if GetPlayerState(PLAYER_4)~=1 then
.....................
end;
end;
and we attach a trigger to the 'lost_PL4' function when the player loses a hero
Trigger (PLAYER_REMOVE_HERO_TRIGGER,PLAYER_4,'lost_PL4');

either the 'Ignore' parameter in 'obj1' is set to 'false', or your task is recorded not in 'objectives', but in 'scenario informations'.
In reply to JonnyP
User Avatar
14 years ago
Auto-translated
JonnyP
Not exactly a trigger, but you can do it like this:
function lost_PL4()
if GetPlayerState(PLAYER_4)~=1 then
.....................
end;
end;
and we attach the 'lost_PL4' function to a trigger that detects when a player loses a hero
Trigger (PLAYER_REMOVE_HERO_TRIGGER,PLAYER_4,'lost_PL4');

either 'obj1' has 'false' in the 'Ignore' parameter, or your task is recorded not in 'objectives', but in 'scenario informations'
The trigger didn't work. I'm confused by "~=1". Should I have replaced it with something else, or was it supposed to be written exactly like that? It didn't produce any errors, it just didn't work.

The original idea was to have the quest completed when two towns are captured, but the script I found in another map didn't work. Maybe we can come up with something here?

I replaced 'false' with 'true' in all objectives. Now, when that quest is completed, the player receives a defeat :(.
User Avatar
14 years ago
Auto-translated
~=1
This means "not equal to".
I don't know about Ignore, but there's also a parameter called NeedComplete (it should mean that the quest needs to be completed; if these parameters are not set, completing the remaining quests should be enough to win).
User Avatar
14 years ago
Auto-translated
Didn't help :(. It's some kind of mystery. So, I'll have to remove this task. And regarding completing the task when another player is defeated? Can you offer any suggestions?
In reply to Победитель
14 years ago
Auto-translated
Winner


And regarding completing the task after defeating another player? Can you offer any advice? :)
That's strange, I did exactly as I described - after defeating 4 enemy heroes, the task is completed.
Here, `GetPlayerState` retrieves the current state of the player,
and `'~=1'` means "not equal to," and any number can be used; for more details, see the manual:
Returns the player's participation/win/loss state: 0 - the player is not participating in the game,
1 - the player is still playing, 2 - the player has lost, 3 - neither of the above (possibly won, but it cannot be said for sure).


Added 6 minutes later
Ment
This means "not equal to."
But there is also a `NeedComplete` parameter (it should be completed; if these parameters are not set, completing the remaining quests will be enough to win).
It's better not to touch it at all - it's not used.
I'll write it like this: If you set 'Ignore' to 'false', then after completing this task, the mission will be won, ignoring other tasks
In reply to JonnyP
User Avatar
14 years ago
Auto-translated
JonnyP
That's strange, I did exactly as I described – the quest is completed when 4 enemy heroes are defeated.
Here, GetPlayerState retrieves the current state of the player,
and '~=1' means 'not equal to,' and any number can be used; for more details, see the manual:
Returns the player's participation/victory/defeat status: 0 – the player is not participating in the game,
1 – the player is still playing,
2 – the player has lost,
3 – neither of the above (possibly won, but it cannot be said for certain).
Thank you, I'll try setting it to 2. Regarding Ignore – I changed it to 'true,' and now, when this quest is completed, a message about the defeat is displayed.

Statistics

Welcome our newest member: recijeb