Skip to content

Questions about the Heroes 4 map editor.

User Avatar
#229
Auto-translated
Larisa
Okay, so I guess I'll have to come up with some alternative to the magazine.

And another question. I want to make it so that all units located in a certain area lose a certain number of creatures once a day, and heroes take damage. It seems that it's impossible to do it directly, but I can implement something similar by simply filling the entire area with yellow spheres that trigger the same script, which will randomly reduce the number of creatures and health. I understand that calling a script at every step is a terribly inefficient solution, but it seems to be the only way to achieve the desired result. And now, the actual question: how slow and poorly will this work? Will it cause lag or glitches on older computers (assuming that the game itself runs normally)? I tested it myself, and everything is fine. The script itself isn't heavy, but the area is large.

Perhaps there is another option. Personally, I think: before entering the zone, create a local event, let's say, "entering the dangerous zone." In the script, the variable "Entering the dangerous zone" is set to True. We create a calendar event in the properties of the army/hero: 1 day, repeat every first day, if the variable "Entering the dangerous zone" is equal to True, then perform the necessary actions. Before the local event "Entering the dangerous zone," we create a local event "Exiting the dangerous zone," which sets the variable "Entering the dangerous zone" to False. On the second entry/exit from the dangerous zone, we create two more such events.
The downside of this idea: it is impossible to predict whether the hero will move with the entire army in one unit or create separate units. That is, a separate unit may trigger the variable "Entering the dangerous zone" to True, and the player will receive some negative effects that should not occur while he is not in the zone.
However, this can be solved by the same global placement of local events on each cell of the dangerous zone. That is, let's say, if there is no hero in this unit, then an invincible army attacks this unit. In general, here is such an idea.
Наш мир полон тайн и чудес.
Многие их ищут, многим они вовсе не нужны, а многие даже не замечают их, не понимают что они вокруг нас, каждый день, везде.
А эти чудеса порой, сокрыты в обычных, привычных предметах.

Statistics

Welcome our newest member: artem

Users Online 3 users 1450 guests