Current time: 14.03.2025, 19:21 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
ERA III
Author Message
daemon_n Offline
Administrators

Posts: 4348
Post: #871

Archer30, top part isnt text field. As solutiion - bottom alignment


Image: widget.png?style=banner2

Новейший Heroes Launcher
16.01.2021 23:36
Visit this user's website Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1190
Post: #872

Thanks Berserker, no biggie.

daemon_n, thank you. Figured out myself )


Latest ERA mods and scripts in development - My GitHub
16.01.2021 23:55
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1190
Post: #873

Berserker, a very weird problem here.

A player reported that the bin patch "quick battle no retreat question" didn't work. I checked and confirm his report.

bin
Code:
01 00 00 00 D0 78 47 00 03 00 00 00 EB 26 90

My erm:
  1. !?FU(OnGameEnter);
  2. !!UN:C4683984/1/235;
  3. !!UN:C4683985/2/9872;
  4. !!UN:C4683984/1/?y1;
  5. !!UN:C4683985/2/?y2;
  6. !!IF:M^%y1, %y2^;

Result:
Image: 3ebaOc0.jpg

This looks super weird. Fie Why is the value changed immediately after setting up? Something hooked?


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

Posts: 16730
Post: #874

-21 = unsigned 235.
byte is 0..255 or -128..+127, just a point of treatment.
Everything seems ok with your code. It worked earlier, tried without HD-mod?


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

Posts: 1190
Post: #875

Thanks. Didn't think of that 96-copy

But, it looks like ERA breaks this patch.
  1. !?FU(OnGameEnter);
  2. !!UN:C4683984/1/?y1;
  3. !!UN:C4683985/2/?y2;
  4. !!IF:M^%y1, %y2^;
I have 87, -150 returned with neither mod nor HD involved.


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

Posts: 16730
Post: #876

4748D6: EB3590909090
This is better patch. Probably, original patch is wrong.


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

Posts: 16730
Post: #877

Image: image.png
  1. !?FU(OnAdventureMapRightMouseClick);
  2. !!CM:R(FALSE);
  3. !!FU(AdvMap_SetHint):P^daemon & panda + archer & perry^;
  1. !?FU(SaveGame);
  2. !#VA(fileNamePtr:x); File name without extension to save game to.
  3. !#VA(appendExtension:x); OPT boolean. If true, automatical extension will be appended to file name. Default: TRUE.
  4. !#VA(compressFile:x); OPT boolean. If true, saved file is gzipped. Otherwise the file is written without compression. Default: TRUE.
  5. !#VA(saveToData:x); OPT boolean. If true, saving is performed to Data directory instead of "Games" directory. Default: FALSE.
  6. !#VA(markInList:x); OPT boolean. If true, saved game will be marked in Save/Load dialogs as selected. Default: TRUE.
  7. !?FU(ClearScreenLog);
  8. ; Clears green screen log messages
  9. !?FU(H3Dlg_GetRootDlg);
  10. ; Returns root dialog object or NULL. Most of the time it's Adventure Map dialog.
  11. !#VA(result:x);
  12. !?FU(H3Dlg_GetCurrentDlg);
  13. ; Returns topmost dialog object or NULL. It may be message box, custom dialog or any in-game dialog.
  14. !#VA(result:x);
  15. !?FU(H3Dlg_SendCmdToItem);
  16. ; Sends command to h3 dialog item like DL:A.
  17. !#VA(h3Dlg:x); H3 dialog object address.
  18. !#VA(itemId:x); Dialog item ID.
  19. !#VA(cmdSubtype:x); Command subtype. See DLG_CMD_XXX constants.
  20. !#VA(param:x); User-specified value. Some numeric parameter or string in case of DLG_CMD_SET_TEXT.
  21. !#VA(cmdType:x); Optional. Type of command/action. Default: (DLG_CMD_TYPE_DEFAULT)
  22. !?FU(H3Dlg_DrawItemOnScreen);
  23. ; WoG function, drawing dialog item or the whole dialog on the screen.
  24. !#VA(h3Dlg:x);
  25. !#VA(itemId:x); Dialog item ID or (ALL_ITEMS).
  26. !?FU(H3Dlg_UpdateItemRange);
  27. ; Sends update command (0/0) to dialog items in specified range. Additionally forces dialog to update its internal state.
  28. ; Use the function after sending commands to native H3 dialogs and before trying to redraw them.
  29. !#VA(h3Dlg:x); H3 dialog object address
  30. !#VA(minItemId:x); Minimal item ID to update
  31. !#VA(maxItemId:x); Maximal item ID to update


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

Posts: 1190
Post: #878

My apologies Berserker, now I understand why the patch disabling retreat msg didn't work. It's only becoz when I renamed it, I also removed its "bin" extension by accident. Kap
The patch works perfectly well so there is no need to update it.

Nice list of pre-defined functions! 132


Latest ERA mods and scripts in development - My GitHub
18.01.2021 23:00
Find all posts by this user Quote this message in a reply
feanor Offline

Posts: 624
Post: #879

(09.01.2021 00:27)feanor Wrote:  формат шрифта потом найду и выложу, но там версии если только самому прикручивать, кажется.

Короче, так
- 5 байт заголовок, {31, 255, 8, 0, 0}
- 1 байт высоты глифов
- 26 нулевых байт
- 256 раз по три дворда: отступ от символа слева, ширина, отступ от символа справа. Отступы могут быть отрицательными
- 256 двордов, которые показывают смещение данных о глифе
- 256 битмапов на каждый глиф, ширина*высота байт

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace H3Fnt
{
    struct H3Char
    {
        public int left;
        public int width;
        public int right;
        public int offset;
        public byte[] bytestring;

        public int height;
    }
}
[/code]
Code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace H3Fnt
{
    internal class H3Font
    {
        byte[] tmp_header;
        public byte height;
        byte[] tmp_fill;
        public H3Char[] charset;

        public H3Font()
        {
            tmp_header = new byte[]{31,255,8,0,0};
            height = 0;
            tmp_fill = new byte[26];
            charset = new H3Char[256];
        }

        public void Load(string path)
        {
            using (BinaryReader br = new BinaryReader(File.Open(path, FileMode.Open)))
            {
                this.tmp_header = br.ReadBytes(5);
                this.height = br.ReadByte();
                this.tmp_fill = br.ReadBytes(26);

                for (int i = 0; i != 256; i++)
                {
                    this.charset[i].left = br.ReadInt32();
                    this.charset[i].width = br.ReadInt32();
                    this.charset[i].right = br.ReadInt32();

                    this.charset[i].height = this.height;
                }
                for (int i = 0; i != 256; i++)
                {
                    this.charset[i].offset = br.ReadInt32();
                }

                /*for (int i = 0; i != 255; i++)
                {
                    fnt[i].bytestring = br.ReadBytes(fnt[i+1].offset - fnt[i].offset);
                }
                fnt[255].bytestring = br.ReadBytes(fnt[255].width * heigth);*/

                for (int i = 0; i != 256; i++)
                {
                    this.charset[i].bytestring = br.ReadBytes(this.charset[i].width * this.height);
                }
            }
        }


        public void Save(string path)
        {
            using (BinaryWriter br = new BinaryWriter(File.Open(path, FileMode.Create)))
            {
                br.Write(tmp_header);
                br.Write(height);
                br.Write(tmp_fill);

                for (int i = 0; i != 256; i++)
                {
                    br.Write(this.charset[i].left);
                    br.Write(this.charset[i].width);
                    br.Write(this.charset[i].right);
                }

                for (int i = 0, offset = 0; i != 256; i++)
                {
                    br.Write(offset);
                    offset += this.charset[i].width * this.height;
                }

                for (int i = 0; i != 256; i++)
                {
                    br.Write(this.charset[i].bytestring);
                }
            }
        }
    }
}
20.01.2021 22:09
Find all posts by this user Quote this message in a reply
daemon_n Offline
Administrators

Posts: 4348
Post: #880

Вот что интересно. В мультиплеерной битве игрок защитник видит 1 ПК за партией, а нападающий - больше.

Если точнее, то для нападающего:
V?$1/?$2/?$3/?$4/?$5
    $4 – один или более ПК в игре = 1 – больше одного
BA:E = 1

Для защитника обе команды возвращают 0


Image: widget.png?style=banner2

Новейший Heroes Launcher
21.01.2021 06:45
Visit this user's website Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16730
Post: #881

XX:V? YY:V?


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

Posts: 4348
Post: #882

Berserker, UN:V и BA:E, если я тебя правильно понял.


Image: widget.png?style=banner2

Новейший Heroes Launcher
21.01.2021 19:12
Visit this user's website Find all posts by this user Quote this message in a reply
daemon_n Offline
Administrators

Posts: 4348
Post: #883

[quote='Berserker' pid='121229' dateline='1610979222']
Image: image.png

А в новой версии не будет обновления экрана каждую секунду, если подсказка не отличается? А то в текущем варианте наблюдается мерцание подсказки на движение мыши по тому же объекту, если сделать просто
  1. !?FU(OnAdvMapTileHint);
  2. !!MM:M?(existingHint:z);
  3. !!MM:M^%(existingHint)^;

Ну и выполнение какой либо функции на MM выдаёт в строку цифры. То 10, то 1000, то 20.

UPD: Если под курсор попадает герой, который находится в центре экрана (активный - после ЛКМ на нём в панели героев или на карте), то "тип объекта" возвращается "0", а не "34";



Image: widget.png?style=banner2

Новейший Heroes Launcher
21.01.2021 21:49
Visit this user's website Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16730
Post: #884

Проверил код. Мерцания не наблюдаю.
По герою верно. Такова механика игры. Активный герой отсутствует в структуре клетки. Вместо него виден объект под героем, например, шахта. Или 0 для почвы. Потому не грех ещё OW:A вызвать и проверить координаты активного героя, если нужна подсказка для героя.


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

Posts: 4348
Post: #885

Berserker, мерцания запишу на видео чуть позднее, а пока с объектами разбираюсь.
Поскольку беру в привычку писать н а ERM 2.0, то вот вопрос: как в игре выражается (NO_OBJ)? Пустая карта приключения начинается с 0, если там, скажем, нет объекта.
А то записываю (NO_OBJ), думая, что он равен 0, а код не работает) Хорошо хоть, что догадался проверить EEF consts. , а то уже писал бы в спортлотоRolleyes
  1. !#DC(NO_OBJ) = -1;
  2. !#DC(ANY_OBJ) = -1;
  3. !#DC(OBJ_FIRST) = 0;
  4. !#DC(OBJ_STUB) = 0;


Image: widget.png?style=banner2

Новейший Heroes Launcher
23.01.2021 00:58
Visit this user's website 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-2025 MyBB Group