Jump to content

Hi There

Welcome to Klub Exile. If you happened to make your way to the site either from Lovers Lab or a Search on Google, we are glad you found us.  To unlock the entire site you will need to have a account registered.  Don't worry it is free but in the mean time you can read up on why we made the site and other little tidbits.  Feel free to join or Discord Server also if you have any more questions.  Thanks for stopping by and See You on the other side.

admin admin
 Share

16 Comments


Recommended Comments

How to use Ambiant sound in your room.

I did some experiments with getting the ambiant sound to work on a room. I found a way to do it but it will only play the file till it ends.

Actualy i found how to play 2 sounds. First 1 will be the Music controlled by the music slider in your settings. The second will be the ambiant controlled by the ambiant slider in your settings.

First thing to do is add some folders to your addons\room folder that will hold the sound file.

They will look like this:

image.png

The Sound folder is the one to add.

Inside the Sounds folder we make 2 new folders.

image.png

Luder will be for the ambiant sound.

Shared will be for the Music sound.

Inside the Luder folder make a folder:

image.png

Do the same for the Shared folder.

You no should have the following paths:

Sounds\Luder\Music

Sounds\Shared\Music

Inside the Luder\Music\ you need to make the file: Ambiant.ogg

Inside the Shared\Music\ you need to make the file: Background.ogg

 

now lets add the script code:

Go to scripts\Luder\common folder im working on room 134 so for me it looks like this:

image.png

im gonna open KlubExileRoom134.bs with notepad ++

image.png

Add the red text and save the file.

2 more to do.

Go back to scripts\Luder and go to the room folder. in there you will find the following files.

image.png

Open AcRoom.bs with notepad ++

image.png

Add the red part and save the file.

Now the last one AVRoom.bs

image.png

Open AvRoom.bs with notepath ++

Add the red part to your file and save.

This will start the files to play on room loading.

 

 

Here is how i think it works.

The Sound folder is the place that stores the files split by Music and Ambiant. or Shares and Luder.

In the room description file we open the soundfile and add the ambiant file and mix them.

In the ACRoom.bs we import the soundfile for the Ambiant sound to add it and it can be executed by the room description file.

In the AVRoom.bs we give it the start to play the ambiant file. The Music file will play because we open it in the room description file.

    .BackgroundSounds [ :BGsound01, RoomSound :Ambient . {    = call on backgroundsound and play background sound and ambiant sound.  if you set this the background sound will be overriden by the Ambiant.  .BackgroundSounds [ :BGsound01, RoomSound :BGsound01 . {  This is because we have set the roomsound(ambiant) to be the same as backgroundsound(Music) 
        .NodeName "Sound_Ambient";
        .VolumeDB F32(-20);
        .Loop True;                                     = loop does not work
    };

  • Love It 2
  • Thumbs Up 1
Link to comment

Here is a bit deeper.

room description file

image.png

AcRoom.bs

image.png

Should be import this sound from the root addon directory for the parentpath.

AvRoom.bs

image.png

  • Love It 1
  • Thanks 1
  • Thumbs Up 1
Link to comment

Dont copy this code. I made a big freaking mesh by not naming thing correct. 🙂 i wrote ambiant wrong in several places. if you fix that it will work.

I will make a working testversion and upload it here tomorrow.

 

  • Thumbs Up 1
Link to comment

@x17 you should be able to import your toys code by using appimport in AcRoom.bs and place it somewhere in a room if it plays its sound local. Just start the sound in the AvRoom.bs. You can do multiple sound starts by repeating the code.

  • Thumbs Up 1
Link to comment

Cleaned up the code and loop now also works.

Made 2 soundimports and set two avplays. also cleaned up the roomdescription code. all is working.

As i made these in a room thats not finished yet i will make a working room tomorrow for someone special who's files i used for testing. seems the fair thing to do.

Link to comment

Is it possible to reactivate the music ingame? Like with a hook script or something? 

Link to comment
  • Administrator

Its been a while since I fiddled with this. Last thing I remember was that this game is really anal about how you input the code. Where in my case, you literally had to be to precise with how you input the length of the music/sound file.

  • Like 1
Link to comment
9 hours ago, Morius said:

Is it possible to reactivate the music ingame? Like with a hook script or something? 

You can make your own music files. but it can also play the ingame sound.

1 hour ago, Smoke said:

Its been a while since I fiddled with this. Last thing I remember was that this game is really anal about how you input the code. Where in my case, you literally had to be to precise with how you input the length of the music/sound file.

Got two half hour clips running at the same time. seems to work fine.

Also tested with one large and one small clip to test loop settings. Everything seems to work like it should.

  • Like 1
Link to comment
8 minutes ago, Sexvision said:

You can make your own music files. but it can also play the ingame sound.

Got two half hour clips running at the same time. seems to work fine.

Also tested with one large and one small clip to test loop settings. Everything seems to work like it should.

Yeah, nah. My comment was kind of a suggestion as an alternative of looping. Instead of looping, it's not possible to replay the room sound with some kind of script? But if I understood correctly you managed to get the loop working, that's it? 

Link to comment
55 minutes ago, Morius said:

Yeah, nah. My comment was kind of a suggestion as an alternative of looping. Instead of looping, it's not possible to replay the room sound with some kind of script? But if I understood correctly you managed to get the loop working, that's it? 

Yep loop works perfect 🙂

  • Love It 1
Link to comment

Hey! I'm excited you are testing this out! I have some ideas to do this with Blade Runner sounds and music!

I remember a way to change the sound file to ogg format and then you specify the exact number of seconds in the script and it will play.

I don't know if that's what you're already doing @Sexvision or if you are taking another route?

 

I have done it and gotten good results, but it creates a large file size for the ogg file, so I've been looking for an alternate way and never got back to it.

Link to comment

This is interesting!

Do you know that in early VX version, when MG was still kicking. there was a lua script capable of cycling images on a loading screen with a button press, I think it was later extended to switch images on some ingame tvs or smth. But here's the thing - script was meant to replace a specific file with another specific file on a button press, so like one image got replaced by another image for the object that is being referred by a script.  And it wasnt limited to two, but in fact to as many as you add.
So, logically, it should be able to replace one sound file with another sound file, or several, at this case for ambience, that would hopefully make the game play the next in line, replaced file.
Switching ambience from noisy day, to a silent night (along with level def), as a very simple example, would be interesting. 

I should still have this sample script somewhere on my pc - the image version, if you would like to take a look and maybe adapt.

  • Like 1
Link to comment
55 minutes ago, Kraegar said:

This is interesting!

Do you know that in early VX version, when MG was still kicking. there was a lua script capable of cycling images on a loading screen with a button press, I think it was later extended to switch images on some ingame tvs or smth. But here's the thing - script was meant to replace a specific file with another specific file on a button press, so like one image got replaced by another image for the object that is being referred by a script.  And it wasnt limited to two, but in fact to as many as you add.
So, logically, it should be able to replace one sound file with another sound file, or several, at this case for ambience, that would hopefully make the game play the next in line, replaced file.
Switching ambience from noisy day, to a silent night (along with level def), as a very simple example, would be interesting. 

I should still have this sample script somewhere on my pc - the image version, if you would like to take a look and maybe adapt.

That would be intresting to look at. thanks Kreagar.

Link to comment

So as always with this gamecode. If you think you figured something out it will bite you in the ass.

That is what happened today.

I got one room working with 2 sounds.

But on making the second room thinking it will read the files out of the addons\Sounds folder, it does not. The code will pick the first sound it comes across with that specific name in the addons folder. 

For Ambient its a easy fix. just rename the file to something else like Ambient02 and its working propperly.

For Music however i need to use that specific filename to get it to work. So this will also load the first file it will find with the same name. This turns out to be a problem as the filenames need to be the same to work.

I think its because of the .ParentPath "Nil"; option but dont realy know how to name it to get to the sounds folder in the addon. If anybody has any idear for this please share it so i can fix it.

I have tried the .ParentPath "/Sounds" but that does not work.

Its not a complete fail as i still can use ambient sound right now but its far from perfect 🙂

 

Link to comment

First of i want to thank   @Number251137   for sharing the VC Bridge and its sounds. The sounds he shared made me want to do this project.

This testfile will have the sounds coded and positions set for this beautiful room. There should be two sounds you can here and control. First is the truck sound on the Music channel. The second is the traffic ambient sound that should be on the ambient slider in your ingame settings.

 

For the install of this room you need to combine some files. This because i dont want to share Number251137 room.

In the download for the testroom you will find the following files:

Addons 

Mod\ActiveMod\[Room]_VC Bridge\

You will need the files from the original room in this install. 

You will need these files from the original room:

from the folder [RM_134] - VC Bridge you want to place all in the [Room]_VC Bridge folder. You can delete AvarteasRoom134 files. there not needed anymore.

you want to install _hook5data from the original Room and the ![Obj] - (H5) ProjectObject folder. if you have the original installed just need to copy the activemod room files to the new folder [Room]_VC Bridge.

You will find the room here

You dont need to do this to test. I just wanted to make the file usefull.

The testfile for this room is here:

https://mega.nz/file/Mv4TFADR#-Xf3tvYo6CxHI19Mp07l_cBsmcR6WqRKX96wYD5JZ7s

It will work as its now but in a empty room.

 

This is a testfile so expect some issues.

If you download this file i would love some feedback on how its working for you.

Test the gamesettings music level and ambient level. you should here a difference. Please report if it worked for you.

 

I have tried to make this file so there will be no need for coding but i failed in that. The code will play the first file it will find in the Addons folder with the correct name.

If this test works i will explane how to easy set your own files but that will be after testing.

 

Link to comment
×
×
  • Create New...

Important Information

WARNING! Adult Only Content You must be 18 years of age or older to enter. By accepting you agree to Klub Exile's Terms of Use and Guidelines upon creating an account.