[SOF1] Ed. Entities. How to add music to the map. Need HELP

Models + Mapping, Computer & SOF Problems.
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

[SOF1] Ed. Entities. How to add music to the map. Need HELP

Post by GStuff002 »

Hi,

There was a problem playing music on the map

I have installed sofplus-server-patch-20140531
I edited Entities, tooken from BSP (vr_killingyard.bsp) and transferred all data from Entities to .txt, .txt file named like the map name and copied to
C:\SOF PLATINUM\user-server\sofplus\spawn\fixed\dm

Original settings in txt. Here the music is played fine:

{
"message" ""
"chopsky" "255"
"chop" "255"
"musicset" "sud3"
"ainame" "kos3"
"sky" "bos2"
"classname" "worldspawn"
}
{

If I change the name of the music to my own "musicset" "vrkillingyard"
then I get the following error message:

Downloading sound/music/vrkillingyard.dms
File not found
Unable to lacate sound/music/vrkillingyard.dms
vrkillingyard isn't a valid music set name


My music is in Wav format. Why does the error indicate .dms format ?
Where should the music folder be located? Tried different locations and no one is correct (


------------------------------------------------------
I found the map (rdam_kingpin.bsp) with another call to the wav file. But where should I place this line. Provided if am doing everything right?


Original settings in txt. Here the music is played fine:

}
{
"targetname" "212"
"classname" "target_speaker"
"noise" "[R'dam]/cypress_x.wav" ------- I found this folder and this wav file
"origin" "-463 -473 140"
"spawnflags" "0"
"attenuation" "-1"
"volume" "1.0"
}
{


I edited the wav call, but that same doesn't work:

{
"message" ""
"chopsky" "255"
"chop" "255"
"noise" "vrkillingyard.wav" -----------here
"ainame" "kos3"
"sky" "bos2"
"classname" "worldspawn"
}
{

I did it anyway, put the file in their folder "noise" "[R'dam] /vrkillingyard.wav" - Did not help
Same way, i wrote under "classname" "worldspawn" - Did not help too

Help please
I just want to add ambient music to the map

I use SOF PLATINUM + sofplus-server-patch-20140531-cd.zip (CD-rom version)
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by Acadie »

The "worldspawn" has a proprietary construct, thus no one ever made a custom ambient using the "musicset". Even if someone manage to get this working, the game required a special algorithm for the sound file to be played correctly. The workaround we could possibly set is to use the same call seen with RDAM but on a loop using the func_timer entity.

Add this to the text file and edit the wait and nosie specific:

Code: Select all

{
"target" "amb"
"wait" "<SOUND LENGTH - X.XX>"
"spawnflags" "1"
"origin" "0 0 0"
"classname" "func_timer"
}
{
"targetname" "amb"
"volume" "1.0"
"attenuation" "-1"
"spawnflags" "4"
"noise" "<SOUNDFILE>.wav"
"origin" "0 0 0"
"classname" "target_speaker"
}
It's definitely not fancy and you'll notice some gap sometimes where you'll hear nothing but that's what it is, eh. Also, Make sure that your .wav file is 16 Bit MONO ADPCM
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

Doesn't support stereo? What value should be (Hz) ?

I have not tested it yet, but the situation is similar to RTCW, which could also play mono.wav if it call this wav through the console.
But after decompilation to .map and compilation back to BSP, the map was already loaded with stereo wav sound
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

"wait" "<SOUND LENGTH - X.XX>"
Can you show an example of what it should look like?
I need a value so that when the player spawn on the map, the music starts immediately

Sorry, but I need to see an example, otherwise I won't understand and won't guess
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

I probably understood a little, if I set the timer for the map for 10 minutes, then the value should be set to 10.0

It should look like this, right?
"wait" "<10.00>"
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by Acadie »

This is in the custom map TVD.bsp

The "wait" is set be waiting for about 5.55s second before the entity call the sound for another time. This is infinite by the way.

Code: Select all

{
"target" "bgmsnd"
"wait" "5.55"
"spawnflags" "1"
"origin" "4032 3992 456"
"classname" "func_timer"
}
{
"targetname" "bgmsnd"
"volume" "1.0"
"attenuation" "-1"
"spawnflags" "4"
"noise" "TVD/Ambient_D.wav"
"origin" "4032 4032 456"
"classname" "target_speaker"
}
Attachments
5.55.png
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

Where should I place this script? in what place

I did not understand how to make hidden text uploaded entities here:
https://usaupload.com/5iLa/vr_killingyard.txt" onclick="window.open(this.href);return false;
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by Acadie »

Can be anywhere as long they are enclosed in these { } bracket but I guess for convenience, add it to the end of the file then.
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

ok, I'll try, hope it will work, I've been puzzling over all day for this problem
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

Works! Where should the music folder be located?

For the whole day I copied the wav file into all possible folders wherever possible. Now I don't understand where the sound is coming from

If the location is just this:
"noise" "test.wav"

And
the problem is that the music loops. Plays about 5 seconds, not reaching the end of the musical melody
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

I figured out with the location, put the wwf folder into .PAK(with maps) / sound / wwf / test.wav

"noise" "wwf/test.wav"

It is necessary to come up with something with the music looping, as cannot listen to it to the end
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by Acadie »

GStuff002 wrote:For the whole day I copied the wav file into all possible folders wherever possible. Now I don't understand where the sound is coming from

If the location is just this:
"noise" "test.wav"
The search tree begins in the sound folder --> ..SOF PLATINUM/user-server/sound/test.wav

"noise" "[R'dam]/cypress_x.wav"
..SOF PLATINUM/user-server/sound/[R'dam]/cypress_x.wav

"noise" "TVD/Ambient_D.wav"
..SOF PLATINUM/user-server/sound/TVD/Ambient_D.wav
GStuff002 wrote:And
the problem is that the music loops. Plays about 5 seconds, not reaching the end of the musical melody
You gotta manually gauge the timing for the thing to sync at its best and it's impossible to make this perfect. It's a "workaround/alternative" solution, not an absolute solution. :shake:
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by Acadie »

GStuff002 wrote:put the wwf folder into .PAK(with maps) / sound / wwf / test.wav
.PAK file aren't mandatory. You are free put all the files directly into your directories.
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

For check. first of all I removed from here (..SOF PLATINUM / user-server / sound / test.wav) But the music played anyway. But it doesn't matter anymore, I put a different path for finding music in the script and now everything is fine

I put playback on 55 seconds, the music played 55 sec, but the music did not start play right at the beginning, I had to wait in silence for these 55 sec. before playing. - Is this right it should be?

Mono quality is terrible. I don't even know what kind of music I can add for the map. It's good that at least there is such a solution, but it is sad


....PAK file aren't mandatory. You are free put all the files directly into your directories.
Ok!
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by Acadie »

GStuff002 wrote:I put playback on 55 seconds, the music played 55 sec, but the music did not start play right at the beginning, I had to wait in silence for these 55 sec. before playing.  - Is this right it should be?
The music got called and played before you finished loading the map. That's normal. You may also encounter with other issue with the playback which is also normal.
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

What the program you use for decompile BSP to map for SOF1 ?

I will try too the old method but with your script. Maybe the game will ask for stereo sound. I just did the same with the RTCW game.

I can add your script directly to the BSP via QuArK and save, but then I get an error

Mod_LoadBrushModel: maps/DM/D-DayCTF.bsp has wrong version number (38 should be 46)

Does it exist a .BSP patcher for SOF1 ? for upgrade .bsp version to 46 protocol

I have a program called "ubsp" it changes the BSP protocol, but this is program for RTCW only, from some good programmer. The program just saved me a lot.

But in any case, it need to decompile and compile back. Since I noticed that , the Quark patches BSP and the game writes in the console that it cannot play mono and it needs stereo the same wav

But I don’t know if it will work for SOF1
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

Did I understand you correctly that no one has yet figured out how to pack WAV files into the encrypted SOF1 format?

Would that make it possible to use stereo? I think it need to ask the SofPlus development team to make the possibility of using stereo and maybe another way to calling music

SofPlus mod is similar to 1Fx mod for SOF2, and there are no such difficulties. It has a similar function of initially calling Entitties files from a different location to make editing easier. And the calling of the music is determined by the same parameter as in the original code
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by Acadie »

The important thing to note is that SOF1 was made using a modified Quake 2 engine. It is so the reason to why you are able to relate with many things amongst other game who share the same functionality. But with SOF1, it doesn't always obey the same.

So a quick answer with the .bsp is the file will be created in a irreversible way. The compiler it is structured in a such way that the .bsp will result some actual data lost compared with the source map.

The wrong version number error is not "really" related with a wrong version but rather because SOF has a check guard for the .bsp integrity.
GStuff002 wrote:Did I understand you correctly that no one has yet figured out how to pack WAV files into the encrypted SOF1 format?

Would that make it possible to use stereo? I think it need to ask the SofPlus development team to make the possibility of using stereo and maybe another way to calling music
In some way or another, surely possible. The background music in the game is played in a form of a stereo using two mono files. The game will then process with the splitting to their respective left and right channel.
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

In some way or another, surely possible. The background music in the game is played in a form of a stereo using two mono files. The game will then process with the splitting to their respective left and right channel.
Good idea!

Audacity couldn't do that. I split the WAV into two tracks L and R and saved two WAV's files, then I converted these two files to mono and nothing happened.

I also added two scripts for two WAV tracks that were loaded at the same time:

{
"target" "amb"
"wait" "5.55"
"spawnflags" "1"
"origin" "0 0 0"
"classname" "func_timer"
}
{
"targetname" "amb"
"volume" "1.0"
"attenuation" "-1"
"spawnflags" "4"
"noise" "wwf/testL.wav"
"origin" "0 0 0"
"classname" "target_speaker"
}
{
"target" "amb"
"wait" "5.55"
"spawnflags" "1"
"origin" "0 0 0"
"classname" "func_timer"
}
{
"targetname" "amb"
"volume" "1.0"
"attenuation" "-1"
"spawnflags" "4"
"noise" "wwf/testR.wav"
"origin" "0 0 0"
"classname" "target_speaker"
}

Perhaps here it need a professional program for splitting the sound into 2 parts, so that in one headphone plays one sound it other second, then from two mono files with simultaneous playback it is possible to get stereo.. i dont know...

Can you try it on your own? to understand this method is correct or not

The wrong version number error is not "really" related with a wrong version but rather because SOF has a check guard for the .bsp integrity.
I know I've read about it. But how can fix it?

So a quick answer with the .bsp is the file will be created in a irreversible way. The compiler it is structured in a such way that the .bsp will result some actual data lost compared with the source map.
I already figured it out this when I worked with RTCW, which is why I edited the BSP directly to avoid "data loss" and then patched the BSP to the desired protocol. The compilation was sometimes very good but in GtkRadiant

You forgot to tell me how I can decompile BSP to Map. (SoF1) At least just for checking and then I would write the result just for information

I just checked Quake 2 and heard that the multiplayer quake2 has stereo music. I wonder why the SOF1 developers cut it down
Reactions: 0
Posts: 55
Joined: 09 Nov 2021, 20:50

Re: [SOF1] Ed. Entities. How to add music to the map. Need H

Post by GStuff002 »

I would like to add to our yesterday's discussion one fact that we forgot to say. Perhaps this topic will help someone else in the future.

It is imperative to check and delete the "musicset" item in entities (SofPlus used) - this is the calling of standard encrypted music from the pak archives of SOF1. So it will two music play at the same time

...If add a script with a timer to call the sound
Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests