Skip to content

Posts from How do you create monsters by combining multiple creatures?

No ratings yet — be the first to rate!
User Avatar
#1
Auto-translated
When playing a campaign or in a random map generator, you encounter creatures in a squad that contains several types of monsters, and they are marked with a red flag and surrounded by a red aura.
User Avatar
#2
Auto-translated
You place any unit on the map (for example, an archer), select it, and then in the table on the left, there is a setting called "AdditionalStacks". Click on it with the left mouse button, press "add", then click on the plus signs that appear, and then choose who will be in the squad with the archers.
In reply to WizardNazyr
User Avatar
#3
Auto-translated
WizardNazyr
You place any unit on the map (for example, an archer), select it, then in the table on the left, there is a setting called "AdditionalStacks". Click on it with the left mouse button, press "add", then click on the plus signs that appear, and then choose who will be in the squad with the archers.
Can you do this if you place a random monster?
User Avatar
#4
Auto-translated
No, you can’t do that with random generation. But if you really want to, you can write a script to place a set of random creatures at specific coordinates. By the way, something similar is implemented in the seventh installment; random monsters consist of groups of different creatures. This makes the battles more interesting, but it looks a bit silly when you see that a pile of gold is guarded by skeletons, butterflies, and griffins. What could possibly unite them?! I don’t like this approach.
и немедленно выпил...
User Avatar
#5
Auto-translated
Medyan, did you manage to do that in Heroes of Might and Magic V? As far as I know, there's only a script for creating a single monster, and you can only add creatures to neutral stacks that they already have, so you can't create a composite stack using scripts.
In reply to Jack_of_shadows
User Avatar
#6
Auto-translated
Here is a working script:
CreateCaravan('random_caravan_1',PLAYER_2,GROUND,2,2,GROUND,2,3)
for i=1,3 do
creature=random(115)+1
count=random(99)+1
CreateMonster('monster'..i,creature,count,4,4,GROUND,MONSTER_MOOD_AGGRESSIVE,MONSTER_COURAGE_CAN_FLEE_JOIN)
AddObjectCreatures('random_caravan_1',creature,count)
SetObjectEnabled('monster'..i,nil)
SetDisabledObjectMode('monster'..i,DISABLED_INTERACT)
SetObjectPosition('monster'..i,(96+i/3),96,GROUND)
Trigger(OBJECT_TOUCH_TRIGGER,'monster'..i,'fight_caravan_1')
end
function fight_caravan_1(hero)
for i=1,3 do
RemoveObject('monster'..i)
end
MakeHeroInteractWithObject(hero,'random_caravan_1')
end
It looks a bit strange because the coordinates in SetObjectPosition('monster'..i,(96+i/3),96,GROUND) cause two monsters to appear in the same place, and they overlap. You can, of course, arrange them as you like, in a square, or in a line, but just not in one point (it won't work). You can avoid the hassle of arranging the units and simply place the caravan filled with random monsters at the desired coordinates. I suspect that there is a way to attach a combat script and arrange the random monsters on the battlefield, but in any case, the main question is how to display a composite unit on the adventure map. And yes, if anyone doesn't understand how this script works, feel free to ask, I'll explain it line by line
и немедленно выпил...
User Avatar
#7
Auto-translated
A random composite unit can be assembled using scripts, but this is not a trivial task. In the RM mod, there is a script that replaces ordinary random units with composite ones. You can take it from there.

Added 1 minute ago
Jack_of_shadows
Medyan, did you manage to do this in Heroes of Might and Magic V? As far as I know, there is only a script for creating a single monster, and you can only add to neutral units those creatures that they already have, so you cannot assemble a composite unit using scripts.
In Heroes of Might and Magic, it is possible to create combined armies using scripts.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#8
Auto-translated
in this mod, units are added using
AddObjectCreatures(mob, stype, snum)
and the function description states that only units of the same type can be added to a mob. Is the description incorrect? Or am I missing something?

I wonder, if a mob initially consists of creatures of different types, will it then be possible to add any creature? I'll try it when I get home.
и немедленно выпил...
User Avatar
#9
Auto-translated
The description is outdated. In version 3.1, a fourth, optional parameter was added – a slot where a unit can be placed or removed, although this parameter doesn't work with monsters. There is no mention of it in the manual.

Added 13 minutes later
You can add any creature from the existing units to a composite army, as well as a new one, if there is a free slot.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#10
Auto-translated
Medyan, your script is a workaround of epic proportions :)
In the RM mod, there's a script that replaces regular random units with composite ones.
Indeed, it uses a standard AddObjectCreatures function. I probably didn't bother to check it at the time and simply trusted the documentation (what a silly habit), and then I just got used to this feature.