Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to JonnyP
User Avatar
Auto-translated
JonnyP
What “extended editor” are we talking about? It doesn’t allow you to add objects.
Or is it about a mod?
You open the editor and press View -> Game Database -> New Window.
A new window will appear. Click on the border with the right mouse button, select Tables, choose the necessary resources from the list using checkboxes, and click OK.
Go to the desired resource in the drop-down list.
That's it; now you can work with it easily!
I took the text above from here: /topic/2788/
This is that extended editor. And if it doesn’t allow you to add objects, then what is it for?
In reply to dredknight
Auto-translated
dredknight
Is there a way to get what object is on specific coordinates?

For example GetObjectFromLocation(x,y)
The developers haven't provided a direct way to do this.
As an alternative, you can create a table during map initialization where the key is the map coordinate and the value is the object's name.

Or is the only way to iterate through all existing objects on the map and check them one by one?
In general, there is no function that returns all objects on the map.
You can find some of them by a specific type, such as SKELETON, SAWMILL, HERO, etc. Additional manipulations are needed, for example, manually naming objects.
In principle, this is the problem, although it is feasible, but quite laborious.
User01322342

Here is this extended editor. But if it doesn't allow you to add objects, then what is it for?
I provided examples.
it allows you to open game resources, select the necessary windows (?), pack changes into a map archive, maybe something else
User Avatar
Auto-translated
Is it possible to reduce the hero's vision range using scripts?
User Avatar
Auto-translated
Hello everyone. I have a question. I wanted to create a scenario in the map editor: I place a ruined Human Castle and a region in front of it. The idea is that when this region is activated, the "Unholy Word" spell will be cast on the ruined Castle, and a normal Castle will appear in its place. In my case, it's a Necropolis Castle (I don't know if this detail is important or not). But when I test it, the spell is cast, the ruined Castle disappears, but the Necropolis Castle doesn't appear in its place... I've been struggling with this problem for half a day. Maybe someone can help? Here's the script I'm using: (maybe the problem is in the script? Although about 50% of the script works in the game...) function Necropolis() PlayVisualEffect("/Effects/_(Effect)/Spells/UnholyWord.xdb#xpointer(/Effect)", "ruins1", "tag2"); RemoveObject('ruins1'); SetObjectPosition(GORGOR, 23, 16, 1.5); SetObjectOwner(GORGOR, PLAYER_6); Trigger(REGION_ENTER_AND_STOP_REGION, "ZAMOK", nil); end; Trigger(REGION_ENTER_AND_STOP_TRIGGER, "ZAMOK", "Necropolis"); Edit: I wrote MakeTownMovable("Scripted town name") in the scripts. Now, when the region is entered, the spell plays for about 2 seconds, and the game crashes. What should I do?
User Avatar
Auto-translated
Xanax23, debug it step by step. Open the console, find a large empty space on the map, and try to move the Castle there (in the console, commands must start with the @ symbol; otherwise, everything is the same as in a script).
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо
In reply to Jack_of_shadows
User Avatar
Auto-translated
Thank you for your response. I checked using the console.
The game started crashing when I began entering @SetObjectPosition("Necrograd", 23, 16, 1.5708); (it's different from the previous script; I simply replaced the city name and specified the exact coordinates).
So, the error lies in the city's appearance itself, although there seems to be enough space.

Update: The problem isn't even with the city, but with the SetObjectPosition command. I decided to replace the castle with the appearance of some object. Whether it's a creature, a building, or an effect. It crashes specifically during the appearance of an object; I can't figure out what's causing it. Does anyone know why this might be happening?
User Avatar
Auto-translated
In SetObjectPosition, the fourth parameter is the GROUND/UNDERGROUND level. Fractional numbers cannot be passed there.
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо
In reply to Jack_of_shadows
User Avatar
Auto-translated
Jack_of_shadows, yes, that's where I made the change. Thank you, it works now, and the castle appears with a nice effect.
User Avatar
Auto-translated
Good evening. I'm having a problem in the editor when selecting which faction the AI plays and which faction I play in a scenario. When I select Green (for the AI) and Orange (for myself), after setting everything up, the game somehow makes me play as Green instead of Orange. Can anyone help me fix this (I've already tried adjusting the settings in the Properties Tree several times, but it doesn't work)?
User Avatar
Auto-translated
If it's a single-player scenario, there might be some strange things happening with it, so just try to make sure that the human player is always the first player. But in multiplayer, it doesn't really matter.
 

К А
Стикеры GBF в Telegram
User Avatar
Auto-translated
Good day. Is there any guide on creating videos available on the forum?
User Avatar
Auto-translated
/topic/3747/
This thread isn't exactly a manual, but it has a lot of information. I thought there was also a manual, but I can't find it right now.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
Auto-translated
Hello, since the map editor topic hasn't been active for three months, I'll ask here:

1) Is it possible to replace the music in a map so that it plays for those who download the map? And is it possible to create music for a regular, non-campaign hero?

2) I've tried many times to create map previews using this video https://www.youtube.com/watch?v=UlLw9VJPSrs&t=407s, but the result has always been negative (the image size was specified in the corresponding field of the editor, the size of the map itself was also increased, but nothing happened, although there were no problems with creating the loading image). Is this due to a bug in my editor, or something else?

P.S. If it's important, I'm talking about the map editor for the original Heroes of Might and Magic game.
Auto-translated
Could you please tell me if it’s possible to change the description of the active quest during gameplay?
User Avatar
Auto-translated
Kolin, here's an excerpt from the FAQ (you can find it in my signature):
How to create a quest?

Map Properties Tree -> Objectives -> Primary (main) or Secondary (optional) -> Common (quests for all players) or PlayerSpecific (quests for a specific player) -> [PLAYER NUMBER] -> Objectives -> Right-click -> Add

For the added quest, configure/check the following fields:
1) Name – the script name of the quest, which can be used to manage it.
2) CaptionFileRef – the file containing the quest name displayed in the game.
3) DescriptionFileRef – the file containing the quest description displayed in the game.
4) ProgressCommentsFileRef – if the quest consists of several stages (e.g., kill 3 groups of monsters), you can add files with additional descriptions for each stage here. The game will initially display the general description of the quest from DescriptionFileRef, followed by the description of the current stage from ProgressCommentsFileRef. If the quest has stages, it will start at stage zero.

...

-- quest progress
-- progress – the stage number corresponding to ProgressCommentsFileRef
SetObjectiveProgress(‘SCRIPT_NAME_OF_THE_QUEST’, progress);
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо

Statistics

Welcome our newest member: Emil