Jump to content
The simFlight Network Forums

Recommended Posts

Hi Pete or any other LUA Guru,

I've now converted to P3DV4 and I'm running FSUIPC 5.103g .
A lua script I used in FSX successfully to play a video doesn't seem to respond.

I'm using the ext.shell in the lua library. 

video, error = ext.shell("L:\\1.mp4", "EXT_FOCUS")  ( As I said, this worked in FSX) 

 the log showed no errors, but the video didn't play.

********* LUA: "test" Log [from FSUIPC version 5.103g] *********
 13259554 System time = 16/07/2017 14:37:18, Simulator time = 11:37:18 (21:37Z)
 13259554 LUA: beginning "L:\Prepar3D v4\Modules\test.lua"
 13259554 LUA: L:\Prepar3D v4\Modules\test.lua:2
 13259554 LUA: Global: ipcPARAM = 0
 13259617 >>> Thread forced exit (ipc.exit or os.exit) <<<
 13259617 System time = 16/07/2017 14:37:18, Simulator time = 11:37:18 (21:37Z)
********* LUA execution terminated: Log Closed *********

so I tried making .bat file called video1.bat
 with simply   "L:\1.mp4" in it.

then changed the lua code to:

video, error = ext.run("L:\\video1.bat")

and it worked.

I also tried:

video, error = ext.run("L:\\1.mp4", "EXT_FOCUS")  

with no luck but also no errors recorded.

Just wondering if I'm doing something wrong or what else I should look into.

I can stick with the .bat file since it works, but it doesn't allow for the command line parameters to adjust the video window.
 

Thanks for your help.

-Jim

 


 

 

 

 

 

 

 



 

Share this post


Link to post
Share on other sites
49 minutes ago, Soundman1 said:

Just wondering if I'm doing something wrong or what else I should look into.

Perhaps the program being invoked to play the mp4 file is not 64-bit compatible? I'm not sure if a 64-bit program can shell a 32-bit program or not, though it would indeed seem illogical for it not to, as it isn't part of the same process.

Your other test proves that the shell call is working. Perhaps you can google it, or if not I'll try when I catch up with things.

52 minutes ago, Soundman1 said:

I can stick with the .bat file since it works, but it doesn't allow for the command line parameters to adjust the video window.

The bat file itself can contain command-line parameters.

Pete

 

Share this post


Link to post
Share on other sites

I'm having a similar issue with P3D v4 and FSUIPC5 key command running an lua which in turn runs an external vbs file that has worked (and still works) under FSX-SE. I'm still working on it but no joy yet.

My lua command:
ext.shell("C:\\Program Files (x86)\\FSX Version Startup\\PostFlight.vbs")

The key command is the same for both sims:
24=109,8,L18:R,0     -{Num-: Press=Lua DataBup }-

Under "Logging" I've ticked Button and key operations, Log Lua plugins separately and Debug/Trace Lua plugins which returns the logging data below.

DataBup.lua log file:
********* LUA: "DataBup" Log [from FSUIPC version 5.103] *********
    57437 System time = 16/07/2017 16:13:49, Simulator time = 16:13:01 (23:13Z)
    57437 LUA: beginning "E:\Program Files\Lockheed Martin\Prepar3D v4\Modules\DataBup.lua"
    57437 LUA: ...iles\Lockheed Martin\Prepar3D v4\Modules\DataBup.lua:1
    57437 LUA: Global: ipcPARAM = 0
    57484 >>> Thread forced exit (ipc.exit or os.exit) <<<
    57484 System time = 16/07/2017 16:13:50, Simulator time = 16:13:01 (23:13Z)
********* LUA execution terminated: Log Closed *********

FSUIPC5.log. This is a segment of the log file:
    41734 Advanced Weather Interface Enabled
    42062 KEYDOWN: VK=109, Waiting=0, Repeat=N, Shifts=0
    42062 .. This key is programmed in FSUIPC4 'Keys' options
    42140 KEYUP: VK=109, Waiting=0
    52953 Plug-in thread table check:

Thanks for the great program and for getting version 5 out so quickly.

Roger

Share this post


Link to post
Share on other sites
1 hour ago, Pete Dowson said:

Perhaps the program being invoked to play the mp4 file is not 64-bit compatible?

Just to be sure I downloaded the 64bit version of VLC player and associated the files to it, but still no luck.

The other programs I tried were Windows Media Player and Quicktime.

Edited by Soundman1
Incorrect information

Share this post


Link to post
Share on other sites

Works perfectly. I tested it with VLC, Windows Media player, and Quick time.

Thank you so much!!  pete > awesomeness

To answer WB_Flashover
 

On 7/16/2017 at 4:39 PM, WB_FlashOver said:

I'm having a similar issue with P3D v4 and FSUIPC5 key command running an lua which in turn runs an external vbs file that has worked (and still works) under FSX-SE. I'm still working on it but no joy yet.

I converted my .vbs scripts into .EXE files with iexpress 2.0 and they work very well.

EDIT: Also, I might point out ( and this may be a moot point to the coders ) 
If your directory is like mine  L:Prepar3D v4,  .bat files don't like the spaces. I found that I had to put quotes "Prepar3D v4" around any folder or file with spaces.

As an example: (I'm a sound guy) I made custom voices for FS DREAMTEAM'S GSX. But, I hated to have the same voice from departure to arrival.

So, I made a lua script and .bat file to switch the voices when GSX finishes the pushback.

Here's the .bat file that runs to make the switch. (Sarah is the name of the ground op)

rmdir /s /q L:\"Prepar3D v4"\"Addon Manager"\couatl\GSX\sounds\pushback

xcopy /E /I L:\"Prepar3D v4"\"Addon Manager"\couatl\GSX\sounds\sarah L:\"Prepar3D v4"\"Addon Manager"\couatl\GSX\sounds\pushback

This runs hidden with a .EXE file I converted from a .vbs file 

Notice the quotes I had to put around L:\"Prepar3D v4"\"Addon Manager"\

    

     

Share this post


Link to post
Share on other sites

Thanks Pete for the file. Have to test tonight. Soundman1, thanks for the suggestion on the quotes. I will double check those but think their correct. I'll look at those tonight as well. 

I've had trouble with Win10 and permissions with .exe files in the past. I will give it a try though if needed.

Cheers 

FlashO 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • 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.