Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
13 years ago
Auto-translated
Will SetObjectEnabled work with a hero? And also, will it prevent the hero from interacting with anything on their own?

And is the trigger for interaction TOUCH_TRIGGER? Is it also suitable for movable objects?

Whatever
User Avatar
13 years ago
Auto-translated
okay, I have a few more questions:

1) How does the Mask of Justice work? It doesn't equalize stats at all. I added 50,000 attack to an enemy hero using a script, and nothing was balanced...
2) How is it possible that an AI hero, who has 100 mega-monsters with a million HP, loses to a computer with 1000 black dragons? I checked, the dragons are naturally defeated in one hit. But in a battle between two AIs, the second one wins...

Added after 52 minutes
3) It's very strange. I have an object that is reset after completing a task (trigger), and then the object simply becomes enabled. All computers, as expected, pass by. Except for one. It bumps into this object and... its turn lasts infinitely long. That is, there is a progress bar for its turn, but it stands in place, and it doesn't move. After 20 minutes, it ends its turn...

Whatever
User Avatar
13 years ago
Auto-translated
How is it possible that an AI hero, with 100 megamonsters and a million HP, loses to a computer with 1000 black dragons? I checked, and the dragons naturally defeat them in one hit. But when two AIs fight, the second one wins...
If the megamonsters are level 1, the opponent's hero will defeat them in one hit.)
All the computers, as expected, pass by. Except for one. It bumps into this object and... its turn lasts infinitely long. That is, there is a progress bar for its turn, but it stands still, and the bar doesn't move. After 20 minutes, it ends its turn...
Either the objects need to have their priorities reset (in my opinion, this is somewhere in data.pak), or an impassable area for the computer needs to be created around them; otherwise, they will keep trying to interact with it until they reach the object.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
13 years ago
Auto-translated
Megamonsters have too low a "strength" value. To avoid overcomplicating the AI and making battles too computationally intensive, the AI conducts battles based on the ratio of "strength" values.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to Ment
User Avatar
13 years ago
Auto-translated
what does this "force" mean???
Either the objects need to have their priorities reset (this is, in my opinion, somewhere in data.pak), or an impassable area for the AI needs to be created around them; otherwise, they will keep trying to interact with the object until they do.

I mean, I make the object enabled, i.e., nothing will happen, and the AI will just run past it. And only ONE – the fifth player – glitches on it when passing by....

Added 1 minute ago
it seems like it somehow has a life priority set on it. But I didn't do that, for sure.

Added 47 seconds ago
and can someone explain how the Mask of Justice works and what principle it uses?

Whatever
In reply to Heroist
User Avatar
13 years ago
Auto-translated
Strength is a power parameter in the creature file. The Mask of Justice works as follows: if the hero's level with the mask is lower than the enemy's level, then the hero's stats are increased as if he had the enemy's level, since stats are added with each new level.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
13 years ago
Auto-translated
i.e., if the stats are added by a script, nothing will happen?

Whatever
User Avatar
13 years ago
Auto-translated
Hmm... but how, for example, in the famous map "Journey," did the equally famous Law equalize stats from 1000 to 50? (I even have a save file somewhere with the replay.)

Whatever
In reply to Heroist
User Avatar
13 years ago
Auto-translated
Who knows. Maybe with a script that checks for the artifact and so on. It's best to ask the author about this.;)
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
13 years ago
Auto-translated
okay, but if we try using a script, how would that work?

hmm... someone mentioned Hero_Touch_Trigger above =) =) Now everything is clear.

although, not quite...

Added 26 minutes later
great, I found the error why the megamonsters were losing. It turns out that under AI control, something is wrong with their stats. Apparently, there's a limit. 100 centaurs were dealing 1,000,000,000 damage per shot, although the panel displayed this damage as 1!

RedHeavenHero - could you write a script to determine if hero 1 has the Mask artifact and, when attacking hero 2, equalize their stats? I would be very grateful.

Whatever
In reply to Heroist
User Avatar
13 years ago
function mask_check(attacker, defender)
if HasArtefact(attacker, ARTIFACT_MASK_OF_DOPPLEGANGER) then
SetObjectEnabled(defender, 1)
Trigger(16, defender, nil)
MakeHeroInteractWithObject(attacker, defender)
local index = GetLastSavedCombatIndex()
while index == GetLastSavedCombatIndex() do
sleep()
end
if IsHeroAlive(defender) then
SetObjectEnabled(defender, nil)
Trigger(16, defender, 'mask_check')
end
end
end

SetObjectEnabled('hero1', nil)
Trigger(16, 'hero1', 'mask_check')
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
13 years ago
Auto-translated
thank you, thank you very much

Whatever
User Avatar
13 years ago
Auto-translated
Can you tell me if the script is written correctly? ``` function Fight(heroname) if heroname == 'Ish' then if HasArtefact(Fight, ARTIFACT_HELM_OF_ENLIGHTENMENT) then SetObjectPosition('rav', 105, 74, floor = -1); Trigger(REGION_ENTER_AND_STOP_TRIGGER, 'art', nil); end; end; end; Trigger(REGION_ENTER_AND_STOP_TRIGGER, 'art', 'Fight'); ``` I need it so that when a hero enters a specific area and has the Helm of Enlightenment in their inventory, the enemy is moved.

Statistics

Welcome our newest member: recijeb