Jump to content

Aaron Symons

Members
  • Posts

    90
  • Joined

  • Last visited

Everything posted by Aaron Symons

  1. Okay. I've defined it, now I get: "The specified module could not be found." lol I think we're getting somewhere though. I've read that this message can be given if my DLL is dependent on other DLL files. The only things dependent would be the Lib files I included in the VS project. Could this be the issue here?
  2. I'm thinking it might be to do with the other DLL files I linked into my VS project, info. I'm not running in sandbox mode, and I think it can't find "luaopen_power". simpleDLL.h extern "C" { #include "lua.h" #include "lauxlib.h" #include "lualib.h" } static int isquare(lua_State *L); static int icube(lua_State *L); int luaopen_power(lua_State *L); simpleDLL.cpp #include "simpleDLL.h" static int isquare(lua_State *L) { float rtrn = (float)(lua_tonumber(L, -1)); printf("Top of square(), nbr = %f\n", rtrn); lua_pushnumber(L, rtrn * rtrn); return 1; } static int icube(lua_State *L) { float rtrn = (float)(lua_tonumber(L, -1)); printf("Top of cube(), number=%f\n", rtrn); lua_pushnumber(L, rtrn*rtrn*rtrn); return 1; } int luaopen_power(lua_State *L) { lua_register(L, "square", isquare); lua_register(L, "cube", icube); return 0; }
  3. I tried loading my DLL with this: local dll = assert(package.loadlib("C:\root\to\simpleDLL.dll", "luaopen_power")) which results in: "The specified procedure could not be found." Also, I don't have a lua.exe file on my computer. :/
  4. Hi, Got my DLL compiled with no warnings or errors. Woop! @Rick, I did as you suggested and included all header and source files into the project, as well as including the LIB files. The only thing now is: where do I put the DLL in my Leadwerks project (if it matters), and how do I require() it from within Leadwerks? lol At least I have my DLL now!
  5. I see now. I just copied all the downloaded files to my project folder and then I just #include the three header files I stated in the code snippet, pointing to the downloaded ones, of course, like: // Path to downloaded header #include "C:\path\lua.h" So you're saying I should include all Lua / LuaJIT files into my project as if I created them: so they show in the "solution explorer" in VS, then include the three headers I included in my snippet?
  6. Include all header files, or just the three I include already? I'm still having difficulties using the lua_ methods. I must be missing something! If I redefine them in my DLL project, I get an error stating as such. I don't want to redefine them, but that's one of the "solutions" I've tried. I'm really not sure where to go from here. It's obviously doable, as many people have created DLL files for Lua, but I can't seem to get things working. It could be: The setup of my VS project, including; The compiler used in my VS project isn't suitable Missing included files Missing definitions I don't know, and I'm sure the list could go on! lol
  7. @shadmar Thanks for the info! Is there any documentation on the Leadwerks 3.x shader convension, as I can't see any? The most useful documentation I've always found has been LE 2.x (I think), where the likes of TVec types are used - very old. I'd love to know how you did your , as this has always been of interest to me since I first saw it in a game. I'm sure there are many different ways of going about it (I can think of a few ideas), but using a shader is most intriguing to me.
  8. Thanks for giving me a good starting point guys. I'll look into the links you've given me and certainly do as you suggest.
  9. Hello, I was just wondering if anyone can point me to any in-depth theories, practices, and tutorials for creating shaders for Leadwerks. I've spent a very short time dissecting some of the shaders that come with Leadwerks, but I don't fully understand how they work. Thanks in advance!
  10. If you're doing it via script, try setting the global coordinates to true, as described here: entity:SetPosition(x, y, z, true) Get the player's position, then add onto that, eg: if you want the object 2 units in front of the player on the X axis: -- Get player position (if this script is attached to the player) local playerPos = self.entity:GetPosition() -- Set the object's position, using global coordinates self.object:SetPosition(playerPos.x + 2, playerPos.y, playerPos.z, true)
  11. @YouGroove Would it be possible to draw the texture (context:DrawImage) instead of applying it to a material? I have a menu which fills the entire screen drawing images and such, and I wish to display the texture here.
  12. Yeah. I think I'm missing something here, because I definitely can't seem to use the lua_pushnumber method, and other lua_ prepended methods. Where do you download your Lua source? On the Lua.org website, I only see downloads available that will give me more than the 2-3 files you mention.
  13. You're not going crazy at all! I think I might be regressing in IQ, though! My last comment, I meant that I'm not sure if "Sync() then DrawText()" would make much difference to "DrawText() then Sync()" in this case, seeing as it's just a loading screen. I have my animated loading screen working wonderfully now! Thank you Rick, you've been most helpful. One quick aside question: is there a way to change the compression of multiple texture files at once in Leadwerks? I've just had to spend nearly twenty minutes changing the compression of over 300 texture files for my "animation" (I uncompressed them in order to have transparency, as well as nice smooth graphics). If not, hopefully I can do something through code instead, unless I'm missing something yet again.
  14. Sorry! You were right. I accidentally missed out a line in my code when I posted it on here ( in LoadingScreen() ) where I Sync() the context before drawing. Sorry about that! I'm not sure if syncing after drawing would make any difference, perhaps I'll experiment. I'm updating it to now show an "animated" loading icon.
  15. Yeah. That's my next step. I'll be using Blender to render an animation to png files and cycle through them using a similar method to your suggestion. This definitely works for me. There is no other code included in my Loading Screen "system", only what you see here. I wonder if the call to update the context in App.lua is still running during Map:Load(), as the world (self.world) is never destroyed or created for each map load - the original always exists.
  16. As far as I can see, NuGet installed both lib and dll files for Lua. NuGet is a tool in Visual Studio 2013 Express. You just type into the NuGet console: Install-Package "Lua" and it finds the files from some online repository (I guess) and downloads them for use in the current project.
  17. The way I displayed the loading text (in App.lua): function App:LoadingScreen() self.context:SetFont(self.DefaultFont) local loadingText = "L O A D I N G . . ." local x = (App.window:GetWidth() / 2) - (self.DefaultFont:GetTextWidth(loadingText) / 2) local y = (App.window:GetHeight() / 2) - (self.DefaultFont:GetHeight() / 2) -- Fill screen with black self.context:SetColor(0, 0, 0) self.context:DrawRect(0, 0, App.window:GetWidth(), App.window:GetHeight()) -- Draw "Loading" text self.context:SetColor(1, 1, 1) self.context:DrawText(loadingText, x, y) end function LoadingScreen() App:LoadingScreen() end function App:ShouldSwitchMap() -- Clear all entities self.world:Clear() -- Load the next map Time:Pause() if Map:Load(self.mapfile, "LoadingScreen") == false then return false end Time:Resume() end You probably don't need to "fill the screen with black" by drawing the rectangle, but that's what I have until I update it and I hope this helps.
  18. Hey there, I've had some issues with creating my DLL. Namely, the "LNK2019" issue. For some reason lua_pushnumber() and lua_tonumber() are an "unresolved external symbol". I've had a read online, but I'm just getting back into C/C++ and most of my knowledge of it has gone! xD I've "installed" Lua into the Visual Studio project via NuGet. My "simpleDLL.h": extern "C" { #include <lua.h> #include <lauxlib.h> #include <lualib.h> } namespace myNameSpace { class MyClass { public: static __declspec(dllexport) int isquare(lua_State *L); }; } My "simpleDLL.cpp": #include "simpleDLL.h" namespace myNameSpace { int MyClass::isquare(lua_State *L) { float rtrn = lua_lua_tonumber(L, -1); printf("Top of square(), nbr = %f\n", rtrn); lua_pushnumber(L, rtrn * rtrn); return 1; } } I'm just aiming to create a very simple DLL at the moment to get the hang of how they work. Any help will be appreciated!
  19. I'm interested in trying out creating a DLL module for Lua. Do you have any pointers or tips? I'm guessing I'll have to download Lua source in order to get the header files. Looks like I'll have to install mingw as well. I'm sure this is all basic stuff, but I've never dabbled in creating a DLL file before.
  20. Hi, I was just wondering if there's a way to "upgrade" from the Indie edition to the Standard edition on Steam. Would I have to purchase the Standard edition at full price, even though I have already purchased the Indie edition? Thanks! EDIT: Already found my answer. One needs to purchase the "base application" (Indie Edition) before purchasing the Standard Edition (as stated on Steam).
  21. @Josh There are some old posts pointing to the Leadwerks wiki, as well as a Google search, of course. I'm guessing he found it through one of those ways. While we're talking about it, are there plans for an updated wiki, or are you thinking of just keeping all the documentation, examples, and tutorials accessible via the Leadwerks website? Also, in response to CrazyVulcan's question, do you think you'll plan for an auto-complete in the script editor? Personally, I've never felt I've needed it, but I do think it might be an idea worth considering later down the line if Leadwerks keeps evolving and expanding (which I'm sure it will).
  22. I've never seen such an option in the Leadwerks Editor. I think it would be a useful addition though. In the mean time, you don't have to scour the Wiki. You can look through the documentation which gives examples in both Lua and C++, or you can use the index page on the Leadwerks website which lists functions, and more, alphabetically. Hope this helps for now!
  23. Thanks for the info guys! I'll work something out.
  24. So if two objects; one with a mass of 2 and the other with a mass of 10, are both falling, they'll reach the ground at the same time? If so, why do we have a "mass" setting?
  25. I was thinking of doing that, but it would mean any physics I have running at the same time would also be affected. I was also thinking of adjusting the Character Controller's mass through the jump, but I'm wondering if there's a "better" way of doing it.
×
×
  • Create New...