To be honest I am uncertain what the exact request is, if trying to recreate the drawing function then the answer is quite different and a lot longer.
If trying to get the correct def name for the obelisk at (x,y) then that's simpler but a bit of work is needed nonetheless.
(31.08.2020 04:30)Berserker Wrote: [ -> ]RoseKavalier, I think something like MapItem->DefName was required.
Я могу и ошибаться, но если бы была команда OB:Z то с помощью нее можно было бы добираться до имени дефа, мне недавно она очень нужна была в одном месте
П.С. если не ошибаюсь тогда можно было бы добираться до имени дефа по вот этим структурам:
Code:
// * the counterpart to H3ObjectAttributes
struct H3ObjectDetails
{
// * +0
// * reference to H3ObjectAttributes
UINT32 setup;
// * +4
// * x position on map
UINT8 x;
// * +5
// * y position on map
UINT8 y;
// * +6
// * z position on map
UINT8 z;
protected:
h3align _f_7;
public:
// * +8
// * reference to object's DEF for drawing purposes
UINT16 num;
protected:
h3align _f_A[2];
};
struct H3ObjectAttributes
{
// * +0
// * the name of the DEF
H3String defName;
// * +10
// * the width of object, read from LoD @ 0x503ED5
UINT8 width;
// * +11
// * the height of object, read from LoD @ 0x503EE2
UINT8 height;
protected:
h3align _f_12[2];
public:
// * +14
// * a 8x6 bitfield of the object's presence
H3ObjectMask colors;
// * +1C
// * a 8x6 bitfield of the object's passability
H3ObjectMask passability;
// * +24
// * a 8x6 bitfield of the object's shadow
H3ObjectMask shadows;
// * +2C
// * a 8x6 bitfield of the object's yellow tiles
H3ObjectMask entrances;
// * +34
// * a bitfield of vaild terrains for this object
H3Bitfield maskTerrain;
// * +38
// * the type of object, 0 ~ 232
INT32 type;
// * +3C
// * the subtype of object, depends on type
INT32 subtype;
// * +40
// * is the object flat on the adventure map? e.g. cursed ground
BOOL8 flat;
protected:
h3align _f_41;
// * referenced a few places, e.g. 0x50663A
h3unk _f_42[2];
};
(31.08.2020 12:22)Zur13 Wrote: [ -> ]но если бы была команда OB:Z то с помощью нее можно было бы добираться до имени дефа
Уговаривайте Берсеркера, только он может добавить OB:Z в ЭРУ.
XEPOMAHT, ну что за мания всё тянуть в язык? )
Dword MixPos=GetDinMixPos(sp);
_MapItem_ *mip=GetMapItem2(MixPos);
Сделать обычную ЕРМ функцию GetMapItem (x, y, l: integer) => PMapItem.
(31.08.2020 14:37)Berserker Wrote: [ -> ]Dword MixPos=GetDinMixPos(sp);
_MapItem_ *mip=GetMapItem2(MixPos);
Это какой-то неправильный ERM
По делу, а можно подробнее как я могу в ЕРМ вытянуть указатели на структуру объекта в заданных координатах?
(31.08.2020 14:37)Berserker Wrote: [ -> ]ну что за мания всё тянуть в язык? )
На то он и язык, чтобы в нём были готовые получения полезных скриптёру структур.
(31.08.2020 14:37)Berserker Wrote: [ -> ]Сделать обычную ЕРМ функцию GetMapItem (x, y, l: integer) => PMapItem.
А это и не MapItem (описатель клетки карты), а H3ObjectAttributes (описатель объекта карты). По первой структуре почти всё есть в ERM, во второй нет почти ничего (а там могут пригодиться получения разных данных, менять - опасно

).
(31.08.2020 15:23)Zur13 Wrote: [ -> ]По делу, а можно подробнее как я могу в ЕРМ вытянуть указатели на структуру объекта в заданных координатах?
Какая именно структура нужна? Если перерисовать деф без удаления - просите Берсеркера добавить OB:Z.
блин, точно, надо было в донатах чётко указать "на реализацию OB:Z", эх, не догадался
XEPOMAHT, Is implementing a new obelisk receiver easier than adding loop sounds with SN and UN?
From H3MapItem you can get a vector of H3ObjectDraw...
Code:
struct H3ObjectDraw
{
// * +0
// index of H3ObjectAttributes
UINT16 sprite;
// * +2
// * reference to which square of the DEF (bottom right = 0, then left to right, down to top. Row 1: 0x10 and so on)
UINT8 tileID;
// * +3
// * 0~6 drawing layer, 6 being top and 0 bottom
UINT8 layer;
_H3API_ H3ObjectDraw(UINT16 sprite, UINT8 tile_id, UINT8 layer);
};
... which leads you to H3ObjectAttributes. However given it's a vector<H3ObjectAttributes> you have to check each element there by type/subtype or you may wind up with the wrong def (e.g. Cursed Ground with Obelisk on top). This is what I meant by
Quote:[...]that's simpler but a bit of work is needed nonetheless.
(14.05.2020 17:44)Algor Wrote: [ -> ] (14.05.2020 13:31)suftfree Wrote: [ -> ]Получается так?
Нет, не так 
Здравствуйте тут не работает оригинальная музыка можно чтобы она тоже работала, дублировать размер лишний только и поменяйте пожалуйста, чтобы в первой строке Ss на Sc.
suftfree, Sc %2 имелось в виду?
Berserker, в коде неверно указана переменная получения номера дня, потому скрипт работает каждый день (значение y1 всегда 0)
daemon_n, разве? Проблема только в !!VRy1:Ss %2;
Berserker, эммм. Так мы об одном и говорим. Ss не получает день, Sc получает

В чём споры?