Объявления | ||
---|---|---|
Друзья, если не получается зарегистрироваться, напишите на почту vdv_forever@bk.ru. Я оторву свою задницу от всех дел и обязательно Вас активирую! Добро пожаловать на геройский форум! |
Re: Как создать плагин для HD модаИ еще вопрос - можно ли как-то получить массив охраняемых объектов монстром?
|
|
Re: Как создать плагин для HD модаI copy pasted the address 0x4FDF6B from before, open debugger and look what you are trying to patch first!
A quick recap on patcher_x86 HiHook and LoHook: LoHook is best used to alter portion of a function, non-related data to current spot, or when you need access to specific registers or data from the stack (ESP values). HiHook is best used to alter a function, entirely, or partly. The nicest thing about HiHook is that it can combine what several LoHooks would do into a single hook. You can completely skip what Heroes3 code does if you wish to. They both have their uses, one is not better than the other. LoHook can technically be placed anywhere in the code portion, but there are still 2 rules to follow. 1- LoHook must be placed at the start of an instruction, not in its middle. 2- LoHook cannot be placed halfway over a loop There could also be specific cases where it's problematic but these are the 2 most relevant. VALID INVALID HiHook can ONLY be placed on * CALL instruction E8 12 34 56 78 ... this is CALL_ hooktype * CALL DWORD instruction FF 15 88 77 66 55 ... this is also CALL_ hooktype * PUSH EBP 55 ... or over other HiHook at start of function E9 12 34 56 78 *** this is SPLICE_ hooktype * VIRTUAL TABLE or similar function pointer 88 77 66 55 ... for example it would be the address being called by case #2 CALL DWORD --- So in summary, 0x4FDF6B is not valid for either HiHook or LoHook! If you absolutely want HiHook here, try SPLICE_ & THISCALL_ at 0x4FDF64, but a LoHook will do just as fine. |
Re: Как создать плагин для HD модаThanks for great description.
Made LowHook at 0x4FDF64. This condition returns false:
|
|
Re: Как создать плагин для HD модаApologies this is not correct, objects are not yet written to Mapitems. Instead it is required to go through o_GameMgr->Map.Positions and o_GameMgr->Map.Types or whatever they're called in homm3.h. Positions give you x,y,z coordinates and a reference number to Types. Types give you type, subtype and some more details. |
|
Re: Как создать плагин для HD модаHere is some shell code, not tested.
|
Re: Как создать плагин для HD модаЦитата: It works! And monsters are removing by changing they coordinates! "MapItem1->road" is working. So the only thing I need is - how to get passability of the tile. "MapItem1->attrib" doesn't work. Ben80s code looks too complicated. Also it will be fine to know is it resource at the tile. And how to remove resource from the tile. |
|
Re: Как создать плагин для HD модаAt this point I believe you have to recreate your own passability grid, the h3m data is already gone and MapItems attribute not yet written.
This is one of the reason post-processing is not optimal, it adds a lot of code to execute! Using the same _Object_ and _Template_, create a grid [mapsize][mapsize] then use _Template_->ImpassBitMask and _Template_->TriggerBitMask to map out passability. To remove an item, the optimal way (at this stage in post-processing) is to remove it from _List_<_Object_>. To do this, you need to expand _List_::DeleteEntry() to work on all item sizes. This can be done with memmove() or simply copy the last item into the place you wish to delete. Last step, decrease _List_<_Object_>->EndData by 1 as the list is now shorter. Another way to remove an item is to make a list of items to delete and then use the DeleteObjectOnMap() function 0x4AA820 from heroes3 after drawing is done, then clean up everything after. Try to create a passability grid (entrance, impassable, road) and object types, then print it out to compare. |
Re: Как создать плагин для HD модаRoseKavalier писал(а): May be, simply byte - int conversation issue ? |
Re: Как создать плагин для HD модаNeed a code example, how to get passability of the tile X,Y.
Tried different variants, bot didn't get a result. |
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 4