Page 1 of 1

Does SDLPoP recording works when cheats on?

Posted: July 19th, 2020, 9:40 pm
by dronno
Hi,

I noticed that my recording does not work with cheats on, at least in this example.
level 8.p1r
(3.23 KiB) Downloaded 164 times
My intention was to obtain something like this (captured via dosbox):
lvl8.zip
(140.43 KiB) Downloaded 192 times

Re: Does SDLPoP recording works when cheats on?

Posted: July 20th, 2020, 10:57 am
by atrueprincefanfrom18
You would have to turn the cheats on with Backspace -> General -> Turn cheats on (or something similar). SDLPoP replays all the inputs so if you press "R" to Revive Prince, as the game doesn't have cheats enabled, it won't happen.

Hope that helped?

Re: Does SDLPoP recording works when cheats on?

Posted: July 20th, 2020, 10:17 pm
by dronno
So I launch the .p1r file, pause it before the prince starts running and enable cheats. but still he falls down and dies. did my .p1r file work for you?

Re: Does SDLPoP recording works when cheats on?

Posted: July 21st, 2020, 5:22 am
by atrueprincefanfrom18
Enable cheats, CTRL + R, and then load the file.

No I didn't try it running even though I downloaded it.

Is it possible to just double click it and run it directly in SDLPoP on Linux? I'm using Ubuntu 18.04.

Re: Does SDLPoP recording works when cheats on?

Posted: July 25th, 2020, 10:16 am
by David
atrueprincefanfrom18 wrote: July 20th, 2020, 10:57 am You would have to turn the cheats on with Backspace -> General -> Turn cheats on (or something similar). SDLPoP replays all the inputs so if you press "R" to Revive Prince, as the game doesn't have cheats enabled, it won't happen.
No, SDLPoP does not (currently) record cheat keys, therefore it can't play them back.
atrueprincefanfrom18 wrote: July 21st, 2020, 5:22 am Is it possible to just double click it and run it directly in SDLPoP on Linux? I'm using Ubuntu 18.04.
Right-click any P1R file, then select "Open with..." or "Open With Other Application..." (or something similar).
In the window that opens, browse to the SDLPoP executable.
I think you also need to check a checkbox saying you always want to open this type of file with this application.
(Sorry for being so uncertain, but I don't have any Linux installed currently, so I'm writing this from memory.)

Re: Does SDLPoP recording works when cheats on?

Posted: July 25th, 2020, 2:07 pm
by atrueprincefanfrom18
David wrote: July 25th, 2020, 10:16 am No, SDLPoP does not (currently) record cheat keys, therefore it can't play them back.
Oh, I remember playing them back, but it's not clear to me yet. But if you confirm, then it should be true. So I am sorry for wrong info supplied... :(
David wrote: July 25th, 2020, 10:16 am
atrueprincefanfrom18 wrote: July 21st, 2020, 5:22 am Is it possible to just double click it and run it directly in SDLPoP on Linux? I'm using Ubuntu 18.04.
[...]
Don't know how that's done. If you find a demonstration video, please let me know.

Re: Does SDLPoP recording works when cheats on?

Posted: July 26th, 2020, 8:00 pm
by David
atrueprincefanfrom18 wrote: July 25th, 2020, 2:07 pm Don't know how that's done. If you find a demonstration video, please let me know.
At what point are you stuck?


Anyway, I tried this on a computer with XUbuntu installed.
(It's like Ubuntu but with XFCE. This might mean that the things on my screenshots don't match your OS.)

There the menu item is called "Open With Other Application...".
assoc_1_crop.png
assoc_1_crop.png (21.65 KiB) Viewed 2829 times
The window which it opens looks like this:
assoc_2.png
At the bottom it's possible to use a custom command. I entered the full path to the SDLPoP executable there (not shown).


However! As the text at the top says, clicking "Open" now will associate SDLPoP with all "unknown" files, not just *.p1r files!

To add a new filetype for *.p1r files, do the following:
(Note: This is new for me as well. I figured things out from web searches, man pages, and from the existing files under ~/.local/share/mime/ .)

Create a file called user-extension-p1r.xml with the following content:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
 <mime-type type="application/x-extension-p1r">
  <comment>SDLPoP replay file</comment>
  <glob pattern="*.p1r"/>
 </mime-type>
</mime-info>
Then install it with this command:

Code: Select all

xdg-mime install user-extension-p1r.xml
You can also add an icon to *.p1r files with this command:

Code: Select all

xdg-icon-resource install --context mimetypes --size 32 SDLPoP/data/icon.png application-x-extension-p1r
Now *.p1r files have a separate filetype, and if you associate them with SDLPoP then it won't affect other kinds of files.

The association can also be done with a command if SDLPoP has a desktop file installed:

Code: Select all

xdg-mime default /usr/share/applications/SDLPoP.desktop application/x-extension-p1r
or if the desktop file is installed locally:

Code: Select all

xdg-mime default ~/.local/share/applications/SDLPoP.desktop application/x-extension-p1r

I guess I should add this to make install.
Update: I did it on a new branch: https://github.com/NagyD/SDLPoP/commit/ ... 23492fa373

By the way, make install is usually ran with sudo.
But if I run the above xdg-mime install command with sudo then it takes a rather long time.
I'm not sure why, maybe this way it looks through the system-wide installed filetypes?
For this reason, I changed the location of the SDLPoP.desktop file to the per-user path in the commit above so it can be used without sudo.

Re: Does SDLPoP recording works when cheats on?

Posted: January 3rd, 2021, 6:16 am
by dmitrys
I also had problems with recordings when I introduced a key to manually take out and quickly take down the sword. It also did not replay kid's moves correctly with fake tiles implemented in the SDLPoP code. So I had to disable it in my mod.

Re: Does SDLPoP recording works when cheats on?

Posted: January 3rd, 2021, 7:16 am
by atrueprincefanfrom18
dmitrys wrote: January 3rd, 2021, 6:16 am I also had problems with recordings when I introduced a key to manually take out and quickly take down the sword. It also did not replay kid's moves correctly with fake tiles implemented in the SDLPoP code. So I had to disable it in my mod.
Maybe because the new key doesn't get written/recorded in p1r file? We don't even know the format of p1r. Maybe David could explain it?

Re: Does SDLPoP recording works when cheats on?

Posted: January 3rd, 2021, 3:26 pm
by David
atrueprincefanfrom18 wrote: January 3rd, 2021, 7:16 am
dmitrys wrote: January 3rd, 2021, 6:16 am I also had problems with recordings when I introduced a key to manually take out and quickly take down the sword.
Maybe because the new key doesn't get written/recorded in p1r file?
New keys are not recorded automatically into the P1R file.
Any new key has to be explicitly handled when recording and when playing back.

You can see here how I made SDLPoP record and replay such a key.

atrueprincefanfrom18 wrote: January 3rd, 2021, 7:16 am We don't even know the format of p1r. Maybe David could explain it?
I made a short documentation based on the SDLPoP source.
See the attachment.
P1R_format.txt
(791 Bytes) Downloaded 166 times
dmitrys wrote: January 3rd, 2021, 6:16 am It also did not replay kid's moves correctly with fake tiles implemented in the SDLPoP code. So I had to disable it in my mod.
Can you post an example?