Animated Objects: Following The Track- Now with SOUND!

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

Animated Objects: Following The Track- Now with SOUND!

Post by jckhinks on Fri Dec 01, 2017 4:19 pm

hi. the trackfollowfunction is not recognised on my computer. windows 7 and openbve version 1.5.2.3 any ideas please.jack
avatar
jckhinks

Posts : 79
Join date : 2012-08-22
Age : 67
Location : maltby

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by leezer3 on Sat Dec 02, 2017 12:57 pm

OK, this should now be operational in today's build Smile

Needed to do some deeper work to get things working properly, but there we go.

The previously posted syntax is not valid, as I've implemented a [Sound] section for animated files. (Should have done this previously....)
This should be as follows:
Code:
[Sound]
filename = steamer.wav
volume = 1.0
pitch = 1.0
position = 0,1,0

Supported attributes for this section:

  • FileName: Sets the filename for the sound file.
  • Volume: Sets the initial volume. (Note that this is at the sound source, not the listener position)
  • Pitch: Sets the initial pitch.
  • Position: A 3D vector describing the initial position of the sound relative to the animated object's track position.
  • TrackFollowerFunction: Function moving the sound along Rail0's path.
  • VolumeFunction: Function altering the volume (Overrides Volume)
  • PitchFunction: Function altering the pitch (Overrides pitch)


jckhinks wrote:hi. the trackfollowfunction is not recognised on my computer. windows 7 and openbve version 1.5.2.3 any ideas please.jack

Are you sure you're using trackfolllowerfunction , not trackfollowfunction?
This is also only implemented in the main sim, not Object Viewer or Route Viewer.

Phonteus Nevolius wrote:It's not that important, at the moment I'm happy with a simple looped sound.

Quork: yeah, now that you mention it! Smile But actually it's a mouse from the Hungarian animated film, Cat City, its name is Grabowski.

Adblock is a wonderful thing, never even seen it Razz

leezer3

Posts : 1014
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by Greater Anglia Metro on Sun Dec 03, 2017 10:09 pm

Sorry if this has already been answered, I've not been about...
Is it yet possible or planned to have a sound linked to an animation such as an air operated signal changing?
avatar
Greater Anglia Metro

Posts : 120
Join date : 2012-03-24
Age : 24
Location : London

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by leezer3 on Sun Dec 03, 2017 10:18 pm

Ah, I knew there was something I forgot with these Razz

(TLDR: I was asked for this a while back, and promptly forgot about it after thinking up the list of flaws.....)

Need to think a little about the best way to implement that one, but I'll try and sort something basic out next week sometime.
On the most basic level, it's easy enough to hook that in, but getting something that has no kinks is another kettle of fish entirely.

Edit:
I now have a working prototype.

Queries please:

  • Is editing the radius / volume essential, desirable or unimportant?
  • Should the sound play including when the object is hidden/ unhidden, or should this be configurable?
  • Would a list of sounds for each state be an absolute must or just desirable? (Might be a PITA, but do-able....)

leezer3

Posts : 1014
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by Greater Anglia Metro on Sun Dec 03, 2017 11:46 pm

- Radius would be needed I think, volume not so important to me as I'd rather edit the sound file directly.
- I think it's best to configure this.
- personally I only need the sound to play as the state changes (when the shunt signal rotates) - I suppose this is as the object is changing state? What others need could be different
avatar
Greater Anglia Metro

Posts : 120
Join date : 2012-03-24
Age : 24
Location : London

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by leezer3 on Wed Dec 06, 2017 4:19 pm

OK, I think we've got somewhere Smile

I've implemented this draft animated format, which attaches to the preceeding [Object] section in an animated file:
Code:
[StateChangeSound]
Filename = crossing.flac
Pitch = 1.0
Volume = 1.0
PlayOnShow = true
PlayOnHide = true
Radius = 30.0

Available options:

  • FileName : The relative path to the sound or FileNames : A comma separated list of sound files for each state (Starts with -1 ==> hidden)
  • Pitch : Set the pitch
  • Volume : Set the volume
  • PlayOnShow : Controls whether a sound is played when this object is shown.
  • PlayOnHide : Controls whether a sound is played when this object is hidden.
  • Radius : Controls the radius in meters at which the sound is played at full volume.


NOTES:
If not using a sound & the FileNames format, this must be left blank, e.g.
Code:
FileNames = ,shown.wav, state1.wav etc.

If the FileNames list of sounds is less than the number of states, no sound will be played.


Need to do some more testing of my own before letting this loose in the general builds, but feedback appreciated Smile
https://github.com/leezer3/OpenBVE/pull/207

leezer3

Posts : 1014
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by leezer3 on Thu Dec 07, 2017 2:17 pm

Now in the daily builds Smile

Feedback appreciated please!
(Note that this makes a lot of changes to the internal plumbing for animated objects. I don't believe that anything is broken, but I stand to be corrected....)

leezer3

Posts : 1014
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by Marc Riera on Fri Dec 08, 2017 4:48 pm

I'm not entirely sure if it's a side effect of the latest change to animated objects, but many of them have stopped working. The animated cars (texture shift) in Chashinai Railway aren't shown, and 3D cabs (I've tested the Class 323) become glitchy when pressing F1 to switch views.

Signals fail too (they always appear turned off), so maybe it's a mix of these latest changes to animated objects and other commits that may have messed up the code.

Marc Riera

Posts : 21
Join date : 2015-12-21
Age : 22
Location : Barcelona, Spain

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by leezer3 on Fri Dec 08, 2017 10:25 pm

Hmm.

Will do some digging Sad

I haven't seen anything immediately broken, and I've been testing primarily with D1015, which is a full 3D cab.

Signals have definitely been working here too, as ironically I was using a hacked signal to test the state change sounds ;p

Probably something simple, as there were a *lot* of plumbing changes internally.

Edit:
The 3D cab issues smell related to the change to allow multiple interior views via XML I suspect, rather than the sound stuff.

Will try and chase tomorrow or Sunday evening Smile

leezer3

Posts : 1014
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by leezer3 on Sat Dec 09, 2017 11:21 am

Oops....

One small typo in a variable name, and rather a lot stops working Razz

(TLDR: This actually only affected the second onwards placement of an animated object (These aren't necessarily consecutive either), and was caused by the clone function, well not cloning it correctly....)

3D cab issue should also be fixed now.
https://vps.bvecornwall.co.uk/OpenBVE/Builds/OpenBVE-2017-12-09.zip

leezer3

Posts : 1014
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by Marc Riera on Sat Dec 09, 2017 1:40 pm

Everything works again as expected, thank you!

Marc Riera

Posts : 21
Join date : 2015-12-21
Age : 22
Location : Barcelona, Spain

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by leezer3 on Sun Dec 10, 2017 10:11 pm

Today's build fixes an issue with these in Object Viewer and Route Viewer, plus adds an info message that these are *only* supported in the main program Smile

leezer3

Posts : 1014
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Re: Animated Objects: Following The Track- Now with SOUND!

Post by Sponsored content


Sponsored content


Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum