Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding defense multiplier to ID.
#1
In battle mode you can adjust the main characters defense by changing it from 1.0 to 1.5, 2.0, 2.5 and 3.0

Can you hex edit so a specific ID can have a specific defense multiplier all the time? That way they take less damage from attacks.

So say I have 3 ID's
ID 70, 71 and 72. I want ID 70 to have 2.5 defense by default. 71 to have 3.0 and 72 to have 3.5

So in a VS mode battle, character 70 vs 72, 72 would probably always win just cause of increased defense.

Further on that, can you use 1.1, 1.2, 1.3, etc? aka does it have to be increased by 0.5 or can you increase it by smaller/different increments.


I've seen this thread where Silva talks about armor multiplier being stored at object + 0x340 but I don't understand it that well.
I have done some minor hex editing. Like extremely basic beginner things. Only editing values. Not adding anything.
So any extra steps and information you can provide will be much more helpful in the process.
Also, patience is required for my n00by mind when it comes to hex editing.

Thanks!
Reply
Thanks given by:
#2
its for the dbz mod right
Reply
Thanks given by:
#3
I have no idea where you should place the code, but I think this should do what you want (didn't test :P).
    ASM-Code:
;some code here
0  mov eax,dword ptr ds:[esi+edi*4+194h]  ;you initialize by setting the object array pointer to eax
1  cmp dword ptr ds:[eax+368h],46           ;compare id with 70
2  JE .add2.5armoraddress                       ;if equal, jmp to where the defending thing is changed
3  cmp dword ptr ds:[eax+368h],47
4  JE .add3.0armoraddress
5  cmp dword ptr ds:[eax+368h],48
6  JE .add3.5armoraddress
7 ;some more code here

add2.5armoraddress:
    ASM-Code:
100  mov dword ptr ds:[eax+340h], FA      ;here, you actually change the defense to 250
101  jmp 3

add3.0armoraddress:
    ASM-Code:
102  mov dword ptr ds:[eax+340h], 12C
103  jmp 5

add3.5armoraddress:
    ASM-Code:
104 mov dword ptr ds:[eax+340h], 15E
105 jmp 7
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#4
A-MAN is pretty close.

You should add the code in the function which creates the object.

Code:
004064BE  |. 899E 40030000  MOV DWORD PTR DS:[ESI+340],EBX

Here. You don't need to get the pointer, it's already in ESI.
So the following would compare ids:
Code:
cmp dword ptr ds:[esi+368h],46h

You should jump from 004064BE to somewhere, put your code and jump back. Or use the DLL.

A-MAN: Can you give him the full details?
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by:
#5
(05-17-2014, 08:05 AM)TheKidd Wrote:  its for the dbz mod right

yes it is.



I tried and failed lol
The game crashed when it loaded all data files.
I'm not cut out for this hex editing stuff haha
Reply
Thanks given by:
#6
Aah, didn't see this. Here is everything you should do in steps:
1-Ctrl+G: 004064BE
2-Replace the code with:
    ASM-Code:
JMP .someunoccupiedaddressatthebottom


3-Ctrl+G: .someunoccupiedaddressatthebottom
4-there, copy this code:
    ASM-Code:
MOV DWORD PTR DS:[ESI+340],EBX    ;thats the original line you replaced. don't think its necessary to keep this, but for you to get the main idea 
cmp dword ptr ds:[esi+368h],46h       ;i am comparing the ids here 
JE .add2.5armoraddress                     
cmp dword ptr ds:[esi+368h],47h
JE .add3.0armoraddress                     
cmp dword ptr ds:[esi+368h],48h
JE .add3.5armoraddress                     
jmp 004064BF                                  ;i'm not sure that's the exact address,
                                                    ; but its basically the one under the ORIGINAL address you jmped from


add2.5armoraddress (another unoccupied address XD):
    ASM-Code:
mov dword ptr ds:[esi+340h], FA      ;here, you actually change the defense to 250
jmp WWXXYYZZ                           ;jmp to the line "cmp [esi+368h],47h"


add3.0armoraddress (a third unoccupied address):
    ASM-Code:
mov dword ptr ds:[esi+340h], 12C
jmp WWXXYYZZ                           ;jmp to the line "cmp [esi+368h],48h"

add3.5armoraddress (a 4th unoccupied address):
    ASM-Code:
mov dword ptr ds:[esi+340h], 15E
jmp WWXXYYZZ                           ;jmp to the line "jmp 004064BF", or you can just jump to 004064BF



The idea is basically taking a detour from the original loading process and getting back on the track after you "inject" what you want. That's pretty much like when you go out to buy groceries, and on the way, you stop for sometime to get yourself some other stuff you wanted and wasn't originally planned for your trip. At the address where the object is loaded, you jump down to get some extra stuff, that is adding the multiplier, and after you're done you jump back to continue the original loading process. CMP is ASM's version of "if(){do stuff}", except that it "stacks" the result of the comparison until the next line; that is when you actually say "JE XXXX-> jump if the comparison was equal to XXXX" where XXXX is the address where the multiplier is to be changed (in other words, if (id == decimal(0x46)){mov or declare the new multiplier as the id's (which is then stored at ESI+368h)).
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by: bashscrazy
#7
Thanks A-Man! I appreciate the long detailed answer.

I followed it to the best of my ability.

Here's a pic of what I did, when I run the exe, it crashes like before.

I'm not sure why.

But again, thanks for all your help. I really appreciate it!
Reply
Thanks given by:
#8
At 446BAE, shouldn't you jump back to 4064C4 instead of 4064BF? Now you are jumping into the middle of an instruction...
Reply
Thanks given by: bashscrazy
#9
What Ikran said. Instructions takes up some space too. I did also clearly say that next to the line :P :
[Image: WybQRn1.png]
Now it should work. Good luck.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#10
Oh, oops! haha. Thanks Ikran and A-Man!
The game runs now, but the armor doesn't appear to be working. :s

It should be working for ID 70, 71 and 72 yes? Those are my 3 Vegeta characters. They are still taking normal damage :'(
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)