Advanced Search

Author Topic: Replacement packs?  (Read 2413 times)

0 Members and 1 Guest are viewing this topic.

March 15, 2016, 01:22:03 AM
Read 2413 times

Offline Hilman170499

  • MM8BDM Extender

  • BLUE FOR DAYS!!!
  • **
  • Date Registered: March 18, 2012, 05:49:26 AM

    • View Profile
Replacement packs?
« on: March 15, 2016, 01:22:03 AM »
Hey guys. So uh, is it possible to make something that you can place in the skin folder to replace a graphic or sound file? If so, may I please know how? Thanks in advance.

March 15, 2016, 03:53:44 AM
Reply #1

Offline Orange juice :l

  • Warrior
  • ***
  • Date Registered: October 10, 2010, 08:41:18 PM

    • View Profile
    • http://cutstuff.net/forum/memberlist.php?mode=viewprofile&u=590
Re: Replacement packs?
« Reply #1 on: March 15, 2016, 03:53:44 AM »
I tried a while back, but there was a great deal of confusion as Airhorn Chat was able to do it, but replicating the code for other sounds didn't seem to work. If there's a reliable way to replace sounds either in core or in mods (ala classes) via the skins folder, I would like to know as well.

March 15, 2016, 05:56:55 AM
Reply #2

Offline Russel

  • MM8BDM Extender

  • Doc Croc
  • ***********
  • Date Registered: December 17, 2010, 11:11:25 PM

    • View Profile
Re: Replacement packs?
« Reply #2 on: March 15, 2016, 05:56:55 AM »
If you place sound files in the root folder of a pk3 and place said pk3 in the skins folder.

I'm unsure if sprites or other graphics can be replaced in this manner, though.

I do know that usually skins are loaded before the 8BDM pk3, so that does make native resource replacement more difficult.

March 15, 2016, 12:00:12 PM
Reply #3

Offline MusashiAA

  • MM8BDM Contributor

  • Byeah
  • *****
  • Date Registered: February 16, 2010, 04:44:54 AM

    • View Profile
    • My Covers on YouTube
Re: Replacement packs?
« Reply #3 on: March 15, 2016, 12:00:12 PM »
If I recall correctly, it's because of the order the engine loads files. I think it first loads iwad files (which then load the main pk3 file for 8BDM?????), THEN it loads files detected in the skins folder, THEN it loads extra files that were assigned to load manually. Since Airhorn Chat loaded after MM8BDM.pk3, it effectively replaced the chat sound effect the core file has with its own. If a manually assigned file was loaded and it contained a file a skins folder file replaced, then it would get replaced as well.

This is all based on conjecture based off a fuzzy reminiscense of poking around with stuff:

- Engine loads content files in specific order
- .iwad file loads file.dat.
- Main .pk3 loads file.dat thats different from the one the .iwad file loaded, and replaces it
- As per engine asks, skins folder is scanned and all its files are loaded, one of which contains file.dat thats different from the previous two, and replaces the previous one loaded.
-As per requested by the user, extra .pk3 files are loaded last, and one of them contains file.dat thats different from the previous three, and replaces the previous one loaded.
-The game boots up, the file.dat from the extra .pk3 is used.

So if you place a file named in the same way as a file that's automatically loaded into the game inside the skins folder, it'll replace it as long as it's not replaced further into the engine's file loading process.

March 15, 2016, 07:09:22 PM
Reply #4

Offline Orange juice :l

  • Warrior
  • ***
  • Date Registered: October 10, 2010, 08:41:18 PM

    • View Profile
    • http://cutstuff.net/forum/memberlist.php?mode=viewprofile&u=590
Re: Replacement packs?
« Reply #4 on: March 15, 2016, 07:09:22 PM »
I could have sworn that the skins folder was loaded last, but that would explain it.

March 17, 2016, 03:57:50 PM
Reply #5

Offline Russel

  • MM8BDM Extender

  • Doc Croc
  • ***********
  • Date Registered: December 17, 2010, 11:11:25 PM

    • View Profile
Re: Replacement packs?
« Reply #5 on: March 17, 2016, 03:57:50 PM »
Musashi is correct, aside from the order things are loaded in.
The load order is actually zandronum.pk3, then megagame.wad, then skins, then announcers, then bots, all before pwads like MM8BDM.pk3.
The resource loader also ignores file extensions, so you can have a OGG replace a WAV or something like that.

So all of this still doesn't explain why you can replace sounds in the main pk3 by placing them in the root folder of another pk3 that's loaded before it.
Perhaps SNDINFO polls whatever resource is closest and ./sounds/[soundname] is different from ./[soundname].

That's my best explanation, anyway.