Current time: 24.11.2024, 15:45 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
ERA BattleQueue
» Move order for combat / очерёдность хода в битве
Author Message
Berserker Offline
Administrators

Posts: 16657
Post: #16

RoseKavalier,
Try to use era.h https://gofile.io/d/KXWJqA
Example of language file can be found in Era II\Mods\WoG\Lang\era.json
Code:
{
  "era": {
    "global_scripts_vs_map_scripts_warning": "{Skip global scripts?}\n\nThe map has its own set of ERM scripts. Do you wish to skip loading global ERM scripts (they may cause errors, if map was not intended to be played with other ERM scripts)?",
    "no_memory_for_erm_optimization": "Sorry, but compiled ERM scripts size exceeds @limit@ MB limit. ERM optimization failed. ERM will be disabled"
  }
}

Calling tr('era.no_memory_for_erm_optimization') will return std::string with translation in ANSI (current active page) encoding (json files use UTF-8). String can be stored anywere and .c_str() method returns null terminated string pointer then.
If you need parameters in string, you can write in json:
"no_memory_for_erm_optimization": "There are only @mem_free@ MB left"
And call something like tr('era.no_memory_for_erm_optimization', { "mem_free", IntToStr(100) });

Quote:how is it handled by the game - unicode? utf8?
Json are in UTF-8. Era translation API always returns ANSI version.

RoseKavalier, there is no tactical phase in BattleHeroes. All player actions occur between BG1 and BG0.
If it is possible to update the queue when updating the battlefield via !!BU:R, it will be great.
Code:
BG0 - event before stack action
BG1 - event after stack action when another stack already obtained turn
BACall3 in ERM.

{0x473F6B,0,DP(Monster2Battle)}, // hook address

void _MonsterAfterBattle(void)
{
  __asm pusha
//asm int 3
  _EAX(MAB_ret);
  #include "templ.h"
  if((*(int *)&((Byte *)M2B_BatMan)[0x132F8])==1){
//    for(int i=0;i<(21*2);i++) *(Dword *)&M2B_BatMan[0x54CC+0x548*i+0x84]|=0x00200000;
    CheckForAliveNPCAfterBattle((Byte *)M2B_BatMan);
    MAB_ret=2;
  }
//  BACall3(1,*(int *)&((Byte *)M2B_BatMan)[0x13D6C]);
  BACall3(1,BACall_Day);
  STOP
  __asm popa
  __asm mov  eax,MAB_ret
}

void __stdcall Monster2Battle(Dword Pv2,Dword Pv1)
{
  _ECX(M2B_BatMan);
  _Monster2Battle();
  #include "templ.h"
  __asm  push   Pv1
  __asm  push   Pv2
  __asm  mov    ecx,M2B_BatMan
  __asm  mov    eax,0x4786B0
  __asm  call   eax
  STOP
  _MonsterAfterBattle();
}

BU:R — redraw battlefield, executes:

Code:
void RedrawBF(void)
{
  #include "templ.h"
  __asm{
    mov    ecx,0x699420 //-> CombatManager
    mov    ecx,[ecx]
    push   0
    push   -1
    mov    eax,0x468570
    call   eax
  }
  RETURNV
}


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
17.06.2020 00:11
Find all posts by this user Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Messages In This Thread
ERA BattleQueue - RoseKavalier - 16.06.2020, 08:24
RE: ERA BattleQueue - Grossmaster - 16.06.2020, 08:46
RE: ERA BattleQueue - Bes - 16.06.2020, 10:07
RE: ERA BattleQueue - planetavril - 16.06.2020, 10:29
RE: ERA BattleQueue - Valery - 16.06.2020, 10:43
RE: ERA BattleQueue - igrik - 16.06.2020, 10:45
RE: ERA BattleQueue - Archer30 - 16.06.2020, 11:35
RE: ERA BattleQueue - Algor - 16.06.2020, 11:43
RE: ERA BattleQueue - XEPOMAHT - 16.06.2020, 13:42
RE: ERA BattleQueue - Berserker - 16.06.2020, 13:47
RE: ERA BattleQueue - daemon_n - 16.06.2020, 16:43
RE: ERA BattleQueue - RoseKavalier - 16.06.2020, 17:08
RE: ERA BattleQueue - Algor - 16.06.2020, 17:41
RE: ERA BattleQueue - RoseKavalier - 16.06.2020, 22:39
RE: ERA BattleQueue - daemon_n - 16.06.2020, 23:02
RE: ERA BattleQueue - Berserker - 17.06.2020 00:11
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 01:50
RE: ERA BattleQueue - Berserker - 17.06.2020, 02:23
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 03:03
RE: ERA BattleQueue - Berserker - 17.06.2020, 03:25
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 04:37
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 07:12
RE: ERA BattleQueue - daemon_n - 17.06.2020, 07:35
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 09:26
RE: ERA BattleQueue - Berserker - 17.06.2020, 15:00
RE: ERA BattleQueue - RoseKavalier - 22.06.2020, 03:58
RE: ERA BattleQueue - Berserker - 22.06.2020, 04:22
RE: ERA BattleQueue - Archer30 - 22.06.2020, 12:04
RE: ERA BattleQueue - Archer30 - 09.07.2020, 11:27
RE: ERA BattleQueue - RoseKavalier - 09.07.2020, 17:29
RE: ERA BattleQueue - daemon_n - 08.08.2020, 16:24
RE: ERA BattleQueue - Bes - 08.08.2020, 23:10
RE: ERA BattleQueue - daemon_n - 08.08.2020, 23:35
RE: ERA BattleQueue - Bes - 09.08.2020, 00:05
RE: ERA BattleQueue - RoseKavalier - 09.08.2020, 07:43
RE: ERA BattleQueue - daemon_n - 09.08.2020, 12:04
RE: ERA BattleQueue - Bes - 09.08.2020, 15:44
RE: ERA BattleQueue - RoseKavalier - 10.08.2020, 01:15
RE: ERA BattleQueue - ilya - 07.05.2021, 20:14
RE: ERA BattleQueue - helgtla - 20.12.2021, 19:43
RE: ERA BattleQueue - Berserker - 20.12.2021, 23:01
RE: ERA BattleQueue - RoseKavalier - 21.12.2021, 05:54
RE: ERA BattleQueue - RoseKavalier - 31.12.2021, 07:33
RE: ERA BattleQueue - Berserker - 31.12.2021, 11:31
RE: ERA BattleQueue - Raistlin - 31.12.2021, 21:29

Forum Jump:

Powered by MyBB Copyright © 2002-2024 MyBB Group