Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
12 years ago
Auto-translated
I've encountered this issue with GiveHeroSkill (heroname, skill_id) several times now. So, how can I give a hero an ultimate skill, like Uber-Shriek for a Necromancer or Super-Gate Opening for a Demon? I don't remember the exact names anymore.
It doesn't work with the standard method, unfortunately. Or maybe I'm just doing something wrong...
In reply to Heroist
User Avatar
12 years ago
Auto-translated
Heroist
I've encountered this issue with GiveHeroSkill (heroname, skill_id) several times now. How do I give a hero an ultimate skill, like Uber-Cry for the Necromancer or Super-Gate Opening for the Demon? I don't remember the exact names anymore.
It doesn't work with the usual method, unfortunately. Or am I doing something wrong?

DEMON_FEAT_ABSOLUTE_GATING = 98; -- Urgash's_Call
NECROMANCER_FEAT_ABSOLUTE_FEAR = 111; -- Howl_of_Terror
RANGER_FEAT_ABSOLUTE_LUCK = 124; -- Nature's Luck
WIZARD_FEAT_ABSOLUTE_WIZARDY = 137; -- Arcane Omniscience
WARLOCK_FEAT_ABSOLUTE_CHAINS = 150; -- Rage_of_the_Elements
HERO_SKILL_ABSOLUTE_PROTECTION = 167
KNIGHT_FEAT_ABSOLUTE_CHARGE = 85; -- Unstoppable charge - is this something like that? Or does it not work?
User Avatar
12 years ago
Auto-translated
Yes, but for example, when I place a demon and enter `GiveHeroSkill(hero1, 98)` in the console, nothing happens.
In reply to Heroist
User Avatar
12 years ago
Auto-translated
Heroist
Yes, but for example, I place a demon, type GiveHeroSkill(hero1, 98) in the console, and nothing happens.

And it doesn't give any errors?

Maybe the hero needs a set of corresponding skills to gain this ability? (although I doubt it)
In reply to MasteR
User Avatar
12 years ago
Auto-translated
1) the hero must indeed possess all the necessary skills,
2) if you need to bypass this limitation, you can use consoleCmd, but only in single-player mode.
User Avatar
12 years ago
Auto-translated
consoleCmd
what kind of monster is that?
In reply to Heroist
User Avatar
12 years ago
Auto-translated
consoleCmd(command_string)
This function allows you to input console commands through a script. The only parameter is the command string itself. For example:
consoleCmd("enable_cheats")
consoleCmd("add_skill WILDFIRE")
will grant the currently selected hero the Wildfire skill, without checking for prerequisites like the Archery skill, etc. Only basic attack skills are required.
User Avatar
12 years ago
Auto-translated
consoleCmd("enable_cheats")
consoleCmd("add_skill Call of Urgash")

Instead of "Call of Urgash," use the name of this skill. I enter these two lines into the script, and then I will receive the "Call of Urgash" skill, right?
User Avatar
12 years ago
Auto-translated
You also need an ID there (a digital one is acceptable), Russian won't work. Otherwise, yes.

Added 2 minutes later
Just make sure that the hero is selected.
User Avatar
12 years ago
Auto-translated
Yes, it’s great, everything worked, thank you very much!
User Avatar
12 years ago
Auto-translated
So, here's the situation... A hero is in reserve. When a battle is initiated with him, the player participates. How can I prevent the player from receiving artifacts from the defeated hero after the battle ends? I assume this can be done using the SetHeroLootable(sHeroName, bEnable) function, but does it work for reserved heroes?
User Avatar
12 years ago
Auto-translated
It should work, please try...
In reply to Ment
User Avatar
12 years ago
Auto-translated
Ment
It should work, try it...

Yes, it seems to be working.
User Avatar
12 years ago
Auto-translated
I would like to ask about the function `
SetDisabledObjectMode('h1', DISABLED_BLOCKED);
`. For some reason, it doesn't seem to be working. What could be the problem? The sequence is as follows: first, enable, then disabled (this function), then set selectiontype to 0, and finally animation (death). Everything works, but the information frame remains, which is a pity. In the campaign, it disables successfully. (A2C2M2)
In reply to Heroist
User Avatar
12 years ago
Auto-translated
That's not all. To remove the tooltip, the developers used this:
OverrideObjectTooltipNameAndDescription("monster_name", "-disabled-", "")

Statistics

Welcome our newest member: recijeb