Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
It depends on the goals, but it might be needed after a certain event.
 

К А
Стикеры GBF в Telegram
In reply to Годрикова впадина
User Avatar
Auto-translated
Godric's Hollow
I've already tried two options, both with a custom name and with the in-game name, and there's no difference.

Added 1 minute ago
This was also present in the original campaigns and in the Unicorn Empire campaign, in the 4th mission.

Added 5 minutes ago
Do you need a trigger for this?

You just need to give the hero of the player who is not on the map a script. And the name in the script, otherwise I suspect that you entered the in-game name in a completely literal sense. For example, you need to write Arantir, and not Arantir when referring to Arantir in the script.
Карты для героев 5

"Плата за любовь"
"Путь некроманта"
"Темные грани"
"Рок Гримхейма"
In reply to AstralLein
Auto-translated
The script `SetObjectOwner('Nemor',PLAYER_5)` doesn't seem to work. 'Nemor' is the script name for a daedra, and there are only 4 players on the map. The script itself is simple, but it's not functioning as expected.
In reply to Годрикова впадина
User Avatar
Auto-translated
Godrik's Basin, I made a similar script not long ago and everything worked

SetObjectOwner("Nemor", PLAYER_5);
EnableHeroAI("Nemor", nil);
SetObjectEnabled("Nemor", nil);
DoNotGiveTurnToPlayerAIIfNoTownsAndActiveHeroes(5, true);

and in the map settings, set player 5 to PCOLOR_NEUTRAL; that will be exactly what you need.
I was making a map and a question of this nature arose:
Is it impossible to build bridges?

I tried two ways:
1. via CreateStatic
2. I placed them with the orientation already set where they should be, then moved them to reserve (the corner of the map) and used the SetObjectPosition function to place them when needed

these methods do not allow the bridge to be used; it's just an object that the hero passes through
does anyone know how to implement bridge creation?
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
In reply to KioM
Auto-translated
Thank you, I'll give it a try.

Added 1 minute ago
If it's not too much trouble, could you describe what the scripts are in the last line? I'm curious.
User Avatar
Auto-translated
Kiom, did you use the correct object for the bridge? Which bridge exactly, the underground or the above-ground one? If you place the bridge at the very beginning, does the hero walk across it without any problems?
In general, it's quite strange.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
Auto-translated
Ment
Kiom, did you use the correct object for the bridge? Which bridge exactly, underground or above ground? If you place the bridge from the very beginning, can the hero walk across it without any problems?
In general, it's strange.

I placed it as a regular bridge (above ground, Order faction), and the hero could walk across it (after moving it with the SetObjectPosition command, it stopped working as a bridge; perhaps the path coordinates were messed up). When you place three parts of the bridge in the editor, it automatically transforms into 1 object with 1 set of coordinates.

P.S. Visually, moving the bridge worked as expected, it was a single object, but when trying to walk across it, the hero would pass through it and end up in the water.


Added after 46 seconds
Godrikova's Hollow

If it's not too much trouble, could you describe what's in the last line of the scripts? I'm curious.

It blocks the hero's path if he doesn't have any active heroes; visually, it's for comfort (in this case)
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
User Avatar
Auto-translated
KioM, I suspect that all these transfers of static objects in Heroes of Might and Magic V were implemented rather carelessly. For example, I had a case where a campfire within one level could be moved normally, but if I tried to move it from the underground to the surface, strange bugs started to occur. Considering that the bridge affects the surface geometry, Nival might not have implemented the geometry change during its transfers and creation using CreateStatic(). Perhaps, even after moving the bridge, it might still be possible to walk through the place where it was originally located?
In reply to Ment
Auto-translated
And where exactly did you write PCOLOR_NEUTRAL? Which line?
In reply to Годрикова впадина
Auto-translated
I wrote a script, what could be wrong with it? "dub1" is the name of the entity. The script's purpose is to prevent the entity from being moved and to remove the faction circle.

Added 7 minutes later
Oops, here's the script:
SetObjectEnabled("dub1", nil);
SetDisabledObjectMode("dub1", DISABLED_INTERACT);
sleep(1)
SetMonsterSelectionType("dub1", 0);
User Avatar
Auto-translated
Godric's Hollow, the script is correct; check the console to see what the game doesn't like.
In reply to Jack_of_shadows
Auto-translated
The problem is that the console doesn't show any errors, but nothing happens in the game.
User Avatar
Auto-translated
Godric's Hollow, or if you enter the commands one by one in the console?
In reply to Годрикова впадина
User Avatar
Auto-translated
Godric's Hollow
What's wrong with the script? "dub1" is the name of the entity; the script's purpose is to prevent interaction with the entity and to remove the faction circle.

Added 7 minutes later
Oops, here's the script:
SetObjectEnabled("dub1", nil);
SetDisabledObjectMode("dub1", DISABLED_INTERACT);
sleep(1)
SetMonsterSelectionType("dub1", 0);

Try placing sleep(1) before SetDisabledObjectMode; this might be the issue.

Statistics

Welcome our newest member: Emil