XEPOMAHT
Posts: 2379
|
(22.07.2023 18:10)AnT Wrote: А возможно ли динамически заменить сразу весь Dwelling.txt на заранее подготовленные Dwelling2.txt / Dwelling3.txt / ... ?
Теоретически можно:
1. Загружаешь в память игры свои тестовики с помощью SN:E
2. Записываешь адрес на загруженный текстовик в 8 адресов памяти с помощью UN:C в нужный тебе момент времени. Естественно, что окно города при этом должно быть закрыто, иначе придётся менять тексты "на лету" в самих структурах диалогов города, что достаточно не просто.
|
|
22.07.2023 21:50 |
|
SergOz
Posts: 1325
|
Подскажите, плиз, как узнать имя загружаемого файла в функции !?FU(OnSavegameRead); или функции
!?FU(OnAfterLoadGame); и какая предпочтительнее?
Вообще-то, меня интересует конкретно загрузка с файла BATTLE, чтобы сбрасывать настройки скриптовых боёв.
P.S. Я понимаю что можно это делать в общем !?FU(OnGameEnter); но сбрасываемых настроек много и я боюсь, что у тех, у кого компы слабенькие, будет задержка, которая может бесить
Карта-мод "Война на Холсте"
(This post was last modified: 26.07.2023 08:29 by SergOz.)
|
|
26.07.2023 08:24 |
|
Archer30
Posts: 1186
|
Is there a way to play a .def but flip it horizontally?
For example, I have a def like this:
Here I want to play it like this without creating another def:
I suppose it can be done in heroes 3 as there are some def with direction changes, like the animation of Death Blow (Death Knight's ability)
Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 28.07.2023 17:09 by Archer30.)
|
|
28.07.2023 17:06 |
|
Berserker
Posts: 16720
|
Most of def frame drawing functions have Mirror (horizontal) support like:
DrawInterfaceDefGroupFrame ( Def: Heroes.PDefItem; GroupInd, FrameInd, SrcX, SrcY, SrcWidth, SrcHeight: integer; Buf: pointer; DstX, DstY, DstW, DstH, ScanlineSize: integer; DoMirror, UsePaletteSpecialColors: boolean
); stdcall at 0x47B610;
But I don't recall ready to use "play" function with this parameter. Further investigation is necessary.
Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
|
|
28.07.2023 19:22 |
|
Archer30
Posts: 1186
|
|
29.07.2023 13:26 |
|
Berserker
Posts: 16720
|
|
29.07.2023 23:04 |
|
Archer30
Posts: 1186
|
|
30.07.2023 10:49 |
|
Archer30
Posts: 1186
|
Looking for some help with changin the sprite of creature depending on days.
The following script works only for the first switching and then the sprite keeps unchanged. I suppose this is because the something's cached. Possible to be improved?
Also, is there a way to change the sprite on the map of a creature by days?
Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 01.08.2023 13:52 by Archer30.)
|
|
01.08.2023 13:42 |
|
Berserker
Posts: 16720
|
The only way would be tracking LoadDef and Def->Destruct functions in order to find out the location of loaded defs in memory (which game structure), I suppose, with further unloading/reloading. Anyway, it does not seems as reliable solution. Once the object is drawn and not removed, resource counter is kept > 1, resource is not released and SN:R simply cannot redirect anything. SN:R intercepts LoadDef function, changing argument "name". After resource is loaded and stored in memory, nobody can force the game or plugin to use other def. The only exception are png frames, which ignore already loaded DEF frames.
Maybe another redirection mechanism could help. Something redirecting def drawing functions to other def frames on the fly. I didn't implement it yet. In your example 195z.def is not loaded, thus when we redirect 196z.def frame to 195z.def we should load def from archive, draw single frame and release memory, which would be very slow, unless implementing some time-limited cache.
Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
|
|
01.08.2023 15:51 |
|
Archer30
Posts: 1186
|
|
01.08.2023 19:05 |
|