I tried to edit it before, but the game started crashing on me.
Any pointers?
Well, it's really pretty simple.
module_sounds is just a list of sound references (many, but not all, are hard-coded), some tuples that refer to how the sound is played (volume,priority,looping) and a list of sound files that are randomly played.
So, this plays exactly one sound file when the (hard-coded) event for metal hitting a wooden shield occurs:
插入代码块:
("shield_hit_metal_wood",sf_priority_7|sf_vol_10, ["sound01.ogg"]),
If you want more than one sound, you just add the file names in the proper block, like so:
插入代码块:
("shield_hit_metal_wood",sf_priority_7|sf_vol_10, ["sound01.ogg","sound02.ogg"]),
And so forth.
So basically, you just need to use the module_sounds.py that's included with this and copy-pasta the stuff you want into your own. You can't make the game crash doing this unless:
1. You do something that can break any Module System code, like use bad syntax (forget apostrophes, brackets, commas, etc.) or a nonexistent tuple reference.
2. You try using more than 32 sounds for an event.
That's pretty much all there is to it, codewise. I pretty much just copied most of Checkmaty's code and did some editing to get a few things below 32, and was done in 20 minutes.