Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: Endless backpack
Thread: Endless backpack
qoty
qoty


Adventuring Hero
wandering hero
posted June 30, 2012 09:35 PM

Endless backpack

I'm just curious about possibillity having a backpack for 519849 artifacts . It's possible? Need I certain script or something special?
____________
Freedom comes at a price

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted June 30, 2012 09:38 PM

Sorry, the maximum possible through script is 519848.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
qoty
qoty


Adventuring Hero
wandering hero
posted July 01, 2012 09:22 AM

Thanks so much !
____________
Freedom comes at a price

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted July 02, 2012 03:55 PM

Where to get this script? Is it simple one or it have much of !!UN:C ? where the artifacts info is stored? I would like to experiment with this, or at least get and test the original script (if the artifacts are stored directly on hero data it may be possible to add new slot this way - there would be 1000 places or so for backpack and rest would be reserved for special use - but I worry it wouldn't be as easy as it seems hence authors of 6th_slot.dll had uneasy work implementing this and it seems they had to use old Catapult slot for the feature)....

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OxFEA
OxFEA


Promising
Famous Hero
feanor on DF2.ru
posted July 02, 2012 06:25 PM

Quote:
Where to get this script?

It's a joke.

Quote:
where the artifacts info is stored?

In structures of heroes. 8 bytes per each (artifact id + customdata) +some info about locked slots.

Quote:
worry it wouldn't be as easy as it seems hence authors of 6th_slot.dll had uneasy work implementing this and it seems they had to use old Catapult slot for the feature)....

it was easy. But making it to work correctly is harder..so it is not done.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted July 21, 2012 03:52 PM

This is just what i mean by "it" and "uneasy". I meant game to treat new slot exactly the same as old slot, so for example I can store there orb of vulnerability and assuming the slots are hidden and not autoequipable it would give the ability to hero permanently ("active sack").
Sometimes lack of ui is feature rather than bug ... But UI slots would be nice too.
Of course inactive (not worn) or blank (fully handled by ERM but probably worn) can be handled via smart use of SN:W variables, but it is not what I intended to ask... (But this brings me Idea of script-only "infinite" backpack similair to multisack having  a bunch of SN:W variables per hero, but I wonder how to properly handle passing of hidden artifacts after lost battle... Maybe ?!HE is enough? Maybe handle specially garrisoned hero?).

I would be thankful for adresses of functions which scans for hero worn artifacts (to make them process out-of-hero data like worn artifact).
Also there would be nice example of artifact-button (a part of ui which would behave like artifact slot but would rather trigger event or function when something is placed rather than store data directly).
Basically artifact-button is a part of ui which can look liike any legal state of artifact slot but instead of putting data on hero it would call ERM function with hero, artifact, action, button ID numbers as the arguments list (we already have simple buttons via plugin so that should be also possible).

Still no rush on help since I have many incomplete projects including WoG mods.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OxFEA
OxFEA


Promising
Famous Hero
feanor on DF2.ru
posted July 21, 2012 06:19 PM

Quote:


I would be thankful for adresses of functions which scans for hero worn artifacts (to make them process out-of-hero data like worn artifact).


There is no such function.
Although, in h3 exist int(__thiscall *HasCreature)(void *hero, int creature) = (int(__thiscall *)(void*, int))(0x44AA90); but it handle very limited number of artifacts. In other cases h3 uses inline functions (e.g. at 0x4E3A8C)

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted July 22, 2012 10:11 AM

You said most of them are inline? That make problem "a bit" worse...
Inline function = function without name glued several times in machine code?
But once we find what is the code sequence for the inline function, it should be easy find another instances via asm_search or binary_search ability of binary debugger? (I cannot do most beneficial actions in it yet, but touched enough to know how it generally works).
With my limited knowledge of assembler I should be able to do that if I would have adress of one instance of each inline functions (since each instance of one inline function is supposed to be exactly same It's enough to find begin and end of such and use selection for binary search).

Anyway thanks for help to lazy me, and function you pointed may be enough for my aims...

Speculating, sometimes inline functions are better for hacker/RE because he/she can change each instance separately? Yeah I know, it's mostly worse because tedious work for trying to find and fix all instances.

Sorry for me still not completing my work despite gaining more and more help. Well I'm now hospitalised and not have a wifi and left most of backup in home, but 2 or 3 weeks ago it was not the case so I should put more attention to actually DOING something instead just learning theoretising and planning. I promise I would put serious work aiming at making at least part of my projects ready.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OxFEA
OxFEA


Promising
Famous Hero
feanor on DF2.ru
posted July 22, 2012 02:17 PM

Quote:
it should be easy find another instances via asm_search or binary_search ability of binary debugger?


No. At least - registers can be different


CPU Disasm
Address   Hex dump          Command                                  Comments
004E3A8E  |> /8339 2D       /CMP DWORD PTR DS:[ECX],2D
004E3A91  |. |74 31         |JE SHORT 004E3AC4
004E3A93  |. |40            |INC EAX
004E3A94  |. |83C1 08       |ADD ECX,8
004E3A97  |. |83F8 13       |CMP EAX,13
004E3A9A  |.^\7C F2         \JL SHORT 004E3A8E


CPU Disasm
Address   Hex dump          Command                                  Comments
004E3A50  |> /8338 6C       /CMP DWORD PTR DS:[EAX],6C
004E3A53  |. |74 31         |JE SHORT 004E3A86
004E3A55  |. |41            |INC ECX
004E3A56  |. |83C0 08       |ADD EAX,8
004E3A59  |. |83F9 13       |CMP ECX,13
004E3A5C  |.^\7C F2         \JL SHORT 004E3A50

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
solitaire345
solitaire345


Promising
Famous Hero
posted July 22, 2012 05:25 PM

What about function at 0x4D9460? I guess this is the one you are looking for. (arguments: Hero*, artID)
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OxFEA
OxFEA


Promising
Famous Hero
feanor on DF2.ru
posted July 22, 2012 07:54 PM

Quote:

Although, in h3 exist int(__thiscall *HasCreature)(void *hero, int creature) = (int(__thiscall *)(void*, int))(0x44AA90); but it handle very limited number of artifacts.


I mistaked functions, yes, not HasCreature but HasArtifact

int(__thiscall *HasArtifact)(void *hero, int art) =
     (int(__thiscall *)(void*, int))(0x4D9460);

int(__thiscall *HasArtifactInBackpack)(void *hero, int art) =
     (int(__thiscall *)(void*, int))(0x4D9420);

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted July 28, 2012 05:02 PM
Edited by majaczek at 17:04, 28 Jul 2012.

Oh HasArtifact! It seems exactly one I wanted...

I will try it once... If I will be to long lagging at the stuff, at least other knows.
If i were to implement it now I would prepare flat number interface  (art_count variables for each hero number accessible via SN:W meaning virtually has if equal 1) so it would be easy to use by my and other mods ....

Is there a function perhaps which do the same for battlefield? (Giving virtual orb of vulnerability or pedant of negativity would be nice thing but if I wanted this IE for non-hero army such as town or decide after battle start it would be harder, but it seems it's my problem, anyway things such as irresistible magic from AL would be much easier and less bug prone after the plugin).

I think about potential usage also on ... Blank artifacts! (To combine some features of SoD artifacts without a combo).

edit: and in_backpack too... Seems simiraily nice.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OxFEA
OxFEA


Promising
Famous Hero
feanor on DF2.ru
posted July 28, 2012 09:51 PM
Edited by OxFEA at 21:53, 28 Jul 2012.

Quote:
I think about potential usage also on ... Blank artifacts! (To combine some features of SoD artifacts without a combo).




int __stdcall NewHasArtifact(HiHook* h, HERO* hero, int art)
{
int ret = CALL_2(int, __thiscall, h->GetDefaultFunc(), hero, art);

if (h->GetReturnAddress() < 0x700000 && h->GetReturnAddress() > 0x400000) //морочим только SoD;
{
for (int i=0; i!=19; i++)
{
if (art==ARTIFACT_SPELLBOOK && hero->IArt[i ][0]!=-1 &&  //если герои лезут за книжкой, то
GetArtifactRecord(hero->IArt[i ][0])->rank & 0x40) //мы проверяем наличие спеллбуков во всех слотоах и подменяем ответ
{
//sprintf(buf,"NewHasArtifact::Spellbook found at slot %i", i);
//WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE),(const void*)buf,64,0,0);
return true;
}


if (art==ARTIFACT_ANGELWINGS && hero->IArt[i ][0]!=-1 &&
IsArtifactAllowFly(hero->IArt[i ][0],hero->IArt[i ][1]))
{
return true;
}


if (art==ARTIFACT_WATERBOOTS && hero->IArt[i ][0]!=-1 &&
IsArtifactAllowWaterWalk(hero->IArt[i ][0],hero->IArt[i ][1]))
{
return true;
}
}
}

return ret;
}

int __stdcall NewHasArtifactInBP(HiHook* h, HERO* hero, int art)
{
int ret = CALL_2(int, __thiscall, h->GetDefaultFunc(), hero, art);

if (h->GetReturnAddress() < 0x700000 && h->GetReturnAddress() > 0x400000)//морочим только SoD;
{
for (int i=0; i!=19; i++)
{
if (art==ARTIFACT_SPELLBOOK && hero->IArt[i ][0]!=-1 && (GetArtifactRecord(hero->IArt[i ][0])->rank & 0x40))
{
//sprintf(buf,"NewHasArtifactInBP::Spellbook found at slot %i, artid:%i rank: %x", i, hero->IArt[i ][0], GetArtifactRecord(hero->IArt[i ][0]));
//WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE),(const void*)buf,64,0,0);
return true;
}

}

for (int i=0; i!=64; i++)
{
if (art==ARTIFACT_SPELLBOOK && hero->OArt[i ][0]!=-1  && (GetArtifactRecord(hero->OArt[i ][0])->rank & 0x40))
{
//sprintf(buf,"NewHasArtifactInBP::Spellbook found at bp slot %i", i);
//WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE),(const void*)buf,64,0,0);
return true;
}
}
//собственно, спеллбуком полезность этого хука и ограничивается.
//Ну, вроде, еще машины где-то засветились.
}
return ret;
}
...

emerald->WriteHiHook(0x4D9460, SPLICE_, EXTENDED_, THISCALL_, (void*)NewHasArtifact);
emerald->WriteHiHook(0x4D9420, SPLICE_, EXTENDED_, THISCALL_, (void*)NewHasArtifactInBP);


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
majaczek
majaczek


Supreme Hero
Work at Magic Dimmension
posted July 29, 2012 11:01 AM

Wait, is this code already in emerald or you are trying to implement my wanted feature into new emerald?
Or am I just supposed to edit emerald code and recompile ? (Anyway would be nice to get latest emerald source code).

Or you are Implying my future plugin would be sadly incompatible with emerald? Anyway implementing if you wish any of this in emerald by yourself would make me lazy and happy

(I have to try hard on RE to do anything new, but I'm more bound to having features than trying to be famous, and I'm almost lazy so my work is so little when my wants are so huge).

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0538 seconds