Jump to content

flyer10au

Members
  • Posts

    21
  • Joined

  • Last visited

Recent Profile Visitors

1,624 profile views

flyer10au's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks for the reply. That is a shame. I know other devs also have this limitation but I know Aerobask for instance has a way to make their custom popouts work without the 3D cockpit showing. Hopefully you guys and the other devs can lobby LR to fix this limitation.
  2. A related question. When the G1000 displays are popped out do they still operate as normal if the Xplane view is set to outside only. I.e. No 3D cockpit shown. I have had issues with other developers aircraft that require the 3D cockpit to show. I want to be able to only show outside view. This question also applies to SR22 and other G1000 equipped models. Wanting to purchase but need this to work.
  3. Yes that helps. Good information for when the API documentation finally gets updated. Thanks again.
  4. Thanks Ben. I thought I'd tried that but must of been finger trouble last time. It now works like a dream. Out of interest what is adding return 1 to the end of OnStart actually doing different to not using return 1.
  5. I'm not getting it. I have the following code and the custom dataref only increments by 1. Nothing happens when I hold or release the button. The button is running a custom command created with xp.newCommand("sim/custom/button", "Button", "button"). The dataref is declared elsewhere. button_count = 0function button_OnStart() button_count = button_count + 1 dref.setFloat(CDRtest1, button_count) endfunction button_OnHold() button_count = button_count + 10 dref.setFloat(CDRtest1, button_count)endfunction button_OnStop() button_count = button_count - 1 dref.setFloat(CDRtest1, button_count)end
  6. Anyone have any success using the OnStop or OnHold hooks that should be called when executing a custom command. I have the same bit of test code in the OnStart, OnHold and OnStop functions but only the OnStart executes. I can't get button release or hold to work at all. I'm using the latest 13.11.05.0205 Gizmo release.
  7. Thanks for the confirmation. Shouldn't take too long with find and replace.
  8. I've just got round to updating my gizmo plugin to 13.11.05.0205 from an older 64 bit version (i can dig the version out if important). I am getting script error's in the console for all the xp.get and xp.set functions in previously working code. I have managed to figure out that by changing these to dref API functions clears the errors. I haven't changed every reference in my multi file scripts yet as I just want to be sure that xp functions will not function with these newer gizmo versions any longer and that dref is the new kid on the block and should be used in new script. I know dref has been in the API for a while now but when and why did xp cease, or did it? The API only seems to be current for 12.09.16.1422.
  9. Thanks for the clarification. It's easy to deal with as you say. Just seemed a little weird to me, but your explanation at least makes some sense to the reasoning behind it.
  10. All Working. Now I understand what the built in OnDraw functions are for it makes sense. My problem was simply because I was trying to draw panel stuff with OnDraw_windows. The only thing that doesn't stack up is this. In the aircraft I tried (including xp's C172). If I make the planemaker co-ordinates 0,0 for a gauge the centre of it is aligned with the left edge of the screen as expected. However in the vertical plane the middle of the gauge sits about 256 pixels above the bottom edge of the screen. Therefore if I add 256 to my y co-ordinate plus half the gauges height I get the top of the gauge. Weird I know.
  11. Jim, I have been using the font functions with success elsewhere so thanks for the tip about gfx.drawstring. I knew about the gfx.texOn() and gfx.texOff() but somehow managed to forget to include them. That now makes the png draw as expected from either OnDraw_Gauges() or OnDraw_BeforeGauges(). I think On_Draw_Gauges() draws stuff just the once and its likely best use is for one time drawing items that don't move or change based on changing dataref's. What I still don't understand is when to use calls from each of these functions and what the differences are. I assume anything that needs to be continually redrawn has to be called from OnDraw_Windows(). I didn't really understand your Side Note. Do you mean create and load all the required textures outside of functions as part of the initial dofile and then just use them by reference to the texture id within the functions. All of the above is really a side show to my main problem with the alignment (see original post). Anyone have any ideas on this?
  12. OK back again. Working my way through the API trying to understand what's possible with Gizmo. This time I'm on to the graphics API and open GL drawing. I've got a couple of questions. My main question relates to how to align png images placed in planemaker with Gizmo code generated open gl drawing elements. What I can currently do is have some gl generated text and number elements drawn with font.drawString nicely align in the desired locations within a planemaker png while the screen size window is less than or equal to the panel.png resolution (1920x1080 in this case). I do this by reading the acf file for the png location (yes, I've also been playing with the IO APi too) and formatting the open gl co-ordinates such that the gizmo drawn elements are using the same reference point. The formatting is simple maths to allow for the fact that planemaker and open gl co-ordinates do not directly reference the same point on the screen. What i'm struggling with is when I extend the x-plane window beyond either the 1920, 1080 or both x-plane scales and shifts the panel such that my open gl draws are now no longer aligned with the desired location of the planemaker png. I have tried some simple maths solutions using combinations of screen size and panel size information which improve a little but they don't solve the problem for all window sizes. I have a dual monitor ( 2 x 1920x1200) set-up that i used for this testing. I really would like to get gizmo playing nice with my existing planemaker generated panels. Any idea's on how to make this work? My second question relates to function calls from OnDraw_Gauges(). I tried to call a function that draws a png to the screen from OnDraw_Gauges(), but the png just would not show. However as soon as I put a gfx.drawString into the function the png draws fine (see code below). What's happening here? Also when should I use OnDraw_Gauges() and/or OnDraw_BeforeGauges(). ------file1dofile("file2.lua")function OnDraw_Gauges() draw_imageA()end------file2function draw_imageA() gfx.setColor(0,0,0,1) gfx.drawString("." , 944, 116 ) --call from OnDrawGauges() to draw_imageA() will not draw image without this png_file = "/image_path/Bezel.png" draw_png( 942, 114, 550, 145, 1, png_file ) --draw and place Bezel endfunction draw_png(x, y, width, height, zoom, file) png_texture = gfx.newTexture() local width = width * zoom local height = height * zoom gl.PushMatrix() gl.Translate (x, y, 0 ) gfx.loadPng(png_texture, file ) gfx.useTexture(png_texture) gfx.setColor(1,1,1,1) gl.Begin('QUADS') gl.TexCoord( 0, 0 ); gl.Vertex( 0, 0, 0 ); gl.TexCoord( 0, 1 ); gl.Vertex( 0, height, 0 ); gl.TexCoord( 1, 1 ); gl.Vertex( width, height, 0 ); gl.TexCoord( 1, 0 ); gl.Vertex( width, 0, 0 ); gl.End() gl.PopMatrix()end
  13. Jim, I agree with you its safer to use nav.getNextNavAid just in case the database changes in the future. I was just pointing out that at this moment in time its the same, which is why my incrementing method worked until you pointed out the documentation error. This is however all now irrelevant for my use because as I previously stated I was able to get the findNavAid function working just as I needed. Once again thanks for your support on this. I'm sure I'll be needing some further help from this great community as time goes on. I could certainly help someone with a nav api question in the future.
  14. Thanks Guys. It sounds like improved documentation is already on the agenda then. It really will help smooth the way for newer developers. We still have this great forum for help in the meantime. Ben thanks for the github reminder. I had been along there a few weeks back. Now I know a little more about Gizmo it may be of more use. Jim, The VOR_NavRef = nav.getNextNavAid( VOR_NavRef ) works as you suggest but is of little improvement over just incrementing the VOR_NavRef by 1 for each iteration until you reach the last VOR entry. This is simply because all the VOR's are in the database sequentially between id's 7065 to 10758. It would help some if the database ever evolved to be un-ordered. What I first had working simply checked each id's frequency, lat and lon for a proximity match within 200 miles of the aircraft location. when I had a match I calculated the bearing. I didn't get a definitive answer to the findNavAid functionality but after reading through the stuff at xsquawkbox It helped me understand how to use it effectively. I changed my code and now i have no iterations at all, just a simple search and some validity checking before the bearing calc's. It's really quite simple with Gizmo. Thanks Ben.
  15. Well I took Jim's advice and re-tracked this little project down the nav database lookup route. I've got to say the things that are possible with Gizmo and the relative lack of time they take to implement is absolutely brilliant. Take me a relative newbie ( about 6 weeks in) to gizmo development and I have been able to not only get all this working but in a matter of a couple of days. That said, I do wish the API documentation was better. I personally think some example code on each page of the API of how to use each function would help greatly. It wasn't all plain sailing but most of my troubles were down to the version of Gizmo (11.5.25) i was using. I also had to update X-plane from 10.02r1 to 10.21. It registered with me when I read a post which mentioned the nav api functions not working correctly in my version. After switching to the latest beta release progress was a lot smoother. I have everything that I originally asked about working. I'm thrilled with the results. But I do have some questions with respect to the nav api and albeit off topic Gizmo in general. I started by using navaid_id = nav.getFirstNavAidOfType(4) which correctly returned the id of the first VOR, after checking to see if it matched what I was looking for I then tried to use navaid_id = nav.getNextNavAid(4). it did not return the id of the next VOR navaid in the database. It simply returned a number 1 higher than the nav_type, in this case 5. Anyone got any ideas why? When using the nav.findNavAid function how do you cycle through all the results that match your search criteria or do you only have access to the one match? Can I get versions of Gizmo between 11.5.25 and the current beta release. If so how? The reason i'm asking is i've been having many crashes with X-plane 10.21 and I'm pulling my hair out trying to even get it to run. 10.02r1 ran fine every time. I believe the latest Gizmo beta will only run on 10.20 or above.
×
×
  • Create New...