Animated objects with sound
4 posters
Page 1 of 1
Animated objects with sound
I guess a basic way to think of this is to trigger a sound when a variable state changes. Here is an example.
Right now, I am working with platform screen doors (PSD's). I have sounds for when they open and close. Currently, the sounds are set up to play as arrival and departure sounds. But if the doors are stuck when closing and they have to open and close again, I will not get the sounds. A solution, which I use on a different route, would be to blend the sounds with the door open and close sounds in the train folder. However, for this route, there are a few stations that do not have PSD's installed yet (to be accurate with reality). I am looking for a way to include a trigger in the .animated file.
Maybe it could look like this:
[sound] (a new section, perhaps?)
States = PSDclose.wav, PSDopen.wav
StateFunction = leftdoorstarget (or rightdoorstarget)
Would this be possible to implement in a future version of the sim?
Right now, I am working with platform screen doors (PSD's). I have sounds for when they open and close. Currently, the sounds are set up to play as arrival and departure sounds. But if the doors are stuck when closing and they have to open and close again, I will not get the sounds. A solution, which I use on a different route, would be to blend the sounds with the door open and close sounds in the train folder. However, for this route, there are a few stations that do not have PSD's installed yet (to be accurate with reality). I am looking for a way to include a trigger in the .animated file.
Maybe it could look like this:
[sound] (a new section, perhaps?)
States = PSDclose.wav, PSDopen.wav
StateFunction = leftdoorstarget (or rightdoorstarget)
Would this be possible to implement in a future version of the sim?
jpnmtrmn93- Posts : 24
Join date : 2017-05-26
Re: Animated objects with sound
https://bveworldwide.forumotion.com/t1314p25-animated-objects-following-the-track-now-with-sound
Need to update the main developer documentation, seem to have never added this there
Will try and do that tomorrow.
Edit:
Documentation updated.
Please let me know if this lets you do what you want (and that it works OK!)
Need to update the main developer documentation, seem to have never added this there
Will try and do that tomorrow.
Edit:
Documentation updated.
Please let me know if this lets you do what you want (and that it works OK!)
Re: Animated objects with sound
Hello, thanks for the quick response.
I saw the documentation update. Thanks for that. But I do not think that works. Here is the code I tried to use:
I get this a critical error saying "Unhandled error (Object reference not set to an instance of an object.) encountered while processing the file".
The goal is to have a sound play when the value of leftdoorstarget (or rightdoorstarget) changes from 0 to 1 or vice versa (0 = close, 1 = open, according to the train doors variable table in the documentation).
I saw the documentation update. Thanks for that. But I do not think that works. Here is the code I tried to use:
- Code:
[Sound]
FileName = doorsclosing.wav
Position = -2, 1.25, 12.5
Volume = 1
Pitch = 1
Radius = 25
VolumeFunction = leftdoorstarget
[Sound]
FileName = doorsopening.wav
Position = -2, 1.25, 12.5
Volume = 1
Pitch = 1
Radius = 25
VolumeFunction = Not[leftdoorstarget]
I get this a critical error saying "Unhandled error (Object reference not set to an instance of an object.) encountered while processing the file".
The goal is to have a sound play when the value of leftdoorstarget (or rightdoorstarget) changes from 0 to 1 or vice versa (0 = close, 1 = open, according to the train doors variable table in the documentation).
jpnmtrmn93- Posts : 24
Join date : 2017-05-26
Re: Animated objects with sound
Today's build should be better, and at the least not crash (and definitely places the sound appropriately)
Note that something is still a little odd, as it's not interpreting the volume function correctly. Need to dig into this a little further, but will get it sorted as soon as I can.
(I'm away, so testing is a little more difficult this week)
Note that something is still a little odd, as it's not interpreting the volume function correctly. Need to dig into this a little further, but will get it sorted as soon as I can.
(I'm away, so testing is a little more difficult this week)
Re: Animated objects with sound
Issue with the functions now fixed with today's build, apologies that it took a few days to sort out
Re: Animated objects with sound
This is a code I just tried with the build from 10/23 (which is still saying version 1.5, by the way):
Is this the wrong way to set this up?
- Code:
[object]
Position=2.155,0,0.001
States=tv_closeR.csv,tv_closingR.csv,tv_openingR.csv,tv_openR.csv
StateFunction=if[rightdoors==0,0,if[and[rightdoors>0,rightdoors<1],if[rightdoorstarget==0,1,2],3]]
TranslateYFunction = 1.5 * rightdoors
[stateChangeSound]
FileNames=null.wav,close.wav,open.wav,null.wav
Position=2,3.5,12.5
Volume=1
Pitch=1
Radius=50
PlayOnShow=1
Is this the wrong way to set this up?
jpnmtrmn93- Posts : 24
Join date : 2017-05-26
Re: Animated objects with sound
That seems to work OK here.
Are you placing it as a FreeObj or is it part of the train exterior?
(n.b. As you're using StateChangeSound, the sound will always play to completion. If you're using a long sound effect, this might be confusing things?)
Are you placing it as a FreeObj or is it part of the train exterior?
(n.b. As you're using StateChangeSound, the sound will always play to completion. If you're using a long sound effect, this might be confusing things?)
Re: Animated objects with sound
It is a free object, platform screen doors. The object does not load at all.
In Object Viewer, I get these errors:
Error Plugin Object.Animated.dll returned unsuccessfully at LoadObject
Error No plugin found that is capable of loading object
In Object Viewer, I get these errors:
Error Plugin Object.Animated.dll returned unsuccessfully at LoadObject
Error No plugin found that is capable of loading object
jpnmtrmn93- Posts : 24
Join date : 2017-05-26
Re: Animated objects with sound
Odd...
This almost sounds as if it's using the wrong (older) version of the plugins from somewhere unexpected.
Let me do some more testing tomorrow or Wednesday and I'll see if I can reproduce.
N.B.
The main sim is the only place this will definitely work 100%
Route Viewer *ought* to work, but Object Viewer doesn't support sounds. IIRC it should just display an error to that effect, but I'd need to double check what's going on there....
This almost sounds as if it's using the wrong (older) version of the plugins from somewhere unexpected.
Let me do some more testing tomorrow or Wednesday and I'll see if I can reproduce.
N.B.
The main sim is the only place this will definitely work 100%
Route Viewer *ought* to work, but Object Viewer doesn't support sounds. IIRC it should just display an error to that effect, but I'd need to double check what's going on there....
Re: Animated objects with sound
Some fixes made to Object Viewer today, and my test copy of your object now loads there too.
Still can't find anything wrong in the main sim.
If you're still having issues, I really need to know how you're using the object (track location might be interesting too).
Still can't find anything wrong in the main sim.
If you're still having issues, I really need to know how you're using the object (track location might be interesting too).
Re: Animated objects with sound
Can there also be support for .animated objects with sound on trains? It currently doesn't seem to work with them.
(See https://bveworldwide.forumotion.com/t1893-sound-section-in-animated-files-for-trains-not-working)
(See https://bveworldwide.forumotion.com/t1893-sound-section-in-animated-files-for-trains-not-working)
Re: Animated objects with sound
I would agree with Tony on that suggestion
NYCT_Railer- Posts : 9
Join date : 2020-04-25
Similar topics
» Animated Objects: Following The Track- Now with SOUND!
» Animated Camera Variable + Sound Suggestions
» .animated sound
» .animated sound (StateChangeSound)
» .animated sound limitations?
» Animated Camera Variable + Sound Suggestions
» .animated sound
» .animated sound (StateChangeSound)
» .animated sound limitations?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum