stackable offset

Gio

Member
What offset in the client do I change to make certain items stackable, like materials and grinders?

Thanks!
 

Soly

Member
I wish to know that too xD
Lee's patch tool does it, but I haven't (shamelessly) copied it to my own patcher, which has a few more things (hardcoded sranks unitxt indexes) and a few less things (resolution patch since I do it with a custom launcher, Tofuman's or my own if he allows me to use his method for widescreen which I haven't asked yet).
 

Gio

Member
I wish to know that too xD
Lee's patch tool does it, but I haven't (shamelessly) copied it to my own patcher, which has a few more things (hardcoded sranks unitxt indexes) and a few less things (resolution patch since I do it with a custom launcher, Tofuman's or my own if he allows me to use his method for widescreen which I haven't asked yet).
Where can I find Lee's patch tool? If what you say is true we could just compare the bytes to find the offset. Also if anyone is interested I can post the offset to the resolutions.
 

Soly

Member
Kinda, but I think it changes asm too, which I'd like to understand :p
I looked around but couldn't locate a post with a download link to it, as he was banned from here apparently.
 

tofuman

Administrator
Staff member
I rewrote the function on the ephinea client so that it gives you more control over whats stackable and by how much. However I believe Lee's method affected all items of that type.

Code:
1x limit - 0x1D5857
10x limit - 0x1D5850
99x limit - 0x1D585E

This is how I went about it (if you're up for some ASM):

Code:
Please note that all addresses are virtual so you'll most likely need a decent hex editor with disassembler features.

Check if stackable function:

Original:
0x5c503d   8B 44 24 08     mov eax, dword ptr [esp+0x8]
0x5c5041   83 F8 09        cmp eax, 0x9
0x5c5044   7D 0F           jge 0x5c5055
0x5c5046   8B 44 24 08     mov eax, dword ptr [esp+0x8]
0x5c504a   83 F8 02        cmp eax, 0x2
0x5c504d   74 0F           jz 0x5c505e
0x5c504f   B8 01 00 00 00  mov eax, 0x1
0x5c5054   C3              ret
0x5c5055   8B 44 24 08     mov eax, dword ptr [esp+0x8]
0x5c5059   83 F8 10        cmp eax, 0x10
0x5c505c   74 F1           jz 0x5c504f
0x5c505e   33 C0           xor eax, eax
0x5c5060   C3              ret

Modified:
0x5c503d   8B 44 24 08     mov eax dword ptr [esp+0x8]
0x5c5041   83 F8 02        cmp eax, 0x2
0x5c5044   74 08           je 0x5c504e
0x5c5046   8A 80 90D39700  mov al, [eax+0x97d390]   // Use any free space in client for array. 0x97d390 used as an example.
0x5c504c   90              nop
0x5c504d   C3              ret
0x5c504e   31 C0           xor eax, eax
0x5c5050   C3              ret
0x5c5051   B8 01000000     mov eax, 0x1
0x5c5056   C3              ret
0x5c5057   90              nop
0x5c5058   90              nop
0x5c5059   90              nop
0x5c505A   90              nop
0x5c505B   90              nop
0x5c505C   90              nop
0x5c505D   90              nop
0x5c505E   90              nop
0x5c505F   90              nop
0x5c5060   C3              ret

The above function will check if its 0302XX if so item isn't stackable. Else look up against the array at 0x97d390. (to be honest I could just look up against the table but seems as techs will never be stackable there's no harm in making it impossible).

Now populate your array at 0x97d390 (if you use the offset provided in the example) with either 0x00 (not stackable) or 0x01 (stackable). There will be a total of 27 entries (030000 - 031A00)

Now to specify by how much are they stackable:
Original
0x5D643A:
85 C0            test eax,eax
74 18            je 005D6456
0F B6 03         movzx eax,byte ptr [ebx]
83 F8 03         cmp eax,03
75 09            jne 005D644F
0F B6 73 01      movzx eax,byte ptr [ebx+01]
83 F8 10         cmp eax,10
74 0E            je 005D645D
B8 0A 00 00 00   mov eax,0000000A
5B               pop ebx
C3               ret
B8 01 00 00 00   mov eax,00000001
5B               pop ebx
C3               ret
B8 63 00 00 00   mov eax,00000063
5B               pop ebx
C3               ret

Modified:
85 C0              test eax,eax
74 14              je 005D6452
0F B6 03           movzx eax,byte ptr [ebx]
83 F8 03           cmp eax,03
75 0C              jne 005D6452
0F B6 43 01        movzx eax,byte ptr [ebx+01]
8A 80 AB D3 97 00  mov al,[eax+0097D3AB]
5B                 pop ebx
C3                 ret
B8 01 00 00 00     mov eax,00000001
5B                 pop ebx
C3                 ret
90                 nop
90                 nop
90                 nop
90                 nop
90                 nop
90                 nop
90                 nop
90                 nop
90                 nop
90                 nop
C3                 ret

The above checks for if not 03XXXX set stack limit to 1. Else look up on stack limit array at 0x97D3AB (again this is just an example of unused space in the client find your own if you like). Then populate the stack limits at 0x97D3AB.  Again with 27 entries. 1 to 255

Now with that done update your ship code with the new stack limits.

Hope that helps.
 
Last edited:

Soly

Member
Not as complicated as I thought this one would be. I'll update when I do something with it. Thank you.
 

Soly

Member
I forgot to update, I have been compiling the usual client patches into a patch (gui) tool.
I added this stack patch of Tofuman too.

I have to rewrite the tool because the code is ugly af, but it does work. I might post it later today.
 

Gio

Member
I forgot to update, I have been compiling the usual client patches into a patch (gui) tool.
I added this stack patch of Tofuman too.

I have to rewrite the tool because the code is ugly af, but it does work. I might post it later today.

Sounds epic man, I'm sure it will help a lot of people.
 

Gio

Member
Celebrated too early. Somehow my client crashes each time meseta is dropped. Did I do something wrong?

Here's my table:
Code:
01 01 00 01 01 01 01 01 01 00 01 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00
Code:
0A 0A 01 0A 0A 0A 0A 0A 0A 01 63 63 01 01 01 01 63 01 01 01 01 01 01 01 01 01 01

Other than the table offsets my code is the same as the one posted.
 

Soly

Member
When I did it, I only tried the stack "flag"... After I got that to work I modified the asm to use the same array for stack flags and stack amount.
Here is a copy of the patcher that has this patch in (single array version), the program it's still missing things and some were left out like resolutions but I plan to rewrite it soon. I think this is the latest build I made, either way backup your client before anything.
Stack 0 means not stackable (techs and scape dolls for example which the program wont edit for reasons).

Look at my tools topic for it.
 
Last edited:

Soly

Member
Look for this code in your project
Code:
// Set up the stack table too.
for (ch=0;ch<0x09;ch++)
{
    if (ch != 0x02)
        stackable_table[ch] = 10;
}
stackable_table[0x10] = 99;
 

Shidouri

Member
Look for this code in your project
Code:
// Set up the stack table too.
for (ch=0;ch<0x09;ch++)
{
    if (ch != 0x02)
        stackable_table[ch] = 10;
}
stackable_table[0x10] = 99;

Does this mean that stackable_table[0x02] is the value in the array to change to enable stacking for previously unstackable items? I’ve successfully patched the client but server keeps throwing errors about inventory max and no item to use after 1 (as discussed previously by others)
 

Soly

Member
The tool group 0x02 is techniques, they cannot be stackable, that's why it's excluded from the set.
Group 0x10 is PDs, PS etc... and that's set to 99.

The rest from 0x00 to 0x09 is set to 10, that's monomates etc...
 

Shidouri

Member
Thanks for that Soly, interesting to know. :)
However, that leads me to ask another in reference to my original question, where are materials, grinders, and other non-stackables defined in this table?
It would lead me to believe it would reside in an array value after stackable_table[0x10], or simply isn't defined here at all o_O
 

Soly

Member
It would lead me to believe it would reside in an array value after stackable_table[0x10], or simply isn't defined here at all o_O
0x0A to 0x0F are not changed either, so they stay at 0.

Just grab the PMT editor, look for the tools tab and each group is each index in that table.
Baj9tCz.jpg
 
Top