Does SDLPoP recording works when cheats on?

Open-source port of PoP that runs natively on Windows, Linux, etc.
Post Reply
dronno
Sheikh
Sheikh
Posts: 20
Joined: June 27th, 2020, 1:53 pm

Does SDLPoP recording works when cheats on?

Post 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 51 times
My intention was to obtain something like this (captured via dosbox):
lvl8.zip
(140.43 KiB) Downloaded 53 times
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Does SDLPoP recording works when cheats on?

Post 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?
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
dronno
Sheikh
Sheikh
Posts: 20
Joined: June 27th, 2020, 1:53 pm

Re: Does SDLPoP recording works when cheats on?

Post 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?
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Does SDLPoP recording works when cheats on?

Post 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.
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: Does SDLPoP recording works when cheats on?

Post 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.)
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Does SDLPoP recording works when cheats on?

Post 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.
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: Does SDLPoP recording works when cheats on?

Post 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 1544 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.
User avatar
dmitrys
Developer
Developer
Posts: 195
Joined: October 1st, 2020, 6:05 am

Re: Does SDLPoP recording works when cheats on?

Post 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.
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1786
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: Does SDLPoP recording works when cheats on?

Post 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?
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: Does SDLPoP recording works when cheats on?

Post 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 41 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?
Post Reply