Jump to content
Taimon

Various ToB hacks

Recommended Posts

I was looking at the dispel fix and I was interested in using it in my game. However I am not sure how to make it work. Can I copy the code into another mod's tp2 file? Which lines of code would I need? I tried just renaming a weidu.exe which I chose as setup_tactics to setup-tob_hacks.exe.

 

When I open it it runs all the other weidu.exe files and when it finishes at tob_hacks it stops at (pid=-1) without listing a version number.

 

I took this code out of your .tp2 file and put it into an already existing mod. I used a very simple mod that has only 1 component and placed it at the end. It seems to install the changes but I am not sure if it did anything. Is this all I need?

 

//Dispel Fix

BEGIN ~Fix the formula in the dispel effect~
DESIGNATED 40

OUTER_PATCH_SAVE orig_bytes_1 ~~ BEGIN
   INSERT_BYTES 0x000 0xe
   WRITE_LONG   0x000 0x8b0ac06b
   WRITE_LONG   0x004 0xe1811c4d
   WRITE_LONG   0x008 0x000000ff
   WRITE_SHORT  0x00c 0xc12b
END

OUTER_PATCH_SAVE patch_bytes_1 ~~ BEGIN
   INSERT_BYTES 0x000 0xe
   WRITE_LONG   0x000 0x811c4d8b
   WRITE_LONG   0x004 0x0000ffe1
   WRITE_LONG   0x008 0x6bc12b00
   WRITE_SHORT  0x00c 0x0ac0
END

OUTER_PATCH_SAVE orig_bytes_2 ~~ BEGIN
   INSERT_BYTES 0x000 0x12
   WRITE_LONG   0x000 0x7ff4553b
   WRITE_LONG   0x004 0x18458b0d
   WRITE_LONG   0x008 0x0000ff25
   WRITE_LONG   0x00c 0x63f88300
   WRITE_SHORT  0x010 0x097e
END

OUTER_PATCH_SAVE patch_bytes_2 ~~ BEGIN
   INSERT_BYTES 0x000 0x12
   WRITE_LONG   0x000 0x7463fa83
   WRITE_LONG   0x004 0x18458b0d
   WRITE_LONG   0x008 0x0000ff25
   WRITE_LONG   0x00c 0xf4453b00
   WRITE_SHORT  0x010 0x097c
END

COPY bgmain.exe bgmain.exe
   READ_ASCII 0x00143f42 target_bytes_1 ELSE 0 (0xe)
   READ_ASCII 0x00143f97 target_bytes_2 ELSE 0 (0x12)
   PATCH_IF (~%target_bytes_1%~ STRING_EQUAL ~%orig_bytes_1%~)
        AND (~%target_bytes_2%~ STRING_EQUAL ~%orig_bytes_2%~)
   THEN BEGIN
       WRITE_ASCIIE 0x00143f42 ~%patch_bytes_1%~ (0xe)
       WRITE_ASCIIE 0x00143f97 ~%patch_bytes_2%~ (0x12)
   END ELSE
   PATCH_IF (~%target_bytes_1%~ STRING_EQUAL ~%patch_bytes_1%~)
        AND (~%target_bytes_2%~ STRING_EQUAL ~%patch_bytes_2%~)
   THEN BEGIN
       PATCH_PRINT ~Patch already applied. Skipping ...~
   END ELSE INNER_ACTION BEGIN FAIL ~Target bytes don't match. Aborting ...~ END
BUT_ONLY

Edited by AzureDrag0n1

Share this post


Link to post
When I open it it runs all the other weidu.exe files and when it finishes at tob_hacks it stops at (pid=-1) without listing a version number.

This is WeiDU autoupdate failing due to some unknown problem. (unrelated to the tp2 itself)

You can try to invoke it with --noautoupdate or do the update manually.

FOR %s IN (setup-*.exe) DO copy /Y weidu.exe %s

 

And yes, that's all you need for the dispel fix.

Edited by Taimon

Share this post


Link to post
This should go after any mod that completely replace the bgmain.exe.

No restriction otherwise. But I'd install it as late as possible, to get rid of it, when it starts crashing your game.

Folks over at BWP install the two .exe patches "Enable conversations with charm creatures" and "Experience Corrections" before anything else. I understand your patch is not tested but, in theory is it not better to install as soon as possible as well?

Share this post


Link to post

Since the only file affected by exe patches is bgmain.exe, it matters very little if other files were modified by another mod. Installing such patches in the last order means they can be uninstalled with more ease than if they were put in the beginning - there'll be no reinstalling the whole bunch of normal mods.

Share this post


Link to post

From shs http://www.shsforums.net/index.php?showtopic=39276

 

Yeah, I can. Nullpointer dereference. :)

 

Try replacing the previous patch_part2 with this:

OUTER_PATCH_SAVE patch_part2 "" BEGIN
INSERT_BYTES 0x00 len_part2
WRITE_LONG   0x00 0x8b51006a
WRITE_LONG   0x04 0xb773cc0d
WRITE_LONG   0x08 0x48c18100
WRITE_LONG   0x0c 0xe800006c
WRITE_LONG   0x10 0xffc75947
WRITE_LONG   0x14 0xff10958b
WRITE_LONG   0x18 0x1a8bffff
WRITE_LONG   0x1c 0x1874db85
WRITE_LONG   0x20 0x90909090
WRITE_LONG   0x24 0x8b52006a
WRITE_LONG   0x28 0xb773cc0d
WRITE_LONG   0x2c 0x48c18100
WRITE_LONG   0x30 0xe800006c
WRITE_LONG   0x34 0xffc75923
WRITE_LONG   0x38 0xfd448d8b
WRITE_LONG   0x3c 0x118bffff
WRITE_LONG   0x40 0x8a1052ff
END

Not the cleanest solution but hopefully it will work.

 

still seems to crash with me...

 

Visible: Try pickpocket -> fail -> crash

Invisible: Try pickpocket -> fail -> dialog -> visible -> fail -> dialog

Share this post


Link to post

Did you try the version in this thread? (see first post / uninstall whatever you installed before)

 

Works for me -- but if you still encounter this problem, please provide a savegame and I'll have a look.

Share this post


Link to post

Your priests used some non-standard spell that crashed the savegame upon loading, but nothing that couldn't be fixed.

 

I experienced some crashes while pickpocketing but didn't find a way to reproduce it reliably. It was fairly random.

 

However, seeing that it still crashes I decided to rework the patch and now went the better-safe-than-sorry path. Should be fixed now.

 

Thanks for the report.

Share this post


Link to post
Guest @vGur

(from @vGur)

Thanks for Your great work!

 

By default, when U carrying 100+% of Ur maximum weight (101 for example) U start to move in half speed & after reaching additional 20% (120) U can't move anymore. Can this number (120%) be changed to something like 300/400%. Another question, is it possible to add additional effect, like dexterity penalty, to creature who carrying too much (Like in DnD3+).

 

Reason for this - U can carry 200lb, but U can't run with it, like everyone in BG2 likes to do. Another words, person with 5 full plate armors in his backpack is easy target to compare with someone without them. What I want is maximum 50-100lb, when U still can move with 200-300, but slow & deffinetely not in combat.

 

Even if this is too hard, many thanks for all U've done before :)

Share this post


Link to post
Guest temujin_
Even if this is too hard...

 

Nothing is too hard for the daimyo of modding. These hardcoded limitations of the vastly intimidating EXE are now nothing more than mere obstacles to be overcome with Taimon's sheer will and brute force. 8718.gif

 

 

I'm sure Tai will somehow find his way through this blizzard. I know he will. I *know* it.

 

 

And as usual, he'll unlock this puzzle in the blink of an eye that the masses will be singing a different tune:

 

"gee, was it really hardcoded all these years?"

 

 

n368.gif

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Am I wrong, Mr. T?

 

:)

Share this post


Link to post
Can this number (120%) be changed to something like 300/400%.

The value that you need to change is at 0x6b73a0. It's a 16-bit word, but keep little endianness in mind when you go over 255.

 

Another question, is it possible to add additional effect, like dexterity penalty, to creature who carrying too much (Like in DnD3+).

No, because once I start doing those things, I'm sure everyone wants to have there own personal modification.

And adding stuff is always much more difficult than modifying something. (very limited amount of space)

Share this post


Link to post
And adding stuff is always much more difficult than modifying something. (very limited amount of space)
Hmm, just overwrite all that multiplayer code.

 

It's all useless anyway. :-)

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...