Skip to content

Posts from Current questions and answers regarding the map editor. Auto-translated

5.0 (12 ratings)
In reply to Radionich
User Avatar
#2605
Auto-translated
I need your help again, oh wise ones in the art of the editor:smile41:)
Now, to the point, I'm having trouble with the scripts again, plus there are some misunderstandings in the tasks. Specifically, I created a task where, like in all campaigns, the hero must survive:
Name Primary
Kind HERO_MUST_SURVIVE
Parameters Mihael
Along with the Hero, the monk in his army must not die. Therefore, I attached a script that a kind person suggested to me:
function PrimaryF
while 1 do
if GetHeroCreatures("Mihael","9")<1 then
SetObjectiveState("Primary",OBJECTIVE_FAILED);
break;
end;
end;
end;
startThread("PrimaryF);
Thank you in advance.
Ребят добавляйтесь в друзья в Steam ник CapObvious и в Ubi ник тот же , для удобства так сказать ;)
Поиграем :smile13:
User Avatar
#2606
Auto-translated
function PrimaryF () while 1 do sleep(1) if GetHeroCreatures("Mihael", 9) < 1 then SetObjectiveState("Primary",OBJECTIVE_FAILED); break; end; end; end; startThread(PrimaryF); ``` This is a better way to do it.

Whatever
In reply to Radionich
User Avatar
#2607
Auto-translated
Radionich
I need your help again, oh wise ones in the intricacies of the editor:smile41:)
Now, let's get down to business. Once again, I'm having trouble with the scripts, and there are also some misunderstandings in the quests. Specifically, I created a task where, like in all campaigns, the hero must survive:
Name Primary
Kind HERO_MUST_SURVIVE
Parameters Mihael
Along with the Hero, the monk in his army must not die. Therefore, I attached a script that a kind person suggested to me:
function PrimaryF
while 1 do
if GetHeroCreatures("Mihael","9")<1 then
SetObjectiveState("Primary",OBJECTIVE_FAILED);
break;
end;
end;
end;
startThread("PrimaryF);
Thank you in advance.

You don't have to bother with SetObjectiveState; you can simply write Loose() when something happens that should result in a loss. It's simple, but very convenient in many situations. This is only relevant for Single Player. By the way, parentheses should be placed after all function names. You can create a function for losing a hero using the corresponding trigger, making the quest KIND-MANUAL. But this is just in case you need it sometime
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
In reply to MasteR
User Avatar
#2608
Auto-translated
I didn't write a script; the game should have crashed, hmm, so the script function didn't work at all, that's strange:confused:
Ребят добавляйтесь в друзья в Steam ник CapObvious и в Ubi ник тот же , для удобства так сказать ;)
Поиграем :smile13:
User Avatar
#2609
Auto-translated
Now everything should be working fine. Back then, it didn't work because the parentheses () weren't placed after the faction name, and the quotes within the parentheses in `startThread` were unnecessary.

Whatever
User Avatar
#2610
Auto-translated
A question arose, and I've been wanting to ask it for a while. Is it possible to block a specific object for a single player? For example, would this work? :
SetObjectEnabled("Building", nil, 1);
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
User Avatar
#2611
Auto-translated
I don't think so. Maybe it would be better to place a REGION_ENTER_WITHOUT_STOP_TRIGGER region nearby, which would identify the player and lock/unlock the object?

Whatever
In reply to Heroist
User Avatar
#2612
Auto-translated
Heroist
I don't think so. Maybe it would be better to place a REGION_ENTER_WITHOUT_STOP_TRIGGER region nearby, which would identify the player and block/unblock the object?
It won't look good. And the AI is unlikely to approach and interact with a blocked portal.
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
User Avatar
#2613
Auto-translated
AI will be implemented. If there's nothing else to do, it will be.

Whatever
User Avatar
#2614
Auto-translated
There is a function called SetRegionAutoObjectEnable that does exactly that.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#2615
Auto-translated
RedHeavenHero
There is a function called SetRegionAutoObjectEnable, which does exactly that.
So, if a hero enters a region and simultaneously touches an object that was blocked, will the object be unlocked and the interaction with it occur at the same time?
It's very strange that it's not possible to block objects only for certain players. I've encountered this in every map.
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
User Avatar
#2616
Auto-translated
Nothing happens simultaneously. The hero always enters the region first and only then interacts with the object. You can also choose not to use this function and instead enable/disable the object during a specific player's turn.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#2617
Auto-translated
Guys, how do you make a static object "interactable," "clickable," etc.? In other words, how do you make it so you can interact with it and, consequently, attach a trigger? Or is this impossible in Unreal?

Whatever
User Avatar
#2618
Auto-translated
SetObjectEnable, if I understood you correctly.
Ребят добавляйтесь в друзья в Steam ник CapObvious и в Ubi ник тот же , для удобства так сказать ;)
Поиграем :smile13:
User Avatar
#2619
Auto-translated
You can create an object by assigning it a static object model.
502 Bad Gateway
__________________________________
nginx/0.8.54