Wake of Gods Forum | Форум Во Имя Богов

Full Version: ERA III
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
daemon_n, issue resolved after disabling the content under Summon Elemental Hook in ReMagic

Download the latest debug before disabling the hook content
Hi,

@Berserker Can you push 3.9.6 so I can port it to D12.
Hi, gamemaster. Done. Installed Delphi 12. Do you know if it still supports console compiler?
Thanks.

I guess that D12 support command line compiler, but I never used it.
Always seemed too complicated for my needs Sm
I know that Delphi community edition do not support command line compiling.

If you can provide more details, where and why you need it, maybe we can do same trough ide.
Bug report:
Possible to attract an invalid number of troops with Succubus's ability.

Image: WfLkt2v.png
As you see from the screenshot, there is a phantom stack of fire messages in the Succubus dlg. If you drag this stack into the army, then this could happen:
Image: mwPntQ8.png
(The quantity of Fire Messager is 0)

This issue can be reproduced in raw era with a low level of Succubus.

Save game for testing
Can not reproduce bug with latest 2.949 build and era 3.6.9.
I tried put messengers in various slots. Also, tried it with D12 era build and with original era build.
Always same result, 3 messengers in right position. Seems that it works fine.

Can you try it again, after you restarted game and load it.
Without exit game there is always chance to gave some memory corruptions left from previous game.
If it is case then bug is much harder to locate.
gamemaster, hi! To produce, it's simple, just click on the 4th slot (as my screenshot shows) and see if it's highlighted. If it does, you will be able to get this phantom stack and mess up the battle.

I can 100% reproduce with my save game and in a new game. Basically if the attracted stack number is 0 (=original number of the stack times a percentage), it becomes invisible like in my screenshot.
Oh, my bad. didn't saw yellow rectangle on image Sm
I reproduced bug. It is as you described. I also took old 3.3.7 era version to check. Same bug is present there.
Perhaps, in these slots WoG or game set type to the first creature type and number to 0. The correct way is the say type to -1 for empty slots.
I think that problem is with dividing units into slots.
In Archers example there are 4x15 messengers. And succubus is lvl1 wit 5% charming.
Succubus will steal 3 messengers. Because there is 4 enemies 3 messengers would be divided in 4 slots. And we get 1+1+1+0.
Solution would be to not place unit in slot if its count is less then 1.

Any idea where this charming math is done? In era, h3era, custom scripts ?

ps: Slot with 0 units function normally as messenger unit do. Can be joined, moved or swapped...
wog sources
npc.cpp

NPCAttack0

Seem like there:
Code:
void NPCAttack0(_MonArr_ *G2B_MArrA,_MonArr_ *G2B_MArrD,_Hero_ *G2B_HrA,_Hero_ *G2B_HrD)
{
  #include "templ.h"
  int  i,yes,pers,Mt[7],MnS[7],MnD[7];
  NPC *npc;
//  if(IsThis(G2B_HrA->Owner)!=0) StoreFired(-1,0,0,0);
  NPCsa[0].Init();
  NPCsa[1].Init();
  do{
    if(G2B_HrA==0) break;
    npc=&NPCs[G2B_HrA->Number];
    if(npc->Type!=3) break; // Inferno
    if(npc->Used<=0) break;
    if(npc->Dead==1) break;
    if(G2B_HrD!=0) break; // не нейтральный стек
    pers=npc->Level/2+5; if(pers>20) pers=20;
    for(i=0;i<7;i++){ Mt[i]=G2B_MArrD->Ct[i]; }
    yes=RemoveCreature(G2B_MArrD->Ct,G2B_MArrD->Cn,MnS,MnD,pers); // pers домножен на 100
    if(yes==0) break;
    if(IsThis(G2B_HrA->Owner)!=0){
      Message(ITxt(9*3+6*6*4+1,1,&NPCTexts),1);
      CrChangeDialog(G2B_HrA,Mt[0],MnD[0],Mt[1],MnD[1],Mt[2],MnD[2],
                Mt[3],MnD[3],Mt[4],MnD[4],Mt[5],MnD[5],Mt[6],MnD[6]);
    }else{
      AddCreature(G2B_MArrA->Ct,G2B_MArrA->Cn,Mt,MnD);
    }
    for(i=0;i<7;i++){ G2B_MArrD->Cn[i]=MnS[i]; if(MnS[i]<=0) G2B_MArrD->Ct[i]=-1; }
  }while(0);
  do{
    if(G2B_HrD==0) break;
    npc=&NPCs[G2B_HrD->Number];
    if(npc->Type!=3) break; // Inferno
    if(npc->Used<=0) break;
    if(npc->Dead==1) break;
    if(G2B_HrA!=0) break; // не нейтральный стек
    pers=npc->Level/2+5; if(pers>20) pers=20;
    for(i=0;i<7;i++){ Mt[i]=G2B_MArrA->Ct[i]; }
    yes=RemoveCreature(G2B_MArrA->Ct,G2B_MArrA->Cn,MnS,MnD,pers); // pers домножен на 100
    if(yes==0) break;
    if(IsThis(G2B_HrD->Owner)!=0){
      Message(ITxt(9*3+6*6*4+1,1,&NPCTexts),1);
      CrChangeDialog(G2B_HrD,Mt[0],MnD[0],Mt[1],MnD[1],Mt[2],MnD[2],
                Mt[3],MnD[3],Mt[4],MnD[4],Mt[5],MnD[5],Mt[6],MnD[6]);
    }else{
      AddCreature(G2B_MArrD->Ct,G2B_MArrD->Cn,Mt,MnD);
    }
    for(i=0;i<7;i++){ G2B_MArrA->Cn[i]=MnS[i]; if(MnS[i]<=0) G2B_MArrA->Ct[i]=-1; }
  }while(0);
  RETURNV
}
Quick code to fix by Hawaiing:
(19.12.2023 19:02)Archer30 Wrote: [ -> ]Bug report:
Possible to attract an invalid number of troops with Succubus's ability.
As you see from the screenshot, there is a phantom stack of fire messages in the Succubus dlg. If you drag this stack into the army, then this could happen:
(The quantity of Fire Messager is 0)

This issue can be reproduced in raw era with a low level of Succubus.

Save game for testing
Archer30, I don't have this problem. I don't use the HoMM3 ERA Launcher Edition. My game version 3.9.5
Look for the problem in your scripts or plugins.
Because by your decision you have created a crutch on top of your own mistake
igrik, ты точно щёлкал по пустому жёлтому слоту №4 при том же количестве элементалей на карте?
Berserker, ну ты чего туда же? Чисто технически слот №4 не может быть пустым.

UPD: но исследовав проблему поглубже - да, согласен. Это недочёт ВОГа, причём во всех версиях.
Archer30, fixed on game bug fixes extended plugin.
Reference URL's