Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello Pete,

Is it possible to assign sounds via Fsuipc like a flap sound that reacts on the wind ?

Eg : flaps 1 - flap wind sound dim . Flaps 30 - flap wind sound loud

Of course only hearable when moving.The same for gear , spoilers and brakes.

Prosim Audio Addons can only play a sound according to a trigger and cannot be connected to speed.

FSPS Dolby Cockpit Sounds which does al the above works fine till P3Dv3 . In V4 it stops working after 5-15 minutes. 

Thanks ,

Gerard

Posted
17 minutes ago, GSalden said:

Is it possible to assign sounds via Fsuipc like a flap sound that reacts on the wind ?

Eg : flaps 1 - flap wind sound dim . Flaps 30 - flap wind sound loud

Of course only hearable when moving.The same for gear , spoilers and brakes.

Yes, you can do all that with a Lua plug-in. You can read and check things like speed and flap settings and play already existing sounds (WAV files) via Sound library functions. Please take a look at the Lua library document in your FSUIPC Documents folder (in the Modules folder).

Alternatively, if ProSimAudio can do the job given the right triggers, then you could using a Lua plug in to read the speed value, and set flags in user offsets (any of 66C0-66FF) which are then assigned as triggers in ProSim.

Pete

 

Posted

Thanks Pete.

I will give it a try. As Prosim Audio Addons only can play a wav file without in-decreasing the sound it must be Lua only. Otherwise the sound stays at the same volume.

And I want the sound to in-decrease with speed differences.

regards, Gerard

Posted
14 minutes ago, GSalden said:

And I want the sound to in-decrease with speed differences.

Well, that is sometimes easier to accomplish with several wave files, edited to have the levels needed, but the Lua sound facilities do have a volume capability (also a directional one, for a quad sound system), which always worked with FSX and P3D3.  Not sure yet about P3D4 as I've not tried all the options yet.

Pete

 

Posted

I made an overview in general on papaer with what I want and it looks quiet complicated.

Then I got another idea : what I want is all in FSPS Dolby Cockpit Sound , but that program stops responding after 5-15 min in P3Dv4.   If I can assign a yoke button to a batchfile ( I know my way around DOS ) that first shuts the program down and then restarts it I will have what I want much easier.

I started with my first LUA :

 

ext.path ("C:\\Program Files (x86)\\FSPS\\Dolby Cockpit Sounds FSX")

ext.run ("restart.bat")

end

 

Regards,

Gerard

Posted
3 hours ago, GSalden said:

If I can assign a yoke button to a batchfile

You can't do that directly, only via Lua. You can assign buttons to any Lua file placed ito the Modules folder.

Pete

 

Posted
1 hour ago, Pete Dowson said:

You can't do that directly, only via Lua. You can assign buttons to any Lua file placed ito the Modules folder.

Pete

 

Therefore these lines in a LUA script :

ext.path ("C:\\Program Files (x86)\\FSPS\\Dolby Cockpit Sounds FSX")

ext.run ("restart.bat")

end 

In Fsuipc I will assign the Yoke button to the LUA script with the text above.

The idea is that the LUA script excecutes the batch file .

 

 

 

Posted
32 minutes ago, GSalden said:

ext.path ("C:\\Program Files (x86)\\FSPS\\Dolby Cockpit Sounds FSX")

ext.run ("restart.bat")

I was puzzled when I first saw this, so I checked. There is no "path" function in the ext library. Not sure how you invented that.

The ext.run function simple takes a complete pathname, so the path itself is part of that.

The other thing is that you can't use ext.run for a batch file. It creates a process with the program name given. So, to execute a batch file you'd need to ext.run the command line program, command.exe, and give the BAT file name as a parameter after the /c.

Instead of ext.run you should use ext.shell, which "shells" the command you give out to the Windows shell mechanism, which can execute most things. This won't give you a handle on the process you are restarting, of course. You'd need to "run" the Dolby Cockpit Sounds program directly for that, after presumably closing or killing it.

Pete

 

 

Posted

You are right that didn't work.

I also tried :      ext.runif("C:\Program Files9 x86)\FSPS\Dolby Cockpit Sounds FSX\StartDCS.bat", "EXT_MIN")   whicg didn't work either.

********* LUA: "StartDCS" Log [from FSUIPC version 5.103e] *********
   684766 System time = 21/09/2017 14:55:17, Simulator time = 09:21:59 (07:21Z)
   684766 *** LUA Error: cannot open D:\Program Files\Lockheed Martin\Prepar3D v4\Modules\ipcDebug.lua: No such file or directory
   684766 LUA: beginning "D:\Program Files\Lockheed Martin\Prepar3D v4\Modules\StartDCS.lua"
   684766 LUA: ...les\Lockheed Martin\Prepar3D v4\Modules\StartDCS.lua:1
   684766 LUA: Global: ipcPARAM = 0
   684797 >>> Thread forced exit (ipc.exit or os.exit) <<<

 

So it should more be like :   ext.shell("C:\Program Files9 x86)\FSPS\Dolby Cockpit Sounds FSX\StartDCS.bat", "EXT_MIN") .... ?

Regards, Gerard

 

 

Posted
3 hours ago, GSalden said:

I also tried :      ext.runif("C:\Program Files9 x86)\FSPS\Dolby Cockpit Sounds FSX\StartDCS.bat", "EXT_MIN")   whicg didn't work either.

As I said "Run" (and "RunIf", as documented, is a version of Run) cannot create a process from a BAT file. You must use the shell facility, as I also said!

In any case, you seem to have tped "9" instead of " (" in the path (AND you repeated it in the last line!). Please do check your own typing.

3 hours ago, GSalden said:

  684766 *** LUA Error: cannot open D:\Program Files\Lockheed Martin\Prepar3D v4\Modules\ipcDebug.lua: No such file or directory

Why are you trying to run ipcDebug.lua? 

 

Pete

 

Posted
4 hours ago, GSalden said:

So it should more be like :   ext.shell("C:\Program Files9 x86)\FSPS\Dolby Cockpit Sounds FSX\StartDCS.bat", "EXT_MIN") ....

The 9 x86) is wrong, again.

EXT_HIDE works on Windows and may not work with Batch files, which operate via the DOS-type Command line interface

Pete

 

 

 

Posted

I have tried these :

ext.shell("C:\Program Files (x86)\FSPS\Dolby Cockpit Sounds FSX\StartDCS.bat", "EXT_MIN")

ext.shell("C:\Program Files (x86)\FSPS\Dolby Cockpit Sounds FSX\StartDCS.bat")

handle, error = ext.shell("C:\\DOS\\StartDCS.bat", EXT_MIN, EXT_CLOSE)

handle, error = ext.shell("C:\\DOS\\StartDCS.bat")

 

Unfortunately none of them are working. I even tried after reinstalling DCS directly into C , so above program files (x86).. 

Regards,

Gerard

Posted
1 hour ago, GSalden said:

ext.shell("C:\Program Files (x86)\FSPS\Dolby Cockpit Sounds FSX\StartDCS.bat", "EXT_MIN")
ext.shell("C:\Program Files (x86)\FSPS\Dolby Cockpit Sounds FSX\StartDCS.bat")
handle, error = ext.shell("C:\\DOS\\StartDCS.bat", EXT_MIN, EXT_CLOSE)
handle, error = ext.shell("C:\\DOS\\StartDCS.bat")

Unfortunately none of them are working. I even tried after reinstalling DCS directly into C , so above program files (x86).. 

Well the first two are wrong. You need \\ for every single \ as that character is an 'escape' character, used to insert things like returns and tabs etc (\r = return, \n = new line, \\ = \ etc. Standard in many programming languages including Lua.

In the other two you suddenly decided to use \\ instead of \, so I think you really knew this.

In the third one the EXT_MIN and EXT_CLOSE should be in "".

1 hour ago, GSalden said:

I even tried after reinstalling DCS directly into C , so above program files (x86).. 

Did you create a folder named DOS in C and put "StartDCS.bat" into it? Because that's what you show in the last two. Why "DOS"? Did you mean "DCS"?

I think you need to be a lot more careful what you type. Is is not like errors in emails and messages which people can still understand. Computers are basically stupid. You must be 100% exact.

Also, the "error" number being returned should be used to see what error might be indicated. Log the value by

ipc.log("ext.shell returned error = " .. error)

Pete

 

 

Posted

Hi Pete,

Thank you for your great support.

As I have started looking into LUA yesterday for the first time I am making errors. The only thing I want is a LUA that starts a batch file.  

I have made a new folder in C called DOS with the batchfile in it. Just to be sure I will not have any rights issues in the program files (x86) folder.

You are right about computers . That I am finding out right now.

I will try again later today..

regards, Gerard

 

Posted

Got it working with your help :

 

handle, error = ext.shell("C:\\DOS\\StartDCS.bat", "EXT_MIN", "EXT_CLOSE")

ipc.log("ext.shell returned error = " .. error)

 

Now it is working perfectly. Many thanks Pete for your patience.

If it is Ok with you I can put the LUA-batch combo in the Users section as " Starting programs ( exe ) with a yoke button through LUA " 

Regards, Gerard 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.