Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

10 Good

About AndyGFX

  • Rank
    Advanced Member
  • Birthday 06/17/1965

Profile Information

  • Gender
  • Location
  • Interests
    Painting, Drawing, 3D Modeling, Programming (Delphi, C/C++, Perl, Java, Lua, BMX, PLSQL, ActionScript) and ... ;)
  1. WHen you want see how work my code, you can download it here: https://sites.google.com/site/andygfxproject/free-pascal/final3d-sdl-ngine/Final3D_SDL_nGine.rar?attredirects=0&d=1 Run: F3D_DEMO_scene_render.exe and press F1 or F3D_DEMO_gui_with_lua.exe - GUI has used call function from native code. LUAfile: ..\Final3D_SDL_nGine\bin\data\scripts\editor\editor_gui.lua ... GUI.SetHSlider_OnChange("WIN_01","HSlider_01","fnc_Hslider_onchange"); ... and fnc is defined: function fnc_Hslider_onchange() local val = GUI.GetHSliderValue("WIN_01","HSlider_01"); print(val); end; and now GUI.GetHSliderValue in native code: wF3D_GUI.pas F3D.ScriptEngine.AddListFunction('GetHSliderValue', @lua_GUI_HSlider_GetValue); function lua_GUI_HSlider_GetValue(L: lua_state): integer; cdecl; var w_name: string; i_name: string; w_id, i_id: integer; begin w_name := lua.luaL_check_string(L, 1); i_name := lua.luaL_check_string(L, 2); w_id := F3D.GUI.FindWindowByName(w_name); if w_id >= 0 then begin i_id := F3D.GUI.Window[w_id].FindHSliderByName(i_name); if i_id >= 0 then begin lua.lua_pushnumber(L, F3D.GUI.Window[w_id].HSlider[i_id].value); end; end; result := 1; end; Maybe your function isnt properly defined. I have used this steps 1) F3D.ScriptEngine.StartList('GUI'); procedure TF3D_ScriptEngine.StartList(name: pchar); begin if (self.enabled = false) then exit; lua_pushstring(VM, name); lua_newtable(VM); end; 2) Add functions to GUI table; ... // HSLIDER F3D.ScriptEngine.AddListFunction('SetHSlider_OnChange', @lua_GUI_HSlider_OnChange); F3D.ScriptEngine.AddListFunction('GetHSliderValue', @lua_GUI_HSlider_GetValue); ... procedure TF3D_ScriptEngine.AddFunction(name: pchar; fnc: pointer); begin if (self.enabled = false) then exit; lua_pushstring(VM, name); lua_pushcclosure(VM, fnc, 0); lua_settable(VM, LUA_GLOBALSINDEX); end; 3) F3D.ScriptEngine.EndList(); (F3D_ScriptEngine.pas) procedure TF3D_ScriptEngine.EndList(); begin if (self.enabled = false) then exit; lua_settable(VM, LUA_GLOBALSINDEX); end; I have used Lua 5.1 and bum dll, for linux was used lua.so
  2. This is very strange because i have used same method to return value from native code to lua script. Try add check inside C code if it's really function pointer returned from lua stack. state = lua_type(L,-1); state constants are: LUA_TNIL = 0; LUA_TBOOLEAN = 1; LUA_TLIGHTUSERDATA = 2; LUA_TNUMBER = 3; LUA_TSTRING = 4; LUA_TTABLE = 5; LUA_TFUNCTION = 6; LUA_TUSERDATA = 7; LUA_TTHREAD = 8;
  3. Hi Rick i never tried put loop inside lua execute function, i think this isn't good. In my code i have luaV_execute defined as separated exec for external lua function and in native code when i call OnUpdate loop on any object (i.e. gui element) i call this external lua function in loop. From my point of view, your partly published code, look like recursive call => stack overflow or crash. When you want look on my implementation (but in Delphi) you look here: http://sites.google.com/site/andygfxproject/free-pascal/final3d-sdl-ngine source are on bottom of page. Note: Yes I'm always around here, but now i work more for mobiles and Tablets with Monkey.
    1. Pixel Perfect

      Pixel Perfect

      So do I ... nice link!

    2. flachdrache


      ""fengzhudesign.com"" had a lot tutorials up - not my kind of work however. Heh, good test for my ISP. :)

    3. shadmar
  4. Thank. This one looks good for me now in my "critical situation"
  5. Thx. I know this card, but now I don't need card which is GR. CARD KING of WORLD now I looking now, card with has good ratio - performance : price.
  6. Which NV gr. card is similar to NV8800GTX now? I'm little shaggy, with new NV signs. Or which NV card is good?
  7. Hmm ... a haven't experiencies with this phys. things, but i have other idea. Make 1st phase as animation (rotate catapult arm) and then apply force to the thing throwed from catapult. Your idea is good, but from my point of view, not all in-game solution you have to make "totaly" real
  8. I have same problem with this page. I think that problem is with loading steam IMG TAG assigned to account. Opera shows that Maclebee has assigned this image tag from Steam, but isn't loaded (Me too). When I disable "Show Image" from Opera, then never-ending load is stoped
  9. When you want create effect which looks like "LookAt", use align to forward direction [Z axis] - PointEntity(a, b, 3,1,0)
  10. Hmm ... strange ... looks like i have now same problem with NV 258.96 (before i have installed 197.13) and full version of LE (2.40), after installation this one DRV crash ALL programs - Editor, Engine and my programs too. In DEBUG mode from BLIde, program is stopped in buffer.bmx. More infos i can't get, because this is LE core. Log look like: Leadwerks Engine 2.40 Initializing Renderer... OpenGL Version: 3.3.0 GLSL Version: 3.30 NVIDIA via Cg compiler Render device: GeForce 8800 GTX/PCI/SSE2 Vendor: NVIDIA Corporation DrawBuffers2 supported: 1 32 texture units supported. GPU instancing supported: 1 Max batch size: 64 Shader model 4.0 supported: 1 Conditional render supported: 0 Loading shader "zip::e:/_3d_engines/leadwerks engine sdk 2.40 final/tools/adn/shaders.pak//query.vert", ""... Invoking script "E:/_3D_Engines/Leadwerks Engine SDK 2.40 Final/Scripts/start/collisions.lua"... Invoking script "E:/_3D_Engines/Leadwerks Engine SDK 2.40 Final/Scripts/start/fliphook.lua"... Invoking script "E:/_3D_Engines/Leadwerks Engine SDK 2.40 Final/Scripts/start/globals.lua"... Loading shader "", "incbin::../../TerrainColorAndLight.frag"... Loading shader "", "incbin::../../TerrainColorAndLight.frag"... Loading texture "e:/_3d_engines/leadwerks engine sdk 2.40 final/models/entities/light/directional/light_directional_icon.dds"... Loading model "e:/_3d_engines/leadwerks engine sdk 2.40 final/models/entities/light/directional/light_directional.gmf"... Loading mesh "e:/_3d_engines/leadwerks engine sdk 2.40 final/models/entities/light/directional/light_directional.gmf"... Loading material "e:/_3d_engines/leadwerks engine sdk 2.40 final/materials/effects/invisible.mat"... Loading script "e:/_3d_engines/leadwerks engine sdk 2.40 final/models/entities/light/directional/light_directional.lua"... Creating class light_directional
  11. When i create an ini file with classname="blablabla" for gmf model and this model is added to scene and then saved, all properties from INI file are added to SBX file too. But when i create INI file with classname="blablabla" for entity without gmf file (like camera with invisible material + icon only) then this properties from INI file isn't saved to SBX file. Is it a bug or Josh's intent?
  12. This pack contain two old class collection HUD and GUI posted from "old" LE forum. They are now writed little bit specialy. This dev. pack is designer on two different BMX mods - miniB3DExtNew and Leadwerks. This solution is good for me , because i have crapy notebook in office and i want some-time work on my game prototypes and ideas. What is include: 01 - GUI sample 02 - HUD sample 03 - SBX file loader 04 - Space Invaders Game All this samples are possible compile with LE or miniLE (modified miniB3DExtNew) very simple. For miniLE compilation u need use this part of code: Import agfx.agfx_minile Include "classes/AGFX_WRAPPER/miniB3Dext/TAGFX_LE_Wrapper_to_mB3D.bmx" Include "classes/TAGFX.bmx" and for LE compilation u need use this part of code: Framework leadwerks.engine Import "classes/Framework/Framework.bmx" Include "classes/AGFX_WRAPPER/Leadwerks/TAGFX_LE_Wrapper_to_LE.bmx" Include "classes/TAGFX.bmx" Note #1: Wrapper contain basic commands for entity, color, fonts, text, texture, World, ... Note #2: you need use absolut path to file for loading content, this path is automaticaly converted to abstract path when is used LE compilation. Example: File "media_si/Models/enemy_a/si_enemy_a.gmf" is with miniLE converted to "media_si/Models/enemy_a/si_enemy_a.b3d" and with LE to "abstract::si_enemy_a.gmf". For more infos look inside my code - are free - like before Screenshots: Download: DEV PACK
  13. Yeah, good for relax after very "bad" day
  • Create New...