I need help with exit doors

Prince of Persia related subjects that do not have their own boards.
Post Reply
User avatar
Emiliano
Wizard Scribe
Wizard Scribe
Posts: 718
Joined: July 31st, 2019, 8:53 pm
Location: Mexico
Contact:

I need help with exit doors

Post by Emiliano »

First, I don't know if this should be here or with the Other Tools and Hex Editing, you can move it if you want
Hi everyone, there's a frustrating situation in one executable file I have, I would like to stop doors in the exit room from auto-opening every time I start a new game. It frustrates me and made me add more doors, I guess it does not depend from exit room number, because in old prototypes I swapped room 9 with room 23 and it simply didn't stop happening
I hope you can help me fixing it
Watch the video to understand what I'm talking about
65536
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1785
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: I need help with exit doors

Post by atrueprincefanfrom18 »

Hex Editing is not the problem. It's the Special Event. Level 1, Room 5, Top Row, 3rd Tile is what triggers everytime you start the Level 1. Simply replace that tile to normal one and it won't happen. In the original game it's the drop tile which closes Room 5, Top Row, Last Tile Door to make you feel that you are pushed into dungeon and the gate is closed.

Hope you got it?

P.S: It's a good idea to read special event page when creating particular level, so as either to allow them or not use them completely.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
David
The Prince of Persia
The Prince of Persia
Posts: 2850
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: I need help with exit doors

Post by David »

atrueprincefanfrom18 wrote: June 11th, 2020, 7:13 am Hex Editing is not the problem. It's the Special Event. Level 1, Room 5, Top Row, 3rd Tile is what triggers everytime you start the Level 1. Simply replace that tile to normal one and it won't happen. In the original game it's the drop tile which closes Room 5, Top Row, Last Tile Door to make you feel that you are pushed into dungeon and the gate is closed.
You're mostly right.
However, it's not enough if you place a non-button tile at that place.
The game will treat it as a closer button, and those can open exit doors as well.

Instead you need to make sure that the modifier of that tile does not point to any valid door event.
For example, if that tile has modifier 0, then event #0 (#1 in Apoplexy) should point to a non-triggerable tile.



Alternatively, you can disable this trigger altogether by hex-editing PRINCE.EXE:

Search: 83 3E 9E 0F 01 75 22 B8 05 00
Change: B8 05 to EB 1B

It changes this part:

Code: Select all

seg003:0243 83 3E 9E 0F 01           cmp   current_level, 1 ; Special event: press tile + falling entry
seg003:0248 75 22                    jnz   loc_4A5C
seg003:024A B8 05 00                 mov   ax, 5 ; <-- we change this to jmp 0267
seg003:024D 50                       push  ax      ; room
seg003:024E B8 02 00                 mov   ax, 2
seg003:0251 50                       push  ax      ; col
seg003:0252 2B C0                    sub   ax, ax
seg003:0254 50                       push  ax      ; row
seg003:0255 9A 06 00 CB 06           call  get_tile
seg003:025A 2B C0                    sub   ax, ax
seg003:025C 50                       push  ax      ; playsound
seg003:025D 50                       push  ax      ; tile
seg003:025E B8 FF FF                 mov   ax, 0FFFFh
seg003:0261 50                       push  ax      ; modifier
seg003:0262 9A 53 0C 55 08           call  trigger
seg003:0267 B8 07 00                 mov   ax, 7      ; fall
seg003:026A EB 0F                    jmp   short loc_4A6B
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1785
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: I need help with exit doors

Post by atrueprincefanfrom18 »

When is your next mod coming?
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Emiliano
Wizard Scribe
Wizard Scribe
Posts: 718
Joined: July 31st, 2019, 8:53 pm
Location: Mexico
Contact:

Re: I need help with exit doors

Post by Emiliano »

atrueprincefanfrom18 wrote: June 17th, 2020, 7:47 pm When is your next mod coming?
Maybe late June or something, you will be surprised with the result ;)
Last edited by Emiliano on June 17th, 2020, 8:29 pm, edited 1 time in total.
65536
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1785
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: I need help with exit doors

Post by atrueprincefanfrom18 »

Emiliano Fierro wrote: June 17th, 2020, 7:49 pm
atrueprincefanfrom18 wrote: June 17th, 2020, 7:47 pm When is your next mod coming?
Maybe late June or something, you will be surprised with the result ;)
Check 5 times to remove all shortcuts :)
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Emiliano
Wizard Scribe
Wizard Scribe
Posts: 718
Joined: July 31st, 2019, 8:53 pm
Location: Mexico
Contact:

Re: I need help with exit doors

Post by Emiliano »

My next mod does not use broken rooms, I don't know if this is harder or easier, players will decide
65536
Post Reply