Jump to content

SchneiH2

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by SchneiH2

  1. Hi everybody Basically, there are two parts of the question: First is that I am trying to translate Ben's Gizmo64 code for the terrian map into a SDK plugin, however so far without success. My below code basically works, however, does not display a terrain texture. I am wondering, how to get the texture id of the terrian, if there is any. int efb_map_draw( XPLMDrawingPhase inPhase, int inIsBefore, void * inRefcon) { XPLMBindTexture2d(map_texture, 1); XPLMSetGraphicsState(0, 1, 0, 1, 1, 0, 0); glColor3f(0.75, 0.75, 0.75); glTranslated(64, 15, 0); glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0, 1); glVertex3f(0, 50, 0); glTexCoord2f(0, 0); glVertex3f(0, 230, 0); glTexCoord2f(1, 0); glVertex3f(240, 230, 0); glTexCoord2f(1, 1); glVertex3f(240, 50, 0); glEnd(); glPopMatrix(); return 1; } Secondly, I am wondering whether there is a possibility to display the map from the map UI (i.e. aso differnt layers like VFR, IFR low/high) on an instrument/gauge. At least the G1000 gauge has this option. Having looked through the new map api I could not find any routine to get a texture id of the map. The map sample code on the SDK page creates to my understanding new layers in the map UI bu I do not see there any solution to display the map on an instrument on the 3d panel. Thank you up front for possible help. Best regards SHJ
  2. Just to close this topic: Problem solved thanks to Ben's hint to use drawing phase xplm_Phase_Gauges. I just did not use the rght coordinates initially to display the string on the 3d panel. Thansk again for all replies and help. SHJ
  3. Hi Jim Thanks for your reply. If I understand correctly than Gizmo64 acts as a kind of overlay to the SDK and uses the SDK code set/API? Using xplm_Phase_Gauges works in a way that it indeed draws the string on the 2D panel. Regarding the Gizmo64 code shown above I am a bit puzzled that to my understanding with glPushMatrix() and glPopMatrix() OpenGL is being addressed. However, adding this to the plugin code does not give any effect. Could there be a necessity to somehow 'load' the 3D panel png in the plugin code? Frankly speaking I do not fully understand the meaning of the second part of below explanantion from the SDK Thanks up front for additional comments Best regards SHJ
  4. Hi guys Many thanks to all of you for your responses. Regarding your comments on the advantages of Gizmo64 I fully agree. It is indeed a very handy tool/plugin that allows also people like me with quite basic programming skills to achieve great results. Basically, I could realize almost all functionality I wanted for my a/c with this tool/plugin. However, as the plugin meanwhile became payware and can be obtained according to Ben’s post not on a standalone basis but only together with a X-A payware product it is no longer an option for my project. This because I plan to publish it once it will be ready (god knows when) on a free basis and thus people who want to use it would be forced to buy a X-A payware a/c to get the Gizmo64 plugin to run the freeware a/c they want. Please do not take the aforesaid as any criticism, it is just considering a fact. My project is a pure hobby and I am realistic enough to understand that the result will hardly be on a level that asking money for it can be justified. Therefore, I probably must do it the ‘hard way’ and will see how far I get. At least for the moment I am still more excited than frustrated. Back to the problem itself many thanks to you Ben for the hint with xplm_Phase_Gauges and PhM’s comment. Out of your comments I concluded that I perhaps gave a wrong description of my problem/aim. Basically, I would like to write on the 3D panel (instrument) and not somewhere into the 3D space. After reading your comments and again the SDK docs I suspect that there might be a difference. Please find below as example of the Gizmo64/Lua code I use to display on the EFB (which background is in the 3D panel graphic) the current weather of the destination airport. I just wanted to reproduce this option with the SDK; It might be of course again a good argument for Gizmo64 since a could realize this feature quite easily. function OnDraw_Gauges_3D() if efb_power == 1 and efb_mode ==3 then --EFB wheather gl.PushMatrix() gfx.drawString("AIRPORT ", 1820, 580) gfx.drawString(metar_apt, 1820, 560) gfx.drawString("WHEATHER ",1820, 530) gfx.drawString(metar_data1, 1820, 510) gfx.drawString(metar_data2, 1820, 490) gfx.drawString(metar_data3, 1820, 470) gfx.drawString(metar_data4, 1820, 450) gl.PopMatrix() end end I must admit that I do not know whether Gizmo64 interacts directly with XPlane independently from the SDK structure or if they are linked. In case of the latter I assume that there might be a possibility to do it similarly using the SDK? Whatsoever, many thanks already know for additional comments. Best regards SHJ
  5. Hi Can somebody give some help on this topic. I have tried to find as much as possible on the web, however, the information is limited. I have also tested the example http://www.xsquawkbox.net/xpsdk/mediawiki/DrawingHook which works well with my plugin, however, frankly speaking I have a lack of understanding how to continue from this point with the 'string issue'. Although, the following code snippet is probably missing essential parts I include it just to illustrate where am I at the moment with my considerations: XPLMRegisterDrawCallback(My3DTest, xplm_Phase_FirstScene, 0, NULL); XPLMUnregisterDrawCallback(My3DTest, xplm_Phase_LastScene, 0, NULL); int My3DTest( XPLMDrawingPhase inPhase, int inIsBefore, void * inRefcon) { float color[] = { 1.0, 1.0, 1.0 }; glPushMatrix(); XPLMDrawString(color, 300, 120, "Teststring", NULL, xplmFont_Basic); glPopMatrix(); return 1; } If I understand the SDK documentaton correctly then the xplm_Phases should be correct for 3D drawing. Thank you very much for possible help and best regards SHJ
  6. Hi Jim Thank you very much for your reply + amended file. Now it works. Was indeed a formatting problem. However, I am still struggeling with this issue. Although, I have set the index for the engines correctly (i.e. 0, 1) and saved the file the second engine shows the value of the first one. This despite the fact that the plugin seems to work correctly, i.e. when checking the dataref values with the DRE everythng is correct. For illustration some pics are attached. I am continuing to check this issues, however, perhaps you have an idea what might be the reason. Thanks and regards SHJ
  7. Hi Jim Please find attached the file. Custom dataref is added at the end. Best regards SHJ DataRefs.txt
  8. Hi Jim First of all my best wishes to you for 2018. Thank you for your response. The described approach works fine for the part of PM, i.e. when adding the dataref (SSJ100/SD_FUEL/fuel_used float[2] y kgs custom dataref) to the DataRefs.txt the Index-field gets active and can be edited. However, it creates problems with XP11 itself, i.e. leads to a crash when loading any a/c. To avoid any file formating issues I have amended the DataRefs.txt with the normal Windows text editor. Perhaps you have an idea what might be wrong. Thank you and best regards SHJ
  9. Hi Just to be sure - I have created in my plugin for the a/c a float array custom dataref (fuel consumption per engine). Everything with the code works well. However, I have noted that when using a CUSTOM array dataref in PlaneMaker the corresponding index field is inactive (please refer to attached pic). Am I doing something wrong? Thanks for possible help and best regards SHJ
  10. Hi Ben Thank you very much for your reply and offer. I hope not to disappoint you when saying that I got meanwhile very attracted by this pure programming stuff with the SDK and C++ and will continue this way although I guess that there are a lot of learning lessons ahead to go through. Never thought that I will somewhen start with C++ as it seemd to me very cryptic. Meanwhile, I got at least a first idea about the elegance of this programming language. I am quite optimistic that I will be able to transcribe the basic a/c functions from Gizmo/Lua quite fast, however, will probably get stuck with the 3D graphics stuff which I use for the EFB. Would be great if I could count on some help from you in future. Thank you again for your reply and all the best for 2018! Best regards SHJ
  11. Hi PhM Thank your for your reply. There were basically two reasons for the problem (or maybe just one => ucritical copy/paste) The frst one is: XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterDataAccessor(SSJ100_APU_MSw); vs XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterFlightLoopCallback(SSJ100_APU_MSw); WRONG!!! => copy/paste issue The second one was uncorrect use of variable types (int vs float) in the accessor callbacks for the custom datarefs. Thank you again for your feedback and best regards SHJ
  12. Hi everybody I am about to transcribe a Gizmo64/Lua script into a plugin. Therefore, I had to start learning C++ where I believe made some good progress on the language itself, however, feel still weak with the whole environment (MS VS2017). So far I was working with the SDK2 and just started to try working with the SDK3. All code I have generated based on the SDK2 works well. including custom datarefs (instruction an examples mainly take from here http://www.xsquawkbox.net/xpsdk/mediawiki/Main_Page. As a basis I took the 'Hello World' example and copied i my code from SDK2. Except for the custom datarefs I can compil the project without errors. When adding the custom datarefs I get a compiler error as shown in the attached picture. Woul be great if somebody could provide some help. Thanks and regards SHJ
  13. Hi I have just noticed that the download link for Gizmo64 on Gizmo64.com is now dead. Taking into account Ben's mail above it is my understanding that Gizmo64 is not (no longer?) an option for freeware projects. Good oportunity to improve C++ skills to use in future a plugin for the a/c instead of a Lua/Gismo64 script. So, probably I will be more active in future in to the Plugin Developer forum and hope for the same excellent help I got all the time here. Best regards SHJ
  14. Hi Jim Thank you again for the link/file. I have now installed it (copied the content into xplane11/resources/plugins), however, when running XP11 with my a/c I got a pop-up to enter the corresponding registration with X-Aviation. Without this registration the Gizmo64-script for the a/c does (naturally) not work. Having also checked the X-Aviation site I understand that the Gizmo64-plug-in cannot be purchased on a stand-alone basis but, in line with Ben's mail, would be part of an a/c-payware. Given this and looking at the post from Ben it is my understanding that Gizmo64 is no longer a freeware plug-in (at least the newest versions). For private use I am fine with the older versions of Gizmo64 which seem to work except perhaps the above issue. However, this would mean that a/c which would be published as freeware and using Gizmo64 would partly become payware? This is not a criticism, I just would like to understand whether Gizmo64 is a good option when moving in this direction, i.e. creating a/c as freeware. I am not sure but believe to have read somewhere (in this forum?) that there is a Gizmo64 version or set-up for either payware or freeware. I would be much grateful if you could comment on this to get a better understanding. Thank you very much and best regards SHJ P.S. some impression from WIP (still for XP10)
  15. Hi Ben Thank you very much for your response. I am a bit unsure how to understand 'official way' in your post. So far I have downloaded Gizmo64 from Gizmo64.com assuming that this is official + legal. It is absolutely not my aim to use anything on an unofficial or illegal basis. I would like to be sure in this matter since I might publish the a/c once finished as freeware. Could you perhaps also give a short example for X-A payware assuming you do not mean X Plane sim itself. Thanks again and best regards SHJ
  16. Hi Jim Got it now. Will try and let you know the effect. By the way, I got the impression when searching the internet that there is currently no 'official' place whith an updated version of Gizmo64 (???) since the one on Gizmo64.com seems to be out of date and not maintained. Am I wrong? Will I have to improve my very basic knowledge of Delphi (is this still an option for plugins?) or C++ to create plugins for additional functions of a/c in future? Hope not since I think that Gizmo64 is a good alternative for that. Thanks again and best regards SHJ
  17. Hi Jim I am not sure what you mean with 'private messages' (sorry, I am obviously not very familar with the forum features/options). I understand that there is on top an icon for messages, however, nothing new or private. Thank you up front for additional explanation where to find them. Best regards SHJ
  18. Hi Jim Thank you very much for your respones. So, before continuing to evaluate the issue itself I would wait for a correct download link for Gizmo64, install it and check the effect. Thanks and regards SHJ
  19. Hi Thank you very much for the respone and the link for the download. Perhaps my following question sounds a bit stupid, however, when opening the link/page I see a couple of files + folders and I am absolutely not sure what to download/install. That's probably because I am used to download Gizmo64 as zip-file with all content therein. I would be grateful for some additional comment/explanation. Thanks and regards SHJ
  20. Hi Jim Thank you very much for your response. Regarding the Gizmos versions I am a bit puzzled. I have just downloaded again from Gizmo64.com the current (?) version (see attached picture). However, I get the same error even when using the sample code as also shown in your mail. I have also noticed that the link in B. Russels mail seem to be dead (http://forums.x-pilot.com/forums/topic/13121-gizmo64-v1706041958/) Are there other Gizmo64-version in other places? Regarding the code itself I think to have used basically the same. Again, he aim is just to set a flag variable if a command (e.g. sim/FMS/ls_1l) is executed. Thank you and best regards SHJ
  21. Hi Tried to use this approach, however, got an error message onthe Gizmo64 consolde: cmd.newCommand("sim/FMS/ls_1l", "Test cmd", "fmc_button_flag") function fmc_button_flag_OnStart() fmc_flag= 1 end
  22. Hi airfighter Thanks for the response. It just also cam accross my mind to check if that would be an option. Will let you know once checked. Thanks again and best regards SHJ
  23. Hi everybody In addition to my previous post and in order to perhaps simplify a bit the issue just one question: Is there a possibility to read out in Gizmo64 a command value directly, i.e. 'if true xp.commandOnceByName("sim/FMS/key_1") then set variable z = 1? Thank you again for possible help. Best regards SHJ
  24. Hi everybody I am currently adapting the XP11 FMC to my a/c project (Superjet 100), in particular the RAD/NAV page where on the real plane the DH is being set. To make it as realistic as possible (i.e. catch erroneously inputs, display related messages on the FMC scratch pad etc.) I need to catch some events being triggered by the standard FMC commands (e.g. command executed (e.g. call a page) → set a flag variable). As I am not aware if and how an event caused by a command can be catched in Gizmo64 I use a kind of way round through some customized dataref. Basically, everything works fine except one strange thing: If I am on the ‘co route list’ FMC page and select a flight with one of the FMC ‘line select buttons’ (1l, 2l, 1r, 2r) the page correctly switches to the ‘FPLN’ page, however, does not load the flight plan. In the cockpit-object I use a ‘push’-manipulator for the FMC ‘line select buttons’ which I think is correct. I have noticed that the reaction time of these FMC ‘line select buttons’ with named ‘push’ manipulators seems to be extremely short, i.e. in some cases when selecting ‘co route list’ it selects the same time the underlying flight plan file (although it does not load the plan itself) and switches to the FPLN page. For better understanding please have a look at the attached pics. Could somebody perhaps give some input/advice if there is a solution for the problem. Thank you very much up-front and best regards SHJ elseif num_key == 26 then xp.commandOnceByName("sim/FMS/ls_1l") dh_4 = 0 ;dh_3 = 0; dh_2 = 0; dh_1 = 0; dh_digit_counter = 0
  25. Hi airfighter Sorry for responding with delay => holiday season! Thank you very much for the help. Indeed, that's it. The problem was that I have in a former script version set the nb_wpt-variable in another function which I have meanwhile omitted but did not realize that this is now missing in the current function. Thanks again and best regards SHJ
×
×
  • Create New...