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

Post Reply 
Threaded Mode | Linear Mode
ERA III
Author Message
XEPOMAHT Offline
Moderators

Posts: 2265
Post: #1876

(18.10.2021 09:34)Archer30 Wrote:  I want to report another problem of the fucntion of getting the hero's basic primary skills. Spell Scrolls must be set as exceptions, otherwise we'd get bugs.

1. Снимать арты с героя для получения первичных навыков, а потом снова одевать арты - мегакостыли. Научитесь уже читать таблицу с бонусами первичных навыков от артефактов и перестаньте страдать воговщиной. 108
2. Скриптовые функции "!!FU(UnequipArtFromSlot):P(hero)/(slot);" и "!!FU(EquipArtToSlot)&(art)<>(NO_ART):P(hero)/(art)/(slot);" скорее всего не умеют снимать и одевать на героя свитки с заклинаниями (код данных функций не известен, что и как они делают автор проблемы увы не написал, рекомендуется для этого дела всё же использовать родные содовские функции).
18.10.2021 10:56
Find all posts by this user Quote this message in a reply
daemon_n Offline
Administrators

Posts: 4333
Post: #1877

XEPOMAHT, 1. Многие арты могут быть уже заскриптованы как раз на снятие, что никак в таблице не будет отражено.


Image: widget.png?style=banner2

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

Posts: 16449
Post: #1878

XEPOMAHT, ага. И 2) Собственно, это переходники к содовским функциям.
Есть адрес и структура таблицы с бонусами первичных навыков и понимание, почему в воге она свая? Потому что в оригинальной нет новых артефактов?

Archer30, which bugs did you mean with spell scrols?


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

Posts: 2265
Post: #1879

(18.10.2021 13:17)Berserker Wrote:  2) Собственно, это переходники к содовским функциям.

И где посмотреть-то что там понакручено???

Дать артефакт в слот герою - вызов 4E2C70h
Забрать артефакт из слота героя - вызов 4E2E40h

В обоих функциях арт проверяется на свиток и работает обновление заклинаний, даваемых артефактами.

(18.10.2021 13:17)Berserker Wrote:  Есть адрес и структура таблицы с бонусами первичных навыков и понимание, почему в воге она свая? Потому что в оригинальной нет новых артефактов?

Эмм... тогда это что такое в воговских сорцах:

1. Базовый адрес таблицы, которую можно читать с помощью UN:C

Code:
// бонусы артифактов
    {0x4E2D26,DP(ArtBonus),4}, //

2. Собственно, перенесённая вогом таблица (Эмереал переносит её точно так же, поэтому разницы не будет, если конечно... Берсеркер опять против базовой адресации):

Code:
// Artifact
_ArtSetUp_ ArtTable[ARTNUM];
char       ArtBonus[ARTNUM][4];
char       ArtBonusAdd[ARTNUM-ARTNUM_0][4]={// новые артифакты
    {0,0,0,0},
    {0,0,0,0},
};
18.10.2021 14:04
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1098
Post: #1880

Berserker, there was no "/(art)>=(ART_CENTAUR_AXE)/(art)<1000" from the original function. The function will try to unequip scroll and equip back - thus results in problems.


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

Posts: 16449
Post: #1881

XEPOMAHT,


Из кода сразу видны два адреса: 4E2C70, 4E2E40. Собственно, ты критикуешь то, что предлагаешь.

Quote:2. Собственно, перенесённая вогом таблица
HE:F../../../../1 с этой таблицей работает, но весьма сбойно, если командирский артефакт назначить слоту, например. Что с таблицей делают плагины артефактов не проверял. Просто люди жалуются на вылеты. Ещё любой код в событии Одеть/снять артефакт может реализовать собственные бонусы. Такие бонусы отловить только способом одел/снял всё можно.

Подозреваю, что проблема свитков в другом. Номер заклинаний хранится ведь в отдельном поле. Нужно тестировать, да времени пока нет.


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

Posts: 2265
Post: #1882

(18.10.2021 22:23)Berserker Wrote:  Из кода сразу видны два адреса: 4E2C70, 4E2E40. Собственно, ты критикуешь то, что предлагаешь.

Как раз наоборот: я попросил твой код, который вызывает функцию одевания артефакта. Сейчас смотрю его и вижу, что вызов у тебя организован неправильно, от чего и портятся свитки. Spiteful

А именно, на функцию должен подаваться адрес 8-байтного куска памяти, в котором должны быть записаны идентификаторы артефакта и свитка. Ты же подаёшь 4-байтный номер артефакта, что естественно будет приводить к записи мусора в структуру героя, где хранится свиток, одетый на героя. А ERM-то с такими весёлыми штуками работать не умеет, поэтому для вызова 4E2C70 потребуется отдельная ERM-команда с соответствующим переходником (на худой конец можно использовать переменные v1 и v2, сохраняя их значения в переменные y, посылая адрес v1 на функцию, а затем восстанавливая v1 и v2 после вызова, но это уже как-то смотрится кастыльновато...). Spiteful Твоя текущая реализация в виде "!!SN:E5123184/(CALLCONV_THISCALL)/(heroStruct)/?(art)/(slot);" всегда будет приводить к ошибкам в структуре героя.
(This post was last modified: 19.10.2021 07:43 by XEPOMAHT.)
19.10.2021 07:26
Find all posts by this user Quote this message in a reply
Bes Offline

Posts: 5422
Post: #1883

XEPOMAHT, 132 красавчик,этих молодых надо иногда осаживать,чтоб не зазнавались
19.10.2021 08:32
Visit this user's website Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16449
Post: #1884

XEPOMAHT, точно, забыл что там указатель на структуру ArtType/ArtSubType, исправлю, спасибо!


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

Posts: 1098
Post: #1885

A suggestion of UN:I placing object command:
An additional parameter can be added to switch between "using the coordinates as the bottom right of the object" and "using the coordinates as the entrance of the object".
It is a little bit tricky to explain, but I will try.

Currently, the main purpose of this command is for object replacement. For example, in the Object Replacement Template, it's used for placing a replacement object after removing the original with UN:O. However, when I use it in the template, it isn't convenient enough. In the template, an X coordinate offset and Y coordinate offset have to be set since the UN:I command generates the new object using the the given coordinates as the bottom right of the object, instead of using as the entrance.

Take Library of Legends (dwelling of Emissary of Lore) for example. By searching this object with the object replacement template, we get the coordinate of the yellow tile. By placing an obejct with exactly the same passability, we've got to set X coordinate offset and Y coorindate offset to 1.

Image: irjt10F.png
Yellow: Coordinate of the original obejct (get from function)
Red: New object would be placed with Red in the given coordinate

These offsets vary among objects. A script writter has to check the object manually from the map editor to make sure the object is placed correctly. Back to my suggestion, if there is a way to place an object using the given coordinate as the entrace, such trouble can be avoided.

What do you think about the idea Rolleyes


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

Posts: 16449
Post: #1886

Archer30, what if object has two yellow squares?


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

Posts: 1098
Post: #1887

Berserker, what's the algorithm for SN:O in this case? I suppose only the same needs to be used


Latest ERA mods and scripts in development - My GitHub
22.10.2021 12:25
Find all posts by this user Quote this message in a reply
XEPOMAHT Offline
Moderators

Posts: 2265
Post: #1888

(22.10.2021 12:25)Archer30 Wrote:  what's the algorithm for SN:O in this case? I suppose only the same needs to be used

На стандартном ERM рассчитать разницу координат разве проблема? В ERA+ данный двеллинг уничтожается и перестраивается без проблем.
(This post was last modified: 22.10.2021 14:03 by XEPOMAHT.)
22.10.2021 14:02
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16449
Post: #1889

Archer30, SN:O probably returns the first found yellow square.


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

Posts: 1098
Post: #1890

Yup. In most situations, a script writer would prefer UN:I placing an object from the first yellow square, instead of the square at bottom right. That's my conclusion.


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 22.10.2021 18:46 by Archer30.)
22.10.2021 17:30
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