New Mod Doubts

Open-source port of PoP that runs natively on Windows, Linux, etc.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: New Mod Doubts

Post by David »

Akruzen wrote: October 8th, 2022, 12:22 pm Also, it seems I can have either have custom graphics, or custom level map. How can I achieve both? Currently, to use my custom level file, I edit the levels using apoplexy editor and put the game in mods folder of SDLPoP. However, when I mention use of mods folder in SDLPoP.ini file, the game uses the mod's (original) graphics and not the one I edited in SDLPoP's data\kid directory. How to achieve both?
You could delete or rename the DAT files (except LEVELS.DAT) from the mods folder.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: New Mod Doubts

Post by David »

Akruzen wrote: October 7th, 2022, 2:28 pm 3. How can I add new sound files to the game? Note that I don't want to change the "Music" in this game. I want to replace and add new sounds for example kid_hurt, draw_sword, etc. which do not come under the music category.
You need to change data/DIGISND*.DAT with PR.

I know the sounds should be in separate files (data/DIGISND*/res*.wav) like the images, but for some reason I did not implement loading sounds from separate files yet.

Alternatively, you can edit data/music/names.txt, add an <ID>=<name> line for a sound effect, then put a <name>.ogg file into the same folder.
The sound IDs are in src/types.h, in enum soundids.
This does not seem to work!?

EDIT: It *does* work.
I just happened to test with an OGG file which triggers a bug in stb_vorbis.
Namely, if an OGG file has no metadata, opening fails with an "out of memory" error.

Fixed it: https://github.com/NagyD/SDLPoP/commit/ ... 59ae28d090
User avatar
Akruzen
Developer
Developer
Posts: 141
Joined: April 30th, 2016, 10:16 am

Re: New Mod Doubts

Post by Akruzen »

David wrote: October 9th, 2022, 1:07 pm You could delete or rename the DAT files (except LEVELS.DAT) from the mods folder.
Thanks for your reply David, that did work.
David wrote: October 9th, 2022, 1:18 pm Alternatively, you can edit data/music/names.txt, add an <ID>=<name> line for a sound effect, then put a <name>.ogg file into the same folder.
The sound IDs are in src/types.h, in enum soundids.
Sure, will try that today.
Any idea on how to resolve doubts 1 and 2? If it is too ambitious or extremely difficult, just let me know and I will try to find a work-around for it. But needless to say, the intended way would be preferred. :)
Thanks again,
Best Regards,
Akruzen
What if life is a video game and Déjà Vu are just checkpoints?
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: New Mod Doubts

Post by David »

Akruzen wrote: October 7th, 2022, 2:28 pm 1. Can I dynamically color the sword (like guards have)? For example, change it's color from white to yellow if certain condition is true.
Here is how I could do it: https://github.com/NagyD/SDLPoP/commit/ ... ed89c0a1fc

(By the way, there was a similar request for DOS PoP here: viewtopic.php?f=68&t=3778 )
Akruzen wrote: October 7th, 2022, 2:28 pm However that poses another problem. Since in some frames the kid and the sword are together, that too will need to change since the sword color is now yellow.
With the original kid images, if I recolor the sword then the kid's clothing is also recolored, because the same color index is used for both.

Here is how to do it anyway: https://github.com/NagyD/SDLPoP/commit/ ... 194c50169f
Probably set_chtab_palette() should be called not where I called it, but when the certain condition becomes true.
Post Reply