OpenBVE
OpenBVE copied to clipboard
[Request][Train plugin]Control position of sounds played via the plugin
Description
I can write a plugin, which can handle, which sound should be played on which car. But the sounds are played at the front of the selected car, and it cannot be parameterized, where the sound source is in the car. I would be happy if it could be parameterized either in the sound.cfg file or from the plugin via OpenBveApi.Runtime.PlayCarSoundDelegate
. Not only the speed, volume, continuity (looped or not) and the car of the sound, but also the exact position inside the car.
It is possible, to set the position of the sound in .animated files, but I didn't find any way to do this from the plugin.
I didn't find this feature, but if it exists, please let me know!
Thanks!
Convert the train to XML format, and it'll allow this, by editing the position tag for each CarSound entry.
I'm deliberately now trying to avoid any major extensions to the legacy formats, as this just creates a bigger mess.
If you want to use each car sound immediately, you can use FMS.
https://sites.google.com/view/d-redtrain/bvedata/ats/fmsplugin?authuser=0
FMS, Five Motor Sound can use unlimited sound the same as Bve5. If you write to CarList section that is what numbers of the motorcars, each motor cars sounds as your request.
Please read my manual how to use. https://bveworldwide.forumotion.com/t2171-now-the-openbve-s-motor-and-brake-sound-tracks-are-become-unlimited#20880
Convert the train to XML format, and it'll allow this, by editing the position tag for each CarSound entry.
Is there any documentation from this? The https://openbve-project.net/documentation_hugo/en/trains/train_xml.html site is not enough to this problem.
@ginga81 I don't want to use any external dll files, programs or code. More and more licenses and restrictions would be needed, and I donβt want that at all. That's why I just want to know and use the features of OpenBVE.
Sorry, documentation updates have never been a strong point :/
If you give the main site a little while to update, the XML train sound format should now be there. (n.b. Still a WIP, and there may possibly be one or two bits I've missed)
Possibly the easiest way to demonstrate is probably to run an existing train through CarXMLConvertor.
@leezer3 I see, that the documentation isn't the strongest point of this project :D I hate writing documentation too, but I know, if someone else wants to use my app/code, they need it. And I need it too, when I extending my code 2 years later :D
-
So I need some more information about xml style trains. What files are needed in the train folder?
-
The OpenBVE 1.8.2.3 does not detect the train folder as a train, if there is no train.dat file inside. There is train.xml, and by the logs, at loading it uses the xml file, but why cannot delete the old and not relevant train.dat file?
-
SOLVED! (Another problem, there is a lot of errors, because I don't use some sounds, and the CarXmlConvertor app creates there an empty list of sounds. And yeah, this causes a lot of errors in log π
20:04:31 An empty list of compressor sounds was defined in in XML file D:\UserDocuments\OpenBVE\Addons\Train\HEV\_HEV_PACK_2\new_train\sound.xml
(I have self written compressor in the plugin, so this built-in compressor does not have any sounds) In the Sound.xml file is:<Compressor></Compressor>
) I moved the not used sections into a comment block, and the errors disappears β π -
Third problem: the ObjectViewer does not support the train.xml file. π
-
How can the coupler have an object? After the conversion it hasn't.
<Coupler> <Minimum>-0.01</Minimum><Maximum>0.01</Maximum></Coupler>
-
Can I mixing the separated car xml files with separated couplers?
At the minute, we load the train.dat first, then the XML file, primarily because the implementation of this format has been a somewhat gradual affair. The convertor may not sort motor sounds either, would need to check that....
Object Viewer should support the XML, I think if you drop in the train.dat. Ought to support the XML too, again will need to check that.
Coupler objects:
Add an <Object>
node to the coupler definition.
Updated the documentation some more, give it a little while :)
Mixing seperate car files and couplers is fine, they just need to go in order, e.g.
<?xml version="1.0" encoding="utf-8"?>
<openBVE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Train>
<Car>Car0.xml</Car>
<Coupler>
<Minimum>0</Minimum>
<Maximum>1</Maximum>
<Object>coupler.b3d</Object>
<Coupler>
<Car>Car1.xml</Car>
<Coupler>
<Minimum>1</Minimum>
<Maximum>1</Maximum>
<Object>coupler1.b3d</Object>
<Coupler>
<Car>Car2.xml</Car>
<Car>Car3.xml</Car>
<Car>Car4.xml</Car>
<Car>Car5.xml</Car>
<Car>Car6.xml</Car>
<Car>Car7.xml</Car>
<Car>Car8.xml</Car>
</Train>
</openBVE>
Will try and look at the convertor later / tomorrow.
@leezer3 Thanks the works! I have another question: do you plan to convert the ats.cfg and train.txt files into an xml file? Maybe to a node in the train.xml? Or this is available, but not yet documented?
Nothing (yet...)
Latest build will accept the following (and converted via CarXMLConvertor):
...
<Plugin>BVEC_ATS.dll</Plugin>
<Description>British Railways Class 52 'Western' - D1015
-------------------------------------------
This locomotive runs on the latest version of the BVEC_ATS
train systems plugin, and represents what I feel to be a
very reasonable portrayal of the prototype!
Feature Include:
* Single and twin engine operation.
* Prototypical startup sequence.
* Working turbocharger.
* Working AWS.
* Full external view.
As with all of my recent products, this locomotive has been
designed to work on any platform that OpenBVE supports.
This release has been configured with a full set of 8 MK1
coaches on the drawhook (280 tons!)
Driver's Guide
--------------
http://www.bvecornwall.co.uk/wordpress/br-class-52-western-drivers-guide/</Description>
...
@leezer3 Should these two new parts be between the
Correct, within the train tags.