Jump to content
The simFlight Network Forums
Sign in to follow this  
ark1320

ipc.display and P3Dv4

Recommended Posts

Hi Pete,

Does the ipc.display and  setowndisplay combination work in P3Dv4? I recall there have been some issues with this in the past. I'm trying to help a friend but unfortunately don't have P3D myself for testing.  Scripts I've written using ipc.display that work in FSX on my friend's machine are not displaying anything in P3Dv4.

Thanks for an update on this,

Al

Share this post


Link to post
Share on other sites
6 hours ago, ark1320 said:

Does the ipc.display and  setowndisplay combination work in P3Dv4?

I havewn't hacked into the Window.DLL code in P3D4. Both of those functions work, BUT they both use the one SimConnect text window facility.  In other words the "owndisplay" one does the same as the display one.

6 hours ago, ark1320 said:

Scripts I've written using ipc.display that work in FSX on my friend's machine are not displaying anything in P3Dv4.

I'm using the ipc.display option redularly, and it works fine. In the latest version of FSUIPC5 95.122) I've made the "advdisplay" toggle hotkey work again, too.

That switches the display on or off, and does it via a flag, so once off it stays off till switched on  It also operates on the single line displays shown via offset 3380. But that switch is certainly "on" by default.

Here is my main ipc.display using Lua plug-in:

-- Update the display at 500 msec intervals (see event at end)
function mytimer(time)
    fr = ipc.readUW(0x0274)
    if fr ~= 0 then fr = 32768/fr end
    fr = math.floor((fr * 10) + 0.5)/10
    traff = ipc.readUD(0x025C)
    fstime = string.format("%02d:%02d:%02d", ipc.readUB(0x0238),
              ipc.readUB(0x0239), ipc.readUB(0x023A))
    
    ipc.display("Frame Rate     " .. fr .. 
        		" fps\nTraffic            " .. traff ..
    			"\nFS Time         " .. fstime)
end

-- Adjust timing to taste: 500 = 1/2 second
event.timer(500, "mytimer")

I'm not really sure what you mean by this:

6 hours ago, ark1320 said:

I recall there have been some issues with this in the past.

There hasn't really been much "past" for P3D4 yet. Nevertheless I suggest you advise your friend to keep his FSUIPC5 up to date.

Pete

 

 

Share this post


Link to post
Share on other sites

I am missing the ability of Lua scripts running in parallel to have their own unique named, size and position windows.

Now, when two different 'ipc.display' calls in different Lua scripts running in parallel happen the 1st is clobbered by the second making my implementation of my Lua driven extension for the A2A L049 Virtual Flight Engineer a mess, so I will probably have to restrict it's use to FSX, and P3D Pre-V4.

 Paul

Share this post


Link to post
Share on other sites
17 hours ago, Gypsy Baron said:

I am missing the ability of Lua scripts running in parallel to have their own unique named, size and position windows.

Me too. I have bee pressing L-M for some better facilities for such things, but to no avail so far. They seem to think the current Simconnect text window facility is adequate.

17 hours ago, Gypsy Baron said:

calls in different Lua scripts running in parallel happen the 1st is clobbered by the second making my implementation of my Lua driven extension for the A2A L049 Virtual Flight Engineer a mess,

Well, if I can figure out of way or making them share the one available Window without "clobbering" each other, maybe that might be an interim solution. But how do you think that could be made to look sensible? I have to provide the P3D function one long string with everything in it, each time it needs updating.

Pete

 

Share this post


Link to post
Share on other sites

Hey there!, so, can anyone confrim that ipc.setowndisplay doesnt work any more in p3d v4? I find that the time paramater of ipc.display doesnt have any effect either, whatever you put the display only stays varely a second on the screen...

Thanks in advance for any insight in this.

Arza

Share this post


Link to post
Share on other sites
46 minutes ago, arzabico said:

Hey there!, so, can anyone confrim that ipc.setowndisplay doesnt work any more in p3d v4?

SetOwnDisplay was by a hack into FSX/P3D3. Wth proper new SimConnect facilities what that did is not possible (and I am NOT hacking into P3D4 code!). So "SetOwnDisplay" is now, in P3D4, the same as "SetDisplay".

This should of course be noted in the Lua library document but on checking I see that the amendment I thought id put in did not make it to the end result, so I'm making a note to deal with that now ready for the next release. Sorry for the misunderstanding. 

46 minutes ago, arzabico said:

I find that the time paramater of ipc.display doesnt have any effect either, whatever you put the display only stays varely a second on the screen...

That's strange and should certainly not happen. The display function isn't changed, and it certainly works okay normally. Can you show me the Lua plug-in so I can test it here? And see if it happens if you use SetDisplay instead of SetOwndisplay -- though any difference seems very unlikely as shey are effectively the same code.

[Note: I though for compatibility it would be better to make those the same rather that just remove SetOwnDisplay from FSUIPC5]

Pete

 

Share this post


Link to post
Share on other sites

Thanks Pete! Its an honour to salute you by the way.
The timing thing in ipc.display was my mistake, i think it does 1sec less than you ask, i was asking for 2 and was making varely 1, if i ask for 10 does 9, so really doesnt matter...

So regarding SetDisplay, it has no effect any more either over p3dv4, does it? just tested and has no effect to me, and getdisplay return all variables to 0.

As I said, an honour, your jop done with fsuipc is amazing. Thank you.

Arza

Share this post


Link to post
Share on other sites
4 hours ago, arzabico said:

So regarding SetDisplay, it has no effect any more either over p3dv4, does it? just tested and has no effect to me, and getdisplay return all variables to 0.

If you mean they aren't setting or getting the size and position of the display window, then that certainly likely as I don't think I can do that easily.  But I probably should be able to do it. t hadn't occurred to me. Sorry.

I'll take a look.

Pete

 

Share this post


Link to post
Share on other sites

Don't do it for me please, I don't really have the need, was just asking cos I read it in the manual. The only real interest I had was to change the title of the window, but I can live without that too.

Its really apreciated your interest and replies. Thank you very much.

Arza

Share this post


Link to post
Share on other sites
14 hours ago, arzabico said:

Don't do it for me please, I don't really have the need, was just asking cos I read it in the manual. The only real interest I had was to change the title of the window, but I can live without that too.

Well, I looked at the code for ipc.getdisplay and ipc.setdisplay, and it was easy enough (with what i've learnt about SimConnect in P3D4) to make them work for the "SimConnect Message Window", so these will be fine in the next FSUIPC5 release. The setdisplay one might turn out useful for you to get the window exactly where you want it.

The ipc.setowndisplay will be identical in effect to uipc.setdisplay -- the title provided is ignored as unfortunately i can't change that.

Pete

 

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...
Sign in to follow this  

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