Jump to content

Ben Russell

X-Plugins
  • Posts

    3,817
  • Joined

  • Last visited

  • Days Won

    109

Everything posted by Ben Russell

  1. Sorry for the confusion, any changes are made in the name of making you a sleeker, faster, better product. Thanks for posting so that we can all learn from these things. Myself included.
  2. Quick hack showing in-sim path definitions that could be applied to ramp vehicles or other similar actions, camera dolly tracks, etc. Source: 240 lines: http://bitbucket.org/xplugins/gizmo-sdk/src/tip/examples/misc/guiPathingScribbles/guiPathingScribbles.lua
  3. If you have technical support questions about proprietary complex code that contains complicated algorithms and is destined to be encrypted please feel free to email me or ask in private. For all other questions: - Examples you do not understand. - About how to achieve simple things with Lua, etc. etc. - Recommend patterns or reading material. Post in the forum or be reminded to do so with a canned email. If I spend all my time answering the FAQ's in private all the time we will very quickly get nowhere. Please take the time to re-share what I have taught you. If you have been given a small working sample of code PLEASE re-post it here. It will only take you 5 minutes. To do it 10 times over will take me 50. I am receiving too many simple questions privately. Thanks.
  4. This video demonstrates the potential for integrating things like Lemons wonderful flight-plan-database.tk work directly into X-Plane. I am only releasing video of this and not the script source code. I will release the source if Lemon approves.
  5. This example works best at the default x-plane resolution of 1024x768. It's a known error in my programming, I assumed it was correct, and didn't test it, because the code is so short and simple. If you see errors during testing, it's my fault, not yours. Sorry. :-[ I could publish a correction but, wouldn't you prefer to see the other things you can do? Re: Font Types, sorry, at this time that's all we've got to work with, everyone wants better options so expect something soon.
  6. True, true. The real beauty is that you -can- do that in 5 lines.... ok so it's seven....
  7. That's not the approach I will be taking or recommending but you are free to pursue it...... Please let me know if you hit any debugging difficulties going that route. My feeling is that it will very quickly become tedious to unpick all your anonymizing closures. Loops are fast. Really fast. 4 cores at 2.4 billion hertz.
  8. As Cam promised yesterday, we are on the verge of publishing our next generation of content registration tools. This video demonstrates how simple it is to both enroll and activate a Gizmo product. This technology will be available within a few more hours. I'm working out any final bugs. For Pro Users: The In-Sim tools in this video replace Gearbox enrollment training you may have had. All content enrollment and airframe signing will be done in sim. Gearbox still has some uses but this makes life even easier.
  9. Please refer to the section in the Lua Gems book written by Mark Hamburg of Adobe which recommends implementing as much framework code in Lua as possible. It is in the opening pages, just after the Foreword. I felt that it confirmed that I'm on the right path and, if anything, should be writing more code in Lua. I recognize your need for registration handling because I understand that there is a need for such organization. That's why I could quickly respond with a working solution that, while not perfectly clean cut, works. Fast. The F-16 Project has many many files (http://bitbucket.org/xplugins/gizmo-f-16/) and while it doesn't stack the drawing functions with pooling, it was an exploration into modularity. Who knows if the pattern is correct, in some ways it cramps me. The Lua language has features and recommended patterns for modules, I myself work towards adopting them with my own examples. They're in the books somewhere also, I believe the language function you want is require() .... it has certain patterns that you are expected, but not forced, to follow. Freedom is a core idea here. My way might not be the best way for you. I will help publish a recommended, open, framework, for this kind of modularity stacking - on top of - the raw Gizmo APIs, as Gizmo lives on top of the SDK. This method is recommended by the Gems section I refered to earlier and allows us to stay lean agile and super fast. According to them. Let's hope they're right. If they're not, we can always extend Gizmo as I did for you with your dataref extensions, which was a true block in your path. Please, explore whatever form of registration API you feel you need, I know you're capable of writing excellent frameworks. The gizmo-sdk on bitbucket is an open repository and I hope to see all authors contributing to it eventually. It's like subversion, but a bit better.
  10. Very welcome Tom. Welcome to getting on with what you really want to do.
  11. bug.... lua_draw_pool {} should be lua_draw_pool = {}
  12. Correct. function draw_a() end function draw_b() end --keep an eye on this one. lua_draw_pool {} function OnDraw_Windows() for i=1,#lua_draw_pool do lua_draw_pool[i]() --call the table slot variable as a function. magic. Lua <3 end end -- XPLMRegisterDrawingCallback(..........) lua_draw_pool[ #lua_draw_pool+1 ] = draw_a lua_draw_pool[ #lua_draw_pool+1 ] = draw_b Above code creates a pool of modules that will all be drawn. Use your code to insert your tools into the module pool. Gizmo provides access, I wasn't sure how you would like to design your code so I left it open ended. Thanks for the q's!
  13. gfx.setState() needs to be called every frame, possibly multiple times per drawing function. gfx.drawString turns textuing on, which can throw GL texturing into the mix, which will very quickly mess with your vector art with all sorts of fun results. Move your call to gfx.setState() inside your drawing functions and you should have better luck.
  14. functions in lua are the same as variables. last declared wins, it will over-write all others. declaration order follows load order(dofiles...), first line of code to last, root(init.lua) to leaf(last dofile or line of code). Whatever is on the leaves, wins. Welcome to OpenGL. Drawing functions are simple wrappers. Here is the source for drawFilledBox() int gizmo_builtin_gfx_drawFilledBox(lua_State *L){ lua_Number lnVx = lua_tonumber( L, -4 ); //l lua_Number lnVy = lua_tonumber( L, -3 ); //b lua_Number lnVw = lua_tonumber( L, -2 ); //w lua_Number lnVh = lua_tonumber( L, -1 ); //h glBegin( GL_POLYGON ); //clockwise winding.. glVertex2f( lnVx, lnVy ); //l,b glVertex2f( lnVx, lnVy+lnVh ); //l,t glVertex2f( lnVx+lnVw, lnVy+lnVh ); //r,t glVertex2f( lnVx+lnVw, lnVy ); //r,b glEnd(); return 0; } All it does is pull your coordinates in and spit our absolutely bare essentials OpenGL. These drawing API's are only OpenGL shortcuts, they are not a professional PDF grade drawing API like Quartz with full line styling etc. Hope that helps!
  15. Gizmo is free to download and install and always will be. Apologies for any confusions being created at the moment. As a customer of X-Aviation products you will never have to pay an additional separate fee for Gizmo licensing. It is include in the sales price. Using Gizmo, to create stuff, is when you start to pay money. We are currently offering access to Gizmo to the entire community, you may see freeware projects start enhancing their work with Gizmo soon. You would need to pay $20 to see the Gizmo enhancements for that, and any other, freeware that becomes available. These things are hard to put into words, please follow our progress and watch what unfolds. We are not trying to hit you with hidden fees of any kind. I'm sure Cameron will be along shortly to help out more and get you sorted out.
  16. I have temporarily disabled the IO moduled while security is reviewed. Letting people erase some of your files with 5 lines of script wouldn't be very fun. Sorry that your text file wont read. for now do this: data.lua my_data = [[ long string to load from text file ]] And then in your existing file add: dofile("data.lua") You should now have a variable called my_data that has the value of your string data in it. This should let you practice a few things while I worry about protected IO that's still useful to play with. I hope you can understand.... ..You cant do IO from JavaScripts on websites for the same reasons.
  17. Thank you Steven, for bringing the world one step closer to that which we all desire.
  18. As a general rule: Gizmo was designed to work with the "scripts" folder of -an- aircraft. Most plugins being written at the time Gizmo was designed were for aircraft enhancement. However. It would be useful to have some scripts around -all the time-, general utilities scripts, etc. I'm looking into solutions at the moment to allow your script to be around for every aircraft. At the moment all scripts are reset when you change aircraft and it is up to the user to integrate any new modules. For artists though... doing pre-packaged work, this isn't so bad. A payware package using Gizmo will come fully assembled, ready to fly. A script that you make for the community, to share with other freeware users, is currently a little bit too hard to do. The user has to open scripts/init.lua and add dofile("your_script.lua") somewhere Thanks for asking ..
  19. Suggested by a user on the org. Find the source code here: https://bitbucket.org/xplugins/gizmo-sdk/src/tip/examples/misc/sound_Fast_Braking/sound_Fast_Braking.lua
  20. Nice to hear that the product is better than the advertising. A rare thing in todays world.
  21. This was requested as a demo project: Load and play 8 sound files, can bind hotkeys or buttons to each slot using X-Planes command system. Source: https://bitbucket.org/xplugins/gizmo-sdk/src/tip/examples/misc/gui8Track/gui8Track.lua
  22. Every good scripting language needs an interactive mode, right? As always, script source is online here: https://bitbucket.org/xplugins/gizmo-sdk/src/tip/examples/misc/guiLuaShell/guiLuaShell.lua
  23. This will be the only plugin posted this week unless a major bug pops up. https://bitbucket.org/xplugins/gizmo-sdk/downloads If you download the scripts-Kickstart-10.11.15.zip on that page and extract it into -any- FREEWARE aircraft folder (don't use the Falco or Corvalis!!) then you can play with the new repository browser that can download demo scripts off the net on the fly. Enjoy.
  24. No. Just leave it in the folder where you found it. You can pretty much forget about ever doing this unless specifically instructed with loud messages.
×
×
  • Create New...