Current time: 03.05.2024, 06:49 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
Ваши вопросы по ERM-скриптам
Author Message
daemon_n Offline
Administrators

Posts: 4338
Post: #9106

Berserker, wait, 5 bytes into forward? I was told before, that we need 5 bytes in backward
the world is full of lies

now I need to remake ALL the hooks I've ever made 96-copy

Or not?
Please explain everything here


Image: widget.png?style=banner2

Новейший Heroes 3 Launcher
21.08.2023 05:32
Visit this user's website Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1126
Post: #9107

Berserker, great info, thanks! While there are good hooks and bad hooks based on the flow of opcodes, is it true that most hooks are acceptable if there is no crash or other visible bugs to be found? Like, even if a hook is unsafe, the worst scenario is that it could conflict with another hook?


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 21.08.2023 18:27 by Archer30.)
21.08.2023 18:26
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16502
Post: #9108

Yes, it's true if you don't prevent overwritten code execution (unless you understand what you are doing). Original code is copied to new memory block, which is executed right after hook code.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
21.08.2023 18:30
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1126
Post: #9109

Thanks!

I have a new question: Is it possible to replace the sprite of a map object at some points in the game?

For example, a creature has a new sprite after X month, as they evolve.

I tried to achieve this purpose by SN:R, but it didn't work.


wessonm, maybe you have some ideas?

Edit: With daemon's help, it's solved.

P.S.: by daemon_n - function saved here


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 23.08.2023 07:29 by Archer30.)
23.08.2023 04:34
Find all posts by this user Quote this message in a reply
AnT Offline

Posts: 33
Post: #9110

Archer30,
i found temporary solution, it's may be helpful

use !!SN:R^werew_old.def^/^werew_new.def^;

Create in Data\Defs folder new folder ^werew_new.def^ (same as new def)
place here 0_0.png with new image (0_0.png 0_1.png ... 0_20.png if many images in def file)
(This post was last modified: 26.08.2023 16:42 by AnT.)
26.08.2023 16:36
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1126
Post: #9111

AnT, thanks. I am aware of the frame to frame replacement. But it seems no longer needed Sm


Latest ERA mods and scripts in development - My GitHub
26.08.2023 22:47
Find all posts by this user Quote this message in a reply
AnT Offline

Posts: 33
Post: #9112

Есть ли возможность модернизировать ресивер !!UN:T# (где #- тип города 0...8) в
ресивер например такого вида !!UN0/##:T# (где ## будет id города на карте)

может кто знает ?
(This post was last modified: 27.08.2023 21:10 by AnT.)
27.08.2023 21:10
Find all posts by this user Quote this message in a reply
XEPOMAHT Online
Moderators

Posts: 2277
Post: #9113

(27.08.2023 21:10)AnT Wrote:  Есть ли возможность модернизировать ресивер !!UN:T# (где #- тип города 0...8) в
ресивер например такого вида !!UN0/##:T# (где ## будет id города на карте)

может кто знает ?

В MoP можно. В ERA нельзя, т.к. в ванильной игре типы монстров в городах привязаны к типу города (т.е. прописаны в его шаблоне) и не зависят от номера города на карте.
27.08.2023 21:18
Find all posts by this user Quote this message in a reply
SergOz Offline

Posts: 1294
Post: #9114

AnT, в скриптах с id города на карте нужно быть осторожным:
при добавлении нового города в редакторе, или смещении на новые координаты уже существующего города,
номер города может измениться.

Я так понимаю, что тебе в однотипных городах нужно "поселить" разных существ.
Можно попробовать такой костыль:

P.S. за последствия не отвечаю, хотя тест показал что всё ОК 96


Карта-мод "Война на Холсте"
(This post was last modified: 28.08.2023 08:41 by SergOz.)
27.08.2023 21:21
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16502
Post: #9115

UN:T меняет данные глобально для всех городов. Функции из мода Extended Creatures позволяют задать разные альтернативы для разных городов, но первые два слота всё равно глобальные (там тоже UN:T используется).


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
27.08.2023 21:59
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1126
Post: #9116

AnT, maybe check out Third Upgrade Mod? I have a set of solution for it. The scritp is rather outdated though, but you get the idea.

Bascially under the OnPreTownScreen trigger, set UN:T with your conditions


Latest ERA mods and scripts in development - My GitHub
27.08.2023 22:29
Find all posts by this user Quote this message in a reply
SergOz Offline

Posts: 1294
Post: #9117

Archer30, будут ли в триггере OnPreTownScreen меняться существа для ИИ?


Карта-мод "Война на Холсте"
27.08.2023 22:44
Find all posts by this user Quote this message in a reply
XEPOMAHT Online
Moderators

Posts: 2277
Post: #9118

(27.08.2023 22:44)SergOz Wrote:  будут ли в триггере OnPreTownScreen меняться существа для ИИ?

ИИ не открывает экран города. Да и ещё ИИ необязательно заходить в город, чтобы нанять монстров - он это делает автоматически в начале каждой недели простым перебором всех городских структур параллельно с пополнением гарнизонов нейтральных городов. Так же найм происходит автоматически каждый день, если враг находится на расстоянии 1 дневного хода от города.
(This post was last modified: 28.08.2023 06:40 by XEPOMAHT.)
28.08.2023 06:38
Find all posts by this user Quote this message in a reply
AnT Offline

Posts: 33
Post: #9119

А существует ли триггер, который срабатывает когда ИИ начинает думать в определенном городе? (Имеется в виду именно триггер не когда ИИ заходит/строит в городе, а когда делает найм существ)
28.08.2023 07:45
Find all posts by this user Quote this message in a reply
SergOz Offline

Posts: 1294
Post: #9120

(28.08.2023 06:38)XEPOMAHT Wrote:  
(27.08.2023 22:44)SergOz Wrote:  будут ли в триггере OnPreTownScreen меняться существа для ИИ?
ИИ не открывает экран города.

Это был риторический вопрос. Ведь AnT наверняка хочет чтобы и ИИ нанимал разных существ в одном типе города. Значит одного OnPreTownScreen недостаточно.


Карта-мод "Война на Холсте"
28.08.2023 07:51
Find all posts by this user Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Forum Jump:

Powered by MyBB Copyright © 2002-2024 MyBB Group