Current time: 26.11.2024, 09:16 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
Ошибки, баги и недочёты ERA
» crash logs / errors / bugs of era
Author Message
Archer30 Offline
Moderators

Posts: 1175
Post: #691

Bug report:
F12 for updating scripts will be broken if exiting a game (via HD feature) during battle.

Steps to reproduce:
- Load any save game
- Press F12 (check if it's working, it should)
- Start a fight
- Load a save game after exiting during the fight
- Press F12 again (it should be broken now, nothing happens)

This makes testing very inconvenient...


Latest ERA mods and scripts in development - My GitHub
23.01.2024 19:41
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #692

As a quick workaround just add some hot key for fast losing battle and the game (to be able to get to game main menu). I don't know, wether Baratorch included any changes for OnGameLeave I requested recently.


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

Posts: 1175
Post: #693

Berserker, it‘s not only that though, I suppose the culprit is something more obvious. I experienced F12 not working sometimes when I
- Get into battle
- Minimize ERA and edit my script
- Get back to ERA, found F12 not working
It's not reliably reproducing so I just list everything I did last time. Perhaps minimizing in battle screen instead of adv map could lead to such issue?


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

Posts: 16657
Post: #694

Archer30, maybe game window does not receive directory change notification, and thus VFS thinks, that no files or directories were changed and F12 reuses existing scripts in memory. Tried making another change in editor and pressing CTRL + S, then F12 in game?


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

Posts: 1175
Post: #695

Berserker, I don't think it's the case. It's pressing F12 and no text appears at the bottom, as if the keyboard's broken. Yet it works again after re-starting ERA.


Latest ERA mods and scripts in development - My GitHub
24.01.2024 18:43
Find all posts by this user Quote this message in a reply
gamemaster Offline

Posts: 16
Post: #696

Archer30 I tried to reproduced bug but did not have luck. I tried various scenarios to recreate bug using latest launcher 2.955 that includes R73 HD mode (a few week old).

I found this F12 wont work when
- HD help dialog is displayed (F1 on adventure map and in combat),
- Town dialogs (magic guild, dwelling upgrade, castle upgrade, leprechaun bank, Peons dialog...). But it work on army buy screen and all other "classic info" dialogs...,
- Hero henchmen screen...,
- "Welcome to gem settings" dialog.

F12 trigger ReloadErm method in all cases, but its exit from method when ErmTriggerDepth is no 0. In all above cases it is not 0.
Seems to me that all dialogs that related to HD mode has ErmTriggerDepth>0.

If you have additional info how to reproduce bug i can take look further...

Bug report:
Also, during gorilla testing i found that game crash when you try to reload scripts (F12) in hero meeting screen when quest log is opened. Crash occurs later, when quest dialog close button is hit.
Steps:
- Meet hero,
- Open quest dialog (any hero),
- F12 - sound is plays as sign of succeed reload,
- Close quest dialog,
- HD mode crash.
Can someone confirm this bug too?
24.01.2024 18:43
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #697

gamemaster, I see. If battle is initiated by ERM, baratorch's way to exit battle (jump out of stack context) will leave ErmTriggerDepth > 0. I think, it can be the issue. The best way is to lose battle and game via two ERM commands on hot-key instead of using "Load from battle" functionality.

F12 is not totally safe, because ERT strings are reloaded and thus some string addresses may become broken. I usually press F12, than save and load. Otherwise code using ERT-strings may crash.


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

Posts: 1175
Post: #698

Quote:If battle is initiated by ERM
It was indeed my case.

Do you think there could be other problems besides F12 not working with "load from battle" feature?


Latest ERA mods and scripts in development - My GitHub
26.01.2024 10:23
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #699

F12 is quite reliable, unless ERT strings were used for creature/spell descriptions or in-game dialogs, because those strings are dynamically allocated and freed, thus their addresses will differ from one loading to another. If you have met any issue, try F12 + save + load.


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

Posts: 1175
Post: #700

Berserker, I'd like to report a weird problem:
Flag 1000 can become FALSE on a battle replay vs neutral monsters with random hero active.

Okay this might sound confusing, let me show you how to reproduce the problem step by step.
- Download testing mod + save game The testing mod contains battlereplay plugin, latest random heroes script (and libs) and my testing script to show the value of flag 1000.
- Activate the mod and load the save game
- Use Tazar and fight the Pitlords
- Tazar would be asked if retreat, pick anything to end the battle
- Replay the battle
- If everything goes right, you will see this:
Image: d8HDdtK.png
Flag 1000 becomes 0 as soon as the battle replay is confirmed.

A few findings:
- It looks like this is not reproducible in a new game.
- The appearance of random hero (hero for the neutral stacks) is crucial. If Gelu does not appear on the other side, flag 1000 is bugless.

What do you think about this? Rolleyes


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

Posts: 16657
Post: #701

Seems like it's more a question for a battle replay plugin author. Era set f1000 before each trigger exactly, like ERM does:
Code:
// Really the meaning of ZvsGmAiFlags is overloaded and cannot be trusted without looking at ERM help
ZvsGmAiFlags: pinteger = Ptr($793C80);

if ZvsGmAiFlags^ >= 0 then begin
  f[1000] := ZvsGmAiFlags^ <> 0;
end else begin
  f[1000] := not ZvsIsAi(Heroes.CurrentPlayerId^);
end;
Perhaps, ZvsGmAiFlags variable should be preserved between replays.


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

Posts: 1175
Post: #702

So igirk?

Ultimately I can set the flag back to TRUE under every trigger in a script with a large number prefix Rolleyes


Latest ERA mods and scripts in development - My GitHub
31.01.2024 18:16
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #703

Yep, it's better for igrik to check this variable persistence between replays.


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

Posts: 2819
Post: #704

(31.01.2024 20:12)Berserker Wrote:  Yep, it's better for igrik to check this variable persistence between replays.
Daemon_n is already manages this plugin BattleReplay.dll (As far as I know) 115


game bug fixes extended.dll || My Plugins || My GitHub
01.02.2024 12:01
Visit this user's website Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #705

igrik, бюрократы! )))

Code:
// battle
void BACall(Dword n,_Hero_ *hp)
{
  #include "templ.h"
  Dword oldpo=pointer;
  pointer=n+30300;
  ERM_GM_ai=!G2B_CompleteAI;
//  ERM_PosX=0;ERM_PosY=0;ERM_PosL=0;
  ERM_HeroStr=hp; // 3.57f 29.01.03
  ProcessERM();
  pointer=oldpo;
  RETURNV
}

G2B_CompleteAI — глобальная переменная, истинна при чистом автобое.

Устанавливается ещё до начала битвы здесь:

Code:
// Нападение героя на что-то другое
{0x49F195,0,DP(Get2Battle)}

int __stdcall Get2Battle(Dword MixedPos,_Hero_ *HrA,_MonArr_ *MArrA,
                         int OwnerD,Dword Pv4/*0*/,_Hero_ *HrD,_MonArr_ *MArrD,
                         int Pv3/*-1*/,Dword Pv2/*1*/,Dword Pv1/*0*/) // ECX=Adv.Manager
{
  _ECX(G2B_AdvMan);
  G2B_MArrD=MArrD; G2B_MArrA=MArrA;
  G2B_HrD=HrD; G2B_HrA=HrA;
  G2B_OwnerD=OwnerD;
  G2B_MixedPos=MixedPos;
  __asm  pusha
  ExpoFromBattle=1;
  CheckForCompleteAI(); // <<<<<<<<<<<

Думаю, нужно при инциализации повтора боя вызвать эту функцию самостоятельно:

Code:
void CheckForCompleteAI(void)
{
  #include "templ.h"
  G2B_CompleteAI=1;
  _Hero_ *hp;
  hp=G2B_HrD;
  while(hp!=0){
    if(hp->Owner<0) break;
    if(hp->Owner>7) break;
    if(IsAI(hp->Owner)==0) G2B_CompleteAI=0; // human
    break;
  }
  hp=G2B_HrA;
  while(hp!=0){
    if(hp->Owner<0) break;
    if(hp->Owner>7) break;
    if(IsAI(hp->Owner)==0) G2B_CompleteAI=0; // human
    break;
  }
  if(IsAI(G2B_OwnerD)==0){ // хозяин защищающихся монстров - человек
    G2B_CompleteAI=0; // human
  }
  __asm{
    mov    eax,0x691259
    mov    al,[eax]
    test   al,al
    je     l_No
    mov    eax,0x691258
    mov    al,[eax]
    test   al,al
    je     l_No
  }
  G2B_CompleteAI=0;
l_No:;
  RETURNV
}


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
01.02.2024 14:40
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