Guard loosing life when loose tile hits him

Discussions about all other tools (CusPop, SAV/HOF editors) and hex editing.
Post Reply
4DPlayer

Guard loosing life when loose tile hits him

Post by 4DPlayer »

Is there a way to hex-edit Prince.exe to make this possible?
I’ve gotten pretty handy with hex-editing lately.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Guard loosing life when loose tile hits him

Post by David »

4DPlayer wrote: July 7th, 2019, 10:32 pm Guard loosing life when loose tile hits him

Is there a way to hex-edit Prince.exe to make this possible?
I'm afraid that's not so simple.

In SDLPoP this is the code that checks if a loose floor fell onto the prince: https://github.com/NagyD/SDLPoP/blob/ma ... 07.c#L1191
To make a similar check for guards, we would need to make a copy of this check with loadshad/saveshad instead of loadkid/savekid.
While that change is simple in SDLPoP, it's much harder to do in PRINCE.EXE.
4DPlayer

Re: Guard loosing life when loose tile hits him

Post by 4DPlayer »

David wrote: July 13th, 2019, 10:31 am
4DPlayer wrote: July 7th, 2019, 10:32 pm Guard loosing life when loose tile hits him

Is there a way to hex-edit Prince.exe to make this possible?
I'm afraid that's not so simple.

In SDLPoP this is the code that checks if a loose floor fell onto the prince: https://github.com/NagyD/SDLPoP/blob/ma ... 07.c#L1191
To make a similar check for guards, we would need to make a copy of this check with loadshad/saveshad instead of loadkid/savekid.
While that change is simple in SDLPoP, it's much harder to do in PRINCE.EXE.
Alright, it’s fine. I just wanted to know how easy it was (if possible). I don’t actually need to implement it.
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Guard loosing life when loose tile hits him

Post by dmitrys »

Would that approach work if the guard is in a room below that you have not visited?

I did something similar in my mod where the guard dies if a tile falls on his head like in POP2 but in a hackier way. The game checks when you enter the guard if he is standing on debris that were not there initially. The hacky part is that the room can contain other debris tiles and the guard can move there during a fight. So I also have to track if there was a live guard standing on debris when leaving a room so he does not die if you re-enter it. So the logic is only limited to rooms and levels where it is possible to drop a tile on a guard.
Post Reply