Skip to content
User Avatar
#3946
Auto-translated

Simsa

Thank you. I'd like to clarify something. Regarding the hero's teleportation, ideally, I want a single, immortal hero who can travel the map without a town (I know that a hero can survive without a town) and gather troops by completing quests. If I want the hero to teleport to different locations in the underworld, do I need to write a separate script for each location, or can I write a single script that includes a list of coordinates, and then randomly select coordinates from that list? And if it's different scripts (one for each location), do I need to specify the hero's army each time? For example, I want the hero to have air elementals as fighters after "death."

What exactly is "static"? Is it environmental objects (bushes, rocks, etc.)? As far as I understand, can't tiles be recolored? For example, can grass be replaced with lava ground, or snow with grass?

I think I read somewhere that you can work with light... can you, for example, assign a glow to an object (I think this brings us back to point 1 (false) - for example, a bush glows red - the hero encounters a script where a battle is defined (like with a chest), and after winning, the bush loses its red glow and becomes normal. Or not a bush, but, say, a fountain. That is, the script should have a condition that after solving the script's task (defeating enemies), the object should become true again?

For such teleportations, it will be enough to have one table of coordinates and choose from them. You will have to specify the army for the hero anyway, because he appears from the reserve either with a standard army or with one that is pre-defined in the editor. Naturally, you will also have to transfer the progression, spells, and artifacts from the deceased hero to the hero from the reserve (of course, if this is necessary according to the logic).
Statics are basically any object that has the type AdvMapStatic. They can be created/deleted on the map at any time. Buildings, such as mines, have the type AdvMapBuilding, and they cannot be created.
You can configure the glow on objects in advance in the editor, and also using the SetObjectFlashlight/ResetObjectFlashlight functions. At the same time, the light source that you want to add to the object must be pre-entered into the map's resources, in the point lights section (maybe a slightly different name, I don't remember exactly).

Also, as Khottabych wrote, the standard scripting guide in the game files, or time-tested guides from Novik or Jack of Shadows, will answer most of your questions. They won't give you a complete understanding, but at least they will give you an idea of what you can do with scripts. I also recommend joining the VK group in Khottabych's signature; there is a lot of useful information there, including very specific scripting tricks. You can write to me on Telegram/Discord (in my profile); I can help you with any specific questions, not only about scripts but also about the editor in general.

Нет войне.