Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
11 years ago
Auto-translated
This happened in the "In the Wake of Gods" campaign, in the "Tribes of the East" faction, in the third mission. There, knights fought each other on a bridge.
User Avatar
11 years ago
Auto-translated
I was trying to make it for the single-player mode, but it didn't work. The other scripts play fine, but these ones don't.
What exactly happens? Does nothing play at all, or do the monsters just flail their arms and return to their original position?
If it's the latter, then the monsters either don't have the corresponding animation or the animation set for the arena isn't specified in the monster's settings.
What does the console say?
In reply to Spectral
User Avatar
11 years ago
Auto-translated
Spectral
What exactly is happening? Is nothing playing at all, or are the monsters just standing still and returning to their original position?
If it's the latter, then the monsters either don't have the corresponding animation or the animation set for the arena isn't specified in the monster's settings.
What does the console say?
Nothing happens at all. I enter the region, and they just stand in place. They don't move their arms. Nothing plays.
User Avatar
11 years ago
Auto-translated
What player are you playing as? If not player 1, then in the function, you need to replace 1 with the number of the human player.
In reply to inQizitOr
User Avatar
11 years ago
Auto-translated
inQizitOr
I was trying to make it work for the single-player mode, but it still didn't work. All the other scripts play correctly, but these ones don't.
Maybe these scripts are interfering? Please show the complete script.
In reply to RedHeavenHero
User Avatar
11 years ago
Auto-translated
RedHeavenHero
Maybe these scripts are interfering? Show the complete script.
function play_anims()
if GetCurrentPlayer() ~= 1 then return end
Trigger(REGION_ENTER_AND_STOP_TRIGGER, 'q0', nil)
PlayObjectAnimation("q17", "death", ONESHOT_STILL)
sleep(3)
end
Trigger(REGION_ENTER_AND_STOP_TRIGGER, 'q0', 'play_anims')
PlayObjectAnimation("q1", "attack00", IDLE)
PlayObjectAnimation("q2", "attack00", IDLE)
PlayObjectAnimation("q3", "attack00", IDLE)
PlayObjectAnimation("q4", "death", ONESHOT_STILL)
PlayObjectAnimation("q5", "attack00", IDLE)
PlayObjectAnimation("q6", "attack00", IDLE)
PlayObjectAnimation("q7", "attack00", IDLE)
PlayObjectAnimation("q8", "attack00", IDLE)
PlayObjectAnimation("q9", "attack00", IDLE)
PlayObjectAnimation("q10", "attack00", IDLE)
PlayObjectAnimation("q11", "attack00", IDLE)
PlayObjectAnimation("q12", "attack00", IDLE)
PlayObjectAnimation("q13", "attack00", IDLE)
PlayObjectAnimation("q14", "death" , ONESHOT_STILL )
PlayObjectAnimation("q15", "attack00", IDLE)
PlayObjectAnimation("q16", "attack00", IDLE)
SetObjectEnabled ('q4' , nil)
SetObjectEnabled ('q14' , nil)
User Avatar
11 years ago
Auto-translated
Could you provide a script that, when I enter a specific region, teleports a hero (demon) to my location and attacks me?
User Avatar
11 years ago
Auto-translated
function TeleportDemon(hero) if GetCurrentPlayer()==1 then SetObjectPosition('attacking hero name',x,y,level number); sleep(2); MakeHeroInteractWithObject('attacking hero name',hero); end; end; Trigger(REGION_ENTER_AND_STOP_TRIGGER,'region name','TeleportDemon')
11 years ago
Auto-translated
I need a script that will cause the mission to fail after the hero dies. Thanks in advance.
When editing through the map editor, the game crashes.
In reply to Аскет2
User Avatar
11 years ago
Auto-translated
Aescet2
I need a script that will cause the mission to fail after the hero dies. Thanks in advance.
When editing through the map editor, it crashes.

function alive()
while IsHeroAlive("script_hero_name") do
sleep(10)
end
Loose()
end

startThread(alive)


Added 1 minute ago
If the editor crashes, try editing the script using Notepad.
11 years ago
Auto-translated
So, the question is: can you explain how the HoMM5MapScriptsEditor works? I don't understand how to use it with Notepad. If anything, I'm a complete beginner in this.

Added after 55 minutes
It's not working.

Added after 5 minutes
I don't understand how to make the script work. Where should I put it so that it works?
User Avatar
11 years ago
Auto-translated
Open the map file using an archiver, navigate to /maps/singlemission_or_multiplayer/map_name/. Open the map.xdb file with a text editor, find the line `` and change it to `` and save. Add the MapScript.xdb file with the following content to the same folder: `

` And the MapScript.lua file, where you need to write the script.
11 years ago
Auto-translated
I think I did everything right, but it doesn't work. I inserted everything, wrote everything, but there's no effect.
In reply to Аскет2
User Avatar
11 years ago
Auto-translated
Aset2
I think I did it, but it doesn't work. I inserted everything, wrote everything, but there's no effect.
The script is written incorrectly:
Instead of
Loose(Player, 1)
it should be
Loose()
-- or --
Loose(1)
Everything else is done correctly.

Added 7 minutes later
If the map is intended for single-player, it's worth renaming the RMG folder to SingleMissions; otherwise, it will be displayed in the multiplayer map menu.
In reply to RedHeavenHero
11 years ago
Auto-translated
Thank you very much.

Added 9 minutes later
Should I create a new file for each new script?

Statistics

Welcome our newest member: recijeb