Posts from Scripts
How do I make a town get destroyed when it's captured?
function raze_captured_town(oldowner, newowner, hero, town)
Trigger(OBJECT_CAPTURE_TRIGGER, town, nil)
RazeTown(town)
end
Trigger(OBJECT_CAPTURE_TRIGGER, 'script_town_name', 'raze_captured_town')
function raze_captured_town(oldowner, newowner, hero, town)
Trigger(OBJECT_CAPTURE_TRIGGER, town, nil)
MakeTownMovable(town)
sleep()
RemoveObject(town)
end
Trigger(OBJECT_CAPTURE_TRIGGER, 'script_town_name', 'raze_captured_town')
The first option leaves behind ruins, but it only works with Haven and Inferno towns.
The second option simply removes the town, but it works for towns of all factions.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
How do I add the Devil's Chain and Hellfire Wave spells to a hero's spellbook in the scenario editor so that they deal damage?
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In the editor, add them to the hero's spellbook through the properties tree.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Yes, there is. The chain is called SPELL_UBER_CHAIN_LIGHTNING or something like that, and the wave is located nearby in the list.
I apologize, how can I force the AI to attack a specific hero, regardless of the danger? So that it rushes towards the player from the very first turn, no matter how dangerous it is, even if the hero is in a castle.
void SetAIPlayerAttractor( sObjectName, nPlayerID, nPriority ) The priority can range from -1 to 2.
Or, here is another script, which will make the hero simply jump to a point with the specified coordinates (during its turn, of course, and if it has move points).
void MoveHero( sHeroName, nX, nY, nFloorID = GROUND )
Хаос во всём тоже порядок...
Кампания Седьмое затмение. Грань Империи.
В стадии разработки 10%
I can offer a script to make the AI more "interested" in a specific object. However, you'll need to keep the hero in one place. Here's the script:
void SetAIPlayerAttractor( sObjectName, nPlayerID, nPriority ) The priority can range from -1 to 2.
So, you have to keep it in one spot? What's the difference then from the second script?
Is it possible to create a hero using scripts that doesn't belong to any faction (Neutral, essentially)? It's not even necessary for him to be able to move, but if that's possible too, that would be even better.
This trick won't work on a map with 8 players.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
SetObjectOwner('scripted_hero_name', player_number_not_participating_in_the_game)
This trick won't work on a map for 8 players.
So, is it impossible to do this on a map for 8 players? I've just encountered mods where neutral heroes exist, but not as objects on the map. They appeared when engaging in combat with any stack of neutral creatures.
To be more precise, here is that mod:
http://heroescommunity.com/viewthread.php3?TID=41303