Skip to content

Current questions and answers regarding the map editor.

User Avatar
#4505
Auto-translated
How can you make the quest update notification visible to the player without them having to use the "go to quests and see what has changed" method?
You could show a pop-up message like "Quest [quest name] has been updated" or something more detailed.
No, all animations are there. A complete set, plus three types of dialogue, and much more.
Well, I actually checked my editor, and I only saw 2 animations specifically for the hero Alaric, so I don't know, maybe it depends on the game version.
By the way, take a look at the script itself.
If you need criticism, I would:
- avoid "magic" numbers (4 instead of the resource name).
- move repeating string constants into variables, so that if you need to change them, you only need to change them in one place (if the player is always number 1 and has only one main hero)
player_id = PLAYER_1;
player_hero = 'Markel2';
- replace the ugly resource allocation construct with a function
function SetRes(res, num)
local curr_num = GetPlayerResource(player_id, res);
SetPlayerResource(player_id, res, curr_num + num, player_hero);
end
- if you plan to have many effects, move their unwieldy names into a separate table, here is a snippet from "Path of the Hero" (there are actually many more effects there):
-- list of effects for PlayVisualEffect
effects_table =
{
['Haste'] = 'Spells/Haste', -- breeze
['StoneSkin'] = 'Spells/StoneSkin', -- stone wall around
['Bless'] = 'Spells/Bless', -- light from the sky
['DeflectArrows'] = 'Spells/DeflectArrows', -- something like a shield on the side
['Dispel'] = 'Spells/Dispel', -- magical fog ending in an explosion
['Dispel_fail'] = 'Spells/Dispel_fail', -- magical fog without an explosion
};

function GetEffectName(id)
return '/Effects/_(Effect)/'..effects_table[id]..'.xdb#xpointer(/Effect)'
end

PlayVisualEffect(GetEffectName('Dispel'), ...);