Page 1 of 6

Re: I need help with exit doors

Posted: June 17th, 2020, 7:22 pm
by Emiliano
Hi again, I would like to disable Jaffar's death triggers exit door in level 12b and change it to like other exit doors in other levels, just opened by stepping on a button linked to them, I would like to do this in some of my mods
It may involve Hex editing, doesn't it?

Re: I need help with exit doors

Posted: June 17th, 2020, 7:32 pm
by atrueprincefanfrom18
By default, in Level 12b after "first" Jaffar is killed, except the level opening door, you can go through all the level exit doors. I guess to prevent that you need to do hex editing and it was discussed somewhere, but I can't find it right now. If I find it, I'll let you know.

Re: I need help with exit doors

Posted: June 17th, 2020, 7:34 pm
by Emiliano
I guess it's better to ask David for this case
Don't you think so?

Re: I need help with exit doors

Posted: June 17th, 2020, 7:35 pm
by atrueprincefanfrom18
Emiliano Fierro wrote: June 17th, 2020, 7:34 pm It's better to ask David for this case
Don't you think so?
Then wait for 3 days ;)

Re: I need help with exit doors

Posted: June 17th, 2020, 7:42 pm
by atrueprincefanfrom18
It was already into the special events page :)
Check this.

Re: I need help with exit doors

Posted: June 17th, 2020, 7:45 pm
by Emiliano
Thanks

Re: I need help with exit doors

Posted: June 17th, 2020, 8:02 pm
by Emiliano
I read the whole thread and I couldn't find a post that fully answers my request, I will wait for David

Re: Modifications to prince.exe (hex editing)

Posted: June 17th, 2020, 8:23 pm
by Emiliano
Hi there, I would like to fix this bug
You will see, in the left side I set loose floors and by the right side I set a poisonous blue potion I don't know if it is related
Even thought the colors are 199 199 199 and 255 255 255 in the bug for dungeon and, 93 93 93 and 52 52 52 for palace. I just don't like it and I would like to fix them
Thanks for the help

Re: Modifications to prince.exe (hex editing)

Posted: June 17th, 2020, 8:26 pm
by Emiliano
And other hack:
I would like to make the skeletons swap their direction when the hear the prince's steps (like the other guards) instead of keeping it
See the images

I need help with custom hacks

Posted: June 18th, 2020, 5:17 am
by Emiliano
Hi there, I made this post just because David always reads the posts in this forum, sorry :(
I supplicate you to keep this post at least until David replies :(
As the topic title says, I need some custom hacks for my next mod Lihinghntom's Twisty Levelset
First
(Default) Jaffar's death triggers exit door in level 12b
(Custom) Exit door can only be opened by stepping on a button linked to it
Second
(Default) A bug between a loose floor in the left side and a potion in the right side
(Custom) No bug between a loose floor and a potion
Third and last for now
(Default) Skeletons don't turn even if they hear the prince's steps
(Custom) Skeletons turn if they hear the prince's steps (behavior of the other guards)
Sincerely I really wonder if is this one possible

I guess it would be useful to have an answer in this same thread instead of various dispersed replies in the original topics
However you will see what to do

Re: I need help with custom hacks

Posted: June 20th, 2020, 4:24 pm
by David
Emiliano Fierro wrote: June 18th, 2020, 5:17 am First
(Default) Jaffar's death triggers exit door in level 12b
(Custom) Exit door can only be opened by stepping on a button linked to it
Search: C7 06 9C 40 02 00
Change to: 90 90 90 90 90 90 (offset is 0x9B78 in unpacked v1.0)

Details:

Code: Select all

in on_guard_killed():
seg006:15FF 83 3E 9E 0F 0D             cmp  current_level, 13 ; Jaffar's level: flash
seg006:1604 75 1D                      jnz  loc_82D3
seg006:1606 C7 06 94 4D 0F 00          mov  flash_color, colors_15_white_flash_texts ; white
seg006:160C C7 06 50 43 12 00          mov  flash_time, 18
seg006:1612 C7 06 1C 43 01 00          mov  is_show_time, 1
seg006:1618 C7 06 9C 40 02 00          mov  leveldoor_open, 2 ; <-- we remove this
seg006:161E B8 2B 00                   mov  ax, sound_43_Jaffar_death

Emiliano Fierro wrote: June 18th, 2020, 5:17 am Third and last for now
(Default) Skeletons don't turn even if they hear the prince's steps
(Custom) Skeletons turn if they hear the prince's steps (behavior of the other guards)
These will disable the skeleton always being active, because only inactive guards can turn around.

Search: 80 3E 2D 3D 04 75 10 C6 06 2E 3D 02
Change: 75 to EB (offset is 0x50F4 in unpacked v1.0)

Search: C6 06 2E 3D 02 0E E8 0B 00
Change: first 5 bytes to 90 90 90 90 90 (offset is 0x5780 in unpacked v1.0)

But now the skeleton's sword will disappear when it's inactive.
To fix this:
Search: 80 3E 2D 3D 02 75 65
Change: 75 to 7C (offset is 0x9D1C in unpacked v1.0)

Details:

Code: Select all

in enter_guard():
seg002:01BF 80 3E 2D 3D 04           cmp  char.charid, charid_4_skeleton ; skeleton
seg002:01C4 75 10                    jnz  loc_3856 ; <-- we change this to jmp
seg002:01C6 C6 06 2E 3D 02           mov  char.sword, 2

in autocontrol_skeleton():
seg002:0850 C6 06 2E 3D 02           mov   char.sword, 2 ; <-- we remove this
seg002:0855 0E                       push  cs
seg002:0856 E8 0B 00                 call  near ptr autocontrol_guard

in add_sword_to_objtable():
seg006:17B7 80 3E 2D 3D 02           cmp  char.charid, charid_2_guard ; guard
seg006:17BC 75 65                    jnz  return ; <-- we change this to jl

Re: I need help with custom hacks

Posted: June 20th, 2020, 4:33 pm
by Emiliano
Thanks David

Re: I need help with custom hacks

Posted: June 27th, 2020, 4:25 pm
by David
Emiliano Fierro wrote: June 18th, 2020, 5:17 am Second
(Default) A bug between a loose floor in the left side and a potion in the right side
(Custom) No bug between a loose floor and a potion
This bug happens with both potions and swords. I made a fix for both.

To fix the bug with potions:
Search: 0E E8 6C FD
Change: 6C to 7A (offset is 0xA21E in unpacked v1.0)

To fix the bug with swords:
Search: 0E E8 45 FD
Change: 45 to 53 (offset is 0xA245 in unpacked v1.0)

Details:

Code: Select all

We replace two calls to set_redraw_anim_curr (seg007:018C) with calls to redraw_at_trob (seg007:019A).
set_redraw_anim_curr redraws both the potion (or sword) and the right half of the loose floor on the left.
redraw_at_trob redraws the left half of the floor under the potion (or sword) as well, hiding the edge of the loose floor.

The offsets in "call near" instructions are relative to the offset of the next instruction, that's why we need the subtractions.

in animate_potion():
seg007:041C 0E                    push  cs
seg007:041D E8 6C FD              call  near ptr set_redraw_anim_curr
seg007:0420

old: 0x018C - 0x0420 = 0xFD6C
new: 0x019A - 0x0420 = 0xFD7A

in animate_sword():
seg007:0443 0E                    push  cs
seg007:0444 E8 45 FD              call  near ptr set_redraw_anim_curr
seg007:0447

old: 0x018C - 0x0447 = 0xFD45
new: 0x019A - 0x0447 = 0xFD53

Re: I need help with custom hacks

Posted: June 27th, 2020, 4:28 pm
by Emiliano
Thanks, now it will look better :D

Re: I need help with custom hacks

Posted: July 6th, 2020, 6:46 pm
by atrueprincefanfrom18
On the other hand, if there are no special events, don't you think the level would be boring to play?