Claude Troncy Posted February 3, 2019 Report Posted February 3, 2019 Bonjour, I have this simple script Quote print("display") ipc.display("HI") No window appears on the screen and of course nothing is displayed even when I try the non simconnect window using the parameter NoMessageWindows=Yes in the ini file. What can I do investigate more ? Thanks Claude
John Dowson Posted February 3, 2019 Report Posted February 3, 2019 Hi Claude, Is this a lua script? If so, 'print' is not a statement and will cause the script to fail. And, without tis line, the script would end very quickly anyway! Also, how are you starting the lua? In FSUIPC, to automatically start a lua script it must be added to the '[Auto]' section, otherwise it should be activated from a button or key press. If you are trying lua for the first time, you can also try activating 'Log Lua plugins separately' (and maybe 'Debug/Trace Lua plugins') from the FSUIPC logging tab, which will create a <yourLuaScript>.log file. Also, please check-out the documentation and example scripts provided. Cheers, John
John Dowson Posted February 4, 2019 Report Posted February 4, 2019 Quote 'print' is not a statement and will cause the script to fail. Sorry, this is not correct - 'print' IS a basic lua command (just one I've never had need to use!). The rest of my comments still apply.
Claude Troncy Posted February 4, 2019 Author Report Posted February 4, 2019 Bonjour John, Print is here only to have a trace in the fsuipc log file. The script is called with a joystick button. I have of course use the console to trace the lua script, and have activate the lua log but nothing special in it. Quote ********* LUA: "test_sound" Log [from FSUIPC version 5.15] ********* 1372840 System time = 03/02/2019 18:58:21, Simulator time = 14:23:03 (13:23Z) 1372840 LUA: beginning "C:\Program Files\Lockheed Martin\Prepar3D v4\Modules\test_sound.lua" 1372840 LUA: ...s\Lockheed Martin\Prepar3D v4\Modules\test_sound.lua:1 1372840 LUA: Global: ipcPARAM = 0 1372840 LUA: display 1372840 LUA: ...s\Lockheed Martin\Prepar3D v4\Modules\test_sound.lua:2 1372871 LUA: ...s\Lockheed Martin\Prepar3D v4\Modules\test_sound.lua:3 1372934 >>> Thread forced exit (ipc.exit or os.exit) <<< 1372934 System time = 03/02/2019 18:58:21, Simulator time = 14:23:03 (13:23Z) ********* LUA execution terminated: Log Closed ********* The script is this one Quote print("display") ipc.display("HI") ref = sound.play("GearUpCall") The print "display" works and I can see it in the fsuipc log The display("HI") doesn't work The sound is played without a problem. Cheers Claude
spokes2112 Posted February 4, 2019 Report Posted February 4, 2019 Quite possibly your display window may be off screen if undocked and set there once before. In FSX this display location is saved in a saved flight file. Maybe try setting a new location and also give it a display duration in case it is clearing too quick. Also try in windowed mode if you are full screen.ipc.setowndisplay("My Lua Display Test", 48, 2, 4, 0) -- this will relocate the window top dead center in the fs main window ipc.display("HI", 5) -- 5 second display duration ref = sound.play("GearUpCall") Roman
Pete Dowson Posted February 4, 2019 Report Posted February 4, 2019 17 minutes ago, spokes2112 said: ipc.setowndisplay("My Lua Display Test", 48, 2, 4, 0) -- this will relocate the window top dead center in the fs main window On P3D4 with FSUIPC5, the displays use SimConnect windows, and can't be set with a user title. Their position can be remembered. FSUIPC stores that (but optionally and defaulted off because of Windowed mode / Full Screen changeover problems with it), 51 minutes ago, Claude Troncy said: The print "display" works and I can see it in the fsuipc log The display("HI") doesn't work The sound is played without a problem. I think the problem is simply that the plug-in only exists for a fraction of a second. Display windows are closed when the requesting plug-in closes. if you want to see it, try adding an ipc.sleep(5000) at the end, so it hangs around for 5 seconds. (The sound request won't delay its termination -- that only initiates the sound). Pete
Claude Troncy Posted February 4, 2019 Author Report Posted February 4, 2019 Hi Pete, Of course you are right, it is obvious now that the script terminate before it has the time to display the window. What an idiot I am. I have 50 years of software development behind me, and it looks like a beginner's mistake. May be I am getting younger...😃 or NOT ! Thanks Pete Cheers Claude
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now