A simple script is confusing sounds

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Post Reply
Guest

A simple script is confusing sounds

Post by Guest »

Hi, I have an unusual problem. I am having trouble with sounds in a simple script that should play them.

Here's the video (everything is WIP, so don't mind the look): https://www.youtube.com/watch?v=fots2BoWNI8

Here's the explanation:

1. I have 5 music files - L2MUSx, where x is the number of the music piece from 1 to 5
2. They are defined properly in SNDINFO - as you see in the video
3. They are tied to a very simple script that plays them

script "MusA" (void)
{
PlaySound(0,"L2MUS1");
Floor_LowerToLowest(93,80);
if(mus==1){
mus+=1;
}
}

There are separate scripts (activated by different switches) for each music file.

But the game completely messes up the order of the files. Where it's supposed to play MUS1, it plays MUS2. Where it's MUS3, it plays MUS4. I checked it on 3 different computers, it's the same error everywhere.

But here's the thing: a fellow modder copy-pasted the files and the script, including SNDINFO, to his very different mod. And it works. So the files aren't corrupted, and the script checks out.

We tried a couple of things to remedy my case:
- rename the sounds
- reupload the files
- redo the script from the scratch
- move the files from the sound subfolder to the main folder
- move the files and SNDINFO to a separate wad within the pk3
- revert to gzdoom 4.5 from 4.7.1

Nothing works! And I think this is just a start of sound-related problems, because I had a file that for some reason wouldn't play at all, only if put in a sound sequence. I just left it in a sound sequence without thinking too much about it, but that should've been a red flag.

I'm afraid something really bad has happened to my mod. Please help. I will gladly share my pk3 with you if necessary.
szuran
Posts: 1
Joined: Mon May 02, 2022 10:14 am

Re: A simple script is confusing sounds

Post by szuran »

Hi, I am the author of this post, I didn't notice I wasn't logged in.

I found the solution. It was caused by a typo in a definition ABOVE the definition of the problematic sound. It made all the sound below it get confused in-game.
Post Reply

Return to “Assets (and other stuff)”