logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) working TriggeredAmbientSound needed (Read 289 times)
)Leela(-[otS]-
Full Member
***
Offline


Oldunreal member

Posts: 205
Location: Germany
Joined: May 31st, 2011
Gender: Female
working TriggeredAmbientSound needed
Jun 21st, 2019 at 12:15pm
Print Post  
Hi there Smiley

I'm looking for a way to get a working TriggeredAmbientSound.
I've never seen a working version from 225 to 227j_42.

I made a modified TriggerLight actor for it and it works so far, but the soundvolume is too low and I always need several actors for one sound.
Is there really no way to get this actor to work?

For example, it should be able to turn an alarmsound on and off when triggered.
  
Back to top
AIM  
IP Logged
 
Krull0r
Global Moderator
Betatester
Developer Team
*****
Offline


227 Emitter Expert

Posts: 431
Location: Germany
Joined: Jul 1st, 2007
Gender: Male
Re: working TriggeredAmbientSound needed
Reply #1 - Jun 21st, 2019 at 3:23pm
Print Post  
If you use a TriggerLight the sound volume depends on the Light brightness.


So make sure you set your TriggerLight brightness to 255 and the Lightradius to 0 to have no impact in the levels lighting.

If you use a triggerable ambientsound it wouldn't be louder then a triggerlight with LightBrightness 255.
  

Back to top
 
IP Logged
 
)Leela(-[otS]-
Full Member
***
Offline


Oldunreal member

Posts: 205
Location: Germany
Joined: May 31st, 2011
Gender: Female
Re: working TriggeredAmbientSound needed
Reply #2 - Jun 21st, 2019 at 6:04pm
Print Post  
Hi Smiley

yup, those are already the default values of my faked TriggeredAmbientSound  Wink
But I need two of them to get the same volume as I get when using one SpecialEvent for the same sound.

I really can't say how it would work with the TriggeredAmbientSound, because I never got a single sound out of it.
But if one SpecialEvent is nearly double as loud as one of my custom actor I wondered if there is a way to get a better working one.
  
Back to top
AIM  
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 1283
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: working TriggeredAmbientSound needed
Reply #3 - Jun 21st, 2019 at 8:06pm
Print Post  
)Leela(-[otS]- wrote on Jun 21st, 2019 at 12:15pm:
I made a modified TriggerLight actor for it and it works so far, but the soundvolume is too low and I always need several actors for one sound.
Is there really no way to get this actor to work?

That's hard to tell if you keep the source code of your amb sound class in secret.

)Leela(-[otS]- wrote on Jun 21st, 2019 at 12:15pm:
For example, it should be able to turn an alarmsound on and off when triggered.

You can try this code: https://pastebin.com/xKZWZw1A (written out of hand, untested, there may be errors).
  
Back to top
 
IP Logged
 
)Leela(-[otS]-
Full Member
***
Offline


Oldunreal member

Posts: 205
Location: Germany
Joined: May 31st, 2011
Gender: Female
Re: working TriggeredAmbientSound needed
Reply #4 - Jun 21st, 2019 at 9:16pm
Print Post  
Hello Smiley

there is no secret source code Cheesy

I simply made a subclass of TriggerLight and changed some default settings:

Code
Select All
KKTrAmbSnd

bAlwaysRelevant = True
bGameRelevant = True
bHidden = True
bMovable = True
bNoDelete = False

LightBrightness = 255
LightSaturation = 0

LightCone = 0
LightPeriod = 0
LightRadius = 0
VolumeBrightness = 0
 


that's all and it works.
Not sure about bGameRelevant and bHidden, but that shouldn't have an impact on SoundVolume anyway. The only other change is a custom icon for the editor.

But I still don't understand why the original TriggeredAmbientSound never and still doesn't work.
  
Back to top
AIM  
IP Logged
 
)Leela(-[otS]-
Full Member
***
Offline


Oldunreal member

Posts: 205
Location: Germany
Joined: May 31st, 2011
Gender: Female
Re: working TriggeredAmbientSound needed
Reply #5 - Jun 22nd, 2019 at 6:38am
Print Post  
Hello Smiley

I tested the code and the actor works nearly perfect. The SoundVolume is normal now and usually one actor should be enough.
If really a louder sound is needed you can use two or more of them, but they all have to be at the exact same position or they will go out of sync if the player moves a bit away from them and comes back.
To make them also work online bAlwaysRelevant must be set to True.

I was looking for about ten years now for a working TriggeredAmbientSound. Five years ago I made the TriggerLight actor because it was an emergency and I needed the actor very urgently. Back then I remembered the trick with the TriggerLight.

I had already lost the hope that I would ever see a real working TriggeredAmbientSound. But this one works like a charm.

Thank you very very much Masterkent  Smiley
  
Back to top
AIM  
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 1283
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: working TriggeredAmbientSound needed
Reply #6 - Jun 22nd, 2019 at 7:47am
Print Post  
)Leela(-[otS]- wrote on Jun 21st, 2019 at 9:16pm:
I simply made a subclass of TriggerLight and changed some default settings:

Hah, I didn't know that Light actors can control their ambient sounds based on lighting-related properties. Now I see that they allow something even more interesting than scaling by LightBrightness: https://lodev.org/unrealed/lighting/lighting.html#sound

)Leela(-[otS]- wrote on Jun 21st, 2019 at 9:16pm:
But I still don't understand why the original TriggeredAmbientSound never and still doesn't work.

It uses PlaySound to imitate ambient sound and it uses AmbSound instead of AmbientSound as the sound object. Besides, it needs a positive rePlayTime. The sound can't be stopped immediately once it's "turned off". And if it's looped, then "turning off" will have an effect only after you leave the audible radius. Probably, this class was written for a very specific usage...

)Leela(-[otS]- wrote on Jun 22nd, 2019 at 6:38am:
I tested the code and the actor works nearly perfect. The SoundVolume is normal now and usually one actor should be enough.

Does it really differ from TriggerLight's? Make sure you're using the same SoundRadius when comparing.

)Leela(-[otS]- wrote on Jun 21st, 2019 at 9:16pm:
To make them also work online bAlwaysRelevant must be set to True.

That's weird, an actor with ambient sound should always be net-relevant within the audible radius (without enabling bAlwaysRelevant).
  
Back to top
 
IP Logged
 
.:..:
Oldunreal MasterPoster
Developer Team
*
Offline



Posts: 1460
Location: Finland
Joined: Aug 16th, 2005
Gender: Male
Re: working TriggeredAmbientSound needed
Reply #7 - Jun 22nd, 2019 at 8:43am
Print Post  
Masterkent wrote on Jun 22nd, 2019 at 7:47am:
)Leela(-[otS]- wrote on Jun 21st, 2019 at 9:16pm:
To make them also work online bAlwaysRelevant must be set to True.

That's weird, an actor with ambient sound should always be net-relevant within the audible radius (without enabling bAlwaysRelevant).

It will stop networking once there is no ambient sound, thus if a client is out of hearing range when it stops the sound, they will never receive the information of no sound.
  

Shivaxi wrote on Jul 25th, 2013 at 12:50pm:
...and now im stuck trying to fix everything you broke for the next 227 release xD Tongue

(ಠ_ಠ)
Back to top
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 1283
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: working TriggeredAmbientSound needed
Reply #8 - Jun 22nd, 2019 at 10:09am
Print Post  
.:..: wrote on Jun 22nd, 2019 at 8:43am:
Masterkent wrote on Jun 22nd, 2019 at 7:47am:
)Leela(-[otS]- wrote on Jun 21st, 2019 at 9:16pm:
To make them also work online bAlwaysRelevant must be set to True.

That's weird, an actor with ambient sound should always be net-relevant within the audible radius (without enabling bAlwaysRelevant).

It will stop networking once there is no ambient sound, thus if a client is out of hearing range when it stops the sound, they will never receive the information of no sound.

Maybe I shouldn't have defined default.bNoDelete then. On the other hand, respawning an actor each time it becomes net-relevant has some drawbacks too, so I'm not sure which combination would be better:

Code
Select All
bAlwaysRelevant=True
bNoDelete=True 


or

Code
Select All
bAlwaysRelevant=False
bNoDelete=False 

  
Back to top
 
IP Logged
 
)Leela(-[otS]-
Full Member
***
Offline


Oldunreal member

Posts: 205
Location: Germany
Joined: May 31st, 2011
Gender: Female
Re: working TriggeredAmbientSound needed
Reply #9 - Jun 22nd, 2019 at 11:22am
Print Post  
Hello Smiley

in the past, when the server still was 225 we had a problem with DistanceLightning actors in skyboxes and also TriggerLights.
The skyboxes had an eyes killing flicker for Clients. TriggerLights, which should be off at mapstart were on when seen from far away, or better when a player still wasn't in the lightradius of those actors.

I digged a bit around to find the cause and a solution for these problems. The reason was the replication. It was not updated before a player reached the lightradius. In case of the skyboxes and DistanceLightning this was impossible.
I then changed bAlwaysRelevant to True for both actors with AutoRunCommands and that worked. The fast flashing on skies were gone and TriggerLights which should be off at mapstart were off.

When I tested the TriggeredAmbSound actor on a server this morning the sound was already on when I entered the map. I still wasn't in the "real" soundradius, but I could hear it right at start. So I set bAlwaysRelevant True on it and tested it again and it worked like it should.
  
Back to top
AIM  
IP Logged
 
medor
Senior Member
****
Offline


Oldunreal member

Posts: 283
Joined: May 17th, 2009
Re: working TriggeredAmbientSound needed
Reply #10 - Jun 25th, 2019 at 11:26am
Print Post  
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo