Does anyone know how to use this function?
Play2DSound(SoundName);
There are only slight difficulties if you add a sound to the game yourself – this needs to be done during export, similar to adding models.
New here? I'm Roha — want a quick tour?
Does anyone know how to use this function?
Play2DSound(SoundName);
A very important question about Heroes 5, the map editor. I am creating a map. In the Heroes scenario, there is Railag, who has the ability "Terrifying" - the higher the hero's level, the more the initiative of enemy units decreases, 1% for each hero level. But I want to add Railag with the ability "Master of Initiative" in the editor - for each hero level, the initiative of enemy units decreases by 1%, and for each hero level, the initiative of units under the hero's command increases by 1%, so for each hero level, the initiative of your own units increases by 1%, and the initiative of the enemy decreases by 1%. But there is no Railag with that ability. Only with the "Terrifying" ability. Is it possible to change his ability in the editor or add this Railag with the "Master of Initiative" ability? Or how can I make him appear there?
It works the same way as with effects and videos. Nothing special.
There are only slight difficulties if you add sound to the game yourself – this needs to be done during export, similar to adding models.
In the properties tree, find Shared, click on "..." in that field, and find the Railag_A1 hero in the game's resource tree on the left.
the chain is called SPELL_UBER_CHAIN_LIGHTNING, and the wave, if I'm not mistaken, is SPELL_BOSS_FIREWALL. in the spellIds field of the desired hero, you select these spells.
It works the same way as with effects and videos. Nothing special.
There are only slight difficulties if you add sound to the game yourself – this needs to be done during export, similar to adding models.
StartDialogScene("/Maps/SingleMissions/NewRandomMap 19/StartScene2/DialogScene.xdb#xpointer(/DialogScene)");
Sounds (used in the Play2DSound/Play3DSound functions)
Where to find them:
/Sounds/_(Sound)/
Postfix:
#xpointer(/Sound)
Example paths:
-- Haste spell
'/Sounds/_(Sound)/Spells/Haste.xdb#xpointer(/Sound)'
-- Positive morale
'/Sounds/_(Sound)/Spells/GoodMoral.xdb#xpointer(/Sound)'
-- Catapult attack
'/Sounds/_(Sound)/WarMachines/Catapult/attack.xdb#xpointer(/Sound)'
-Is it possible to redirect console output to a file?
consoleCmd('game_writelog 1')
print('...')
consoleCmd('game_writelog 0')
It might also be helpful to separate the enabling and printing with pauses.
There's a method in the file GAME_FOLDER/profiles/autoexec_a2.cfg to modify the line containing the words "write_log"; the console output will then be written to the file GAME_FOLDER/bin/console.txt. I did this a long time ago, and I clearly remember it working (possibly on version 3.0). Several years later, after reinstalling the game, I wanted to do it again, but I couldn't find the "write_log" words in that file, and I didn't look into it further. Unfortunately, I didn't write down exactly what the line looked like.
game_writelog x
where x is 1 to enable and 0 to disable
You can (and even should) enter this command through the console or the consoleCmd function. This is necessary because if you try to print a non-7-bit character, the output will stop and won't resume until the console.txt file is deleted. Therefore, I recommend using the command in some form like this:
Code:
consoleCmd('game_writelog 1')
print('...')
consoleCmd('game_writelog 0')
It might also be helpful to separate the enabling and printing with pauses.