07.02.2024, 17:13
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
07.02.2024, 18:19
Классические диалоги текстов с прокруткой разбивают текст на строки, каждая из которых отрисовывается отдельно. Соответственно, прокрутка идёт шагами построчно. Вот функция разбивки (0x4B58F0)
ApiJack.StdSplice(Ptr($4B58F0), @New_Font_TextToLines, ApiJack.CONV_THISCALL, 4);
Модуль Эры перехватывает её, очищает строки диалога и проводит свою разбивку с учётом тегов, выравниваний и изображений в тексте. Никакого отображения в левом верхнем углу не может быть в норме.
Собственно, вот все мои перехваты без учёта правки для китайского языка:
Archer30, interesting. Is the issue preserved without HD mod?
ApiJack.StdSplice(Ptr($4B58F0), @New_Font_TextToLines, ApiJack.CONV_THISCALL, 4);
Модуль Эры перехватывает её, очищает строки диалога и проводит свою разбивку с учётом тегов, выравниваний и изображений в тексте. Никакого отображения в левом верхнем углу не может быть в норме.
Собственно, вот все мои перехваты без учёта правки для китайского языка:
Code:
Core.Hook(@Hook_GetCharColor, Core.HOOKTYPE_BRIDGE, 8, Ptr($4B4F74));
Core.Hook(@Hook_BeginParseText, Core.HOOKTYPE_BRIDGE, 6, Ptr($4B5255));
Core.Hook(@Hook_CountNumTextLines, Core.HOOKTYPE_CALL, 5, Ptr($4B5275));
Core.Hook(@Hook_CountNumTextLines, Core.HOOKTYPE_CALL, 5, Ptr($4B52CA));
Core.Hook(@Hook_ScrollTextDlg_CreateLineTextItem, Core.HOOKTYPE_CALL, 5, Ptr($5BA547));
ApiJack.HookCode(Ptr($4B547B), @Hook_Font_DrawTextToPcx16_DetermineLineAlignment);
ApiJack.HookCode(Ptr($4B54EF), @Hook_Font_DrawTextToPcx16_End);
ApiJack.StdSplice(Ptr($4B5580), @New_Font_CountNumTextLines, ApiJack.CONV_THISCALL, 3);
ApiJack.StdSplice(Ptr($4B5680), @New_Font_GetLineWidth, ApiJack.CONV_THISCALL, 2);
ApiJack.StdSplice(Ptr($4B56F0), @New_Font_GetMaxLineWidth, ApiJack.CONV_THISCALL, 2);
ApiJack.StdSplice(Ptr($4B5770), @New_Font_GetMaxWordWidth, ApiJack.CONV_THISCALL, 2);
ApiJack.StdSplice(Ptr($4B57E0), @New_Font_GetTextWidthForBox, ApiJack.CONV_THISCALL, 3);
ApiJack.StdSplice(Ptr($4B58F0), @New_Font_TextToLines, ApiJack.CONV_THISCALL, 4);
// Fix TransformInputKey routine to allow entering "{" and "}"
Core.p.WriteDataPatch(Ptr($5BAFB5), ['EB08']);
Archer30, interesting. Is the issue preserved without HD mod?
07.02.2024, 18:50
Berserker, the issue persists in pure era without other components.
07.02.2024, 20:22
(07.02.2024 18:19)Berserker Wrote: [ -> ]Модуль Эры перехватывает её, очищает строки диалога и проводит свою разбивку с учётом тегов, выравниваний и изображений в тексте. Никакого отображения в левом верхнем углу не может быть в норме.
ЭРА+ вызывает функцию 5BA360h в конструкторе диалога при обработке текстовика с DL и больше ничего не делает. На саму функцию не подаются никакие тэги и флаги, т.е. весь текст всегда отрисовывается одинаково, там можно задать шрифт и цвет, больше ничего. По-умолчанию, текст там отрисовывается с выравниванием слева, а не по середине, соотвественно, вставки типа "{~>ZWOGlogo.def:0:0 block}" так же отрисовывают только слева, центрирование там не работает, по крайней мере на ЭРЕ+.

Пример:

07.02.2024, 21:20
{~>ZWOGlogo.def:0:0 block align=center} пробовал?
07.02.2024, 21:29
(07.02.2024 21:20)Berserker Wrote: [ -> ]{~>ZWOGlogo.def:0:0 block align=center} пробовал?
Попробовал, безрезультатно. Так же рисуется только слева.
08.02.2024, 00:34
А {~>ZWOGlogo.def:0:0 align=center} + перевод строки?
08.02.2024, 06:35
(08.02.2024 00:34)Berserker Wrote: [ -> ]А {~>ZWOGlogo.def:0:0 align=center} + перевод строки?
Там с переводом строки и написано, иначе строчка начнётся прямо за def-ом.
08.02.2024, 06:43
Berserker, it is not about the cache.
005A9626 This triggers when the bug happens (meaning ERA tries to load a new def). But whatever SN:R sets, the def name preserves the last one used in the pervious battle.
!!SN:B works here
005A9626 This triggers when the bug happens (meaning ERA tries to load a new def). But whatever SN:R sets, the def name preserves the last one used in the pervious battle.
!!SN:B works here
08.02.2024, 14:00
Так же при попытке отрисовки в диалогах несуществующих кадров из def, которые ставит ЭРА, вместо пропуска отрисовки движок ЭРЫ всё равно пытается что-то отрисовывать, подавая мусор на HD_WOG.dll, которая не выдерживает такой наглости и вылетает (т.к. Бараторч поставил проверки только на несуществующие def-ы, а на несуществующие спрайты у него проверок нет, поэтому наверное такая оплошность моддеров, добавляющих def-ы в диалоги, может ложиться на плечи Берсеркера).
Spoiler (Click to View)
Exception
{
Module: HD_WOG.dll
Adress: [ HD_WOG.dll+0x73776 ]
Code: EXCEPTION_ACCESS_VIOLATION
Flags: 0x00000000
Information: read of address: 0x00000035
}
Context { EAX: 0x00000021, ECX: 0x00000021, EDX: 0x00000006, EBX: 0x0000000E, ESP: 0x0022990C, EBP: 0x0022990C, ESI: 0x00000000, EDI: 0x002299D0 }
Call stack
{
[ HD_WOG.dll+0x73770 ] called from [ 0x03085458 ]
? called from before [ era.dll+0x27EFE ]
[ era.dll+0x27EC0 ] called from [ era.dll+0x27FBC ]
[ era.dll+0x27F6C ] called from [ era.dll+0x8B74B ]
? called from before [ era.dll+0x27EFE ]
[ era.dll+0x27EC0 ] called from [ era.dll+0x27FBC ]
[ era.dll+0x27F6C ] called from [ era.dll+0x8AFD9 ]
[ era.dll+0x8AE00 ] called from [ era.dll+0x90625 ]
(spliced) [ 0x004B4F00 ] called from [ 0x004B5121 ]
{
Module: HD_WOG.dll
Adress: [ HD_WOG.dll+0x73776 ]
Code: EXCEPTION_ACCESS_VIOLATION
Flags: 0x00000000
Information: read of address: 0x00000035
}
Context { EAX: 0x00000021, ECX: 0x00000021, EDX: 0x00000006, EBX: 0x0000000E, ESP: 0x0022990C, EBP: 0x0022990C, ESI: 0x00000000, EDI: 0x002299D0 }
Call stack
{
[ HD_WOG.dll+0x73770 ] called from [ 0x03085458 ]
? called from before [ era.dll+0x27EFE ]
[ era.dll+0x27EC0 ] called from [ era.dll+0x27FBC ]
[ era.dll+0x27F6C ] called from [ era.dll+0x8B74B ]
? called from before [ era.dll+0x27EFE ]
[ era.dll+0x27EC0 ] called from [ era.dll+0x27FBC ]
[ era.dll+0x27F6C ] called from [ era.dll+0x8AFD9 ]
[ era.dll+0x8AE00 ] called from [ era.dll+0x90625 ]
(spliced) [ 0x004B4F00 ] called from [ 0x004B5121 ]
15.02.2024, 09:19
Dens of Thieves generate on mismatched terrains
So this happens a lot to me and I decided to improve it.

There are 3 types of Dens of Thieves in ERA. Now the first two will be generated on any terrain except for Snow, and the snowy one will only be generated on Snow.
Download fixed zaobjts.txt
I believe there are other small mistakes in zaobjts.txt. Not sure what they are but Grossmaestro should have a full list
So this happens a lot to me and I decided to improve it.

There are 3 types of Dens of Thieves in ERA. Now the first two will be generated on any terrain except for Snow, and the snowy one will only be generated on Snow.
Download fixed zaobjts.txt
I believe there are other small mistakes in zaobjts.txt. Not sure what they are but Grossmaestro should have a full list

18.02.2024, 17:06
FU(OnPreTownScreen) doesn't trigger in some of the cases switching between town screens
Not necessarily a bug, but this is inconvenient and confusing. FU(OnPreTownScreen), sounds like it would trigger before any town screen shows/updates, but not for the following cases:
- Teleporting from one inferno to another with Castle Gate (Infernoe building)
- Switching among owned towns on the town screen by pressing arrow keys on the keyboard
I use a hook @005C70E5 for the replacement of FU(OnPreTownScreen) and it seems to be fine so far, without the two issues mentioned here.
Not necessarily a bug, but this is inconvenient and confusing. FU(OnPreTownScreen), sounds like it would trigger before any town screen shows/updates, but not for the following cases:
- Teleporting from one inferno to another with Castle Gate (Infernoe building)
- Switching among owned towns on the town screen by pressing arrow keys on the keyboard
I use a hook @005C70E5 for the replacement of FU(OnPreTownScreen) and it seems to be fine so far, without the two issues mentioned here.
18.02.2024, 21:20
It seems, that switching between towns does not involve new dialog creation. Existing dialog is updated.
Maybe 005C70E5 should be added as some OnBeforeShowTownScreen event
Maybe 005C70E5 should be added as some OnBeforeShowTownScreen event
21.02.2024, 18:37
Loading during a battle (HD mod feature) resets AI thinking radius value (UN:J4) to 4096
If you load a save game during combat, the AI thinking radius value is reset to 4096 after finishing loading the save game. This 4096 value even persists for the ERA instance - if you start a new game after this radius buggy, the thinking radius would still be 4096.
Exiting to the main menu during battle doesn't seem to have such a bug.
Tested with no mods except for HD mod and a script to check UN:J4 value.
The problem itself is fixable with patches. But I wonder why it would happen. Could there be anything else broken by this HD feature?
If you load a save game during combat, the AI thinking radius value is reset to 4096 after finishing loading the save game. This 4096 value even persists for the ERA instance - if you start a new game after this radius buggy, the thinking radius would still be 4096.
Exiting to the main menu during battle doesn't seem to have such a bug.
Tested with no mods except for HD mod and a script to check UN:J4 value.
The problem itself is fixable with patches. But I wonder why it would happen. Could there be anything else broken by this HD feature?
21.02.2024, 23:31
Seems like the number of bugs is big enough to not use this feature or disable the button for Era.