Page 1 of 1

Guard loosing life when loose tile hits him

Posted: July 7th, 2019, 10:32 pm
by 4DPlayer
Is there a way to hex-edit Prince.exe to make this possible?
I’ve gotten pretty handy with hex-editing lately.

Re: Guard loosing life when loose tile hits him

Posted: July 13th, 2019, 10:31 am
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.

Re: Guard loosing life when loose tile hits him

Posted: July 13th, 2019, 3:20 pm
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.

Re: Guard loosing life when loose tile hits him

Posted: October 4th, 2020, 12:41 am
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.