Rick Posted January 27, 2010 Share Posted January 27, 2010 If I do LoadModel() in C++ does that still run the lua script for that model automatically? Also if I send message on an object in C++ does that automatically fire the lua events for that or is there some setup around that? Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 27, 2010 Share Posted January 27, 2010 isn't that the point of scripted entities? Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Rick Posted January 27, 2010 Author Share Posted January 27, 2010 Well just asking because everything I've done has been all in lua. The main program being in lua. I assume I have to use the framework in my C++ program and make a global variable for it? I've never used the framework before in C++ I always did things manually myself. Is there an example of this somewhere> Quote Link to comment Share on other sites More sharing options...
Canardia Posted January 27, 2010 Share Posted January 27, 2010 Examples are here: http://leadwerks.com/werkspace/index.php?/topic/893-call-for-projectwizard-template-code/page__view__findpost__p__7945 Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 27, 2010 Share Posted January 27, 2010 Well just asking because everything I've done has been all in lua. The main program being in lua. I assume I have to use the framework in my C++ program and make a global variable for it? I've never used the framework before in C++ I always did things manually myself. Is there an example of this somewhere> Well LoadScene() seems to handle things fine script wise in a test scene I have animations and switches turning things on and off .. but then I only want to use scripting in this fashion with Bmax. Lumooja has posted somewhere the templates for the Wizard or theres this .. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Rick Posted January 27, 2010 Author Share Posted January 27, 2010 That's what I was looking for. Question: // Set Lua framework object SetGlobalObject( "fw", fw ); // Set Lua framework variable BP lua = GetLuaState(); lua_pushobject( lua, fw ); lua_setglobal( lua, "fw" ); lua_pop( lua, 1 ); That looks to me like the first line is doing the same thing as the next 4. Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 27, 2010 Share Posted January 27, 2010 What I am wondering. You have your game script. How do you get it to run in C++? Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Canardia Posted January 27, 2010 Share Posted January 27, 2010 The main game script should not be used from C++, but it's meant as standalone lua main program when you write your game completely in lua. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 27, 2010 Share Posted January 27, 2010 aah ok. Makes sense Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Rick Posted January 27, 2010 Author Share Posted January 27, 2010 If I call SendEntityMessage() in C++ will that fire the lua script ReceiveMessage() for that model? Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 29, 2010 Share Posted January 29, 2010 If I call SendEntityMessage() in C++ will that fire the lua script ReceiveMessage() for that model? I think so Rick Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Josh Posted January 30, 2010 Share Posted January 30, 2010 If I call SendEntityMessage() in C++ will that fire the lua script ReceiveMessage() for that model? Yep. The scripting functionality is built into the model class, so it doesn't matter if it's being used in the editor, a BlitzMax program, a Lua program, or a C++ program. The same routine is called every time. The only tricky difference between the editor and a C++ program is the framework object, but that has been covered in the Lua tutorial. The whole "framework" thing has been kind of a mess. It works the way it is now, and I am not going to change it, but that's one little detail I feel like the design of could have been better. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Scott Richmond Posted February 5, 2010 Share Posted February 5, 2010 Yep. The scripting functionality is built into the model class, so it doesn't matter if it's being used in the editor, a BlitzMax program, a Lua program, or a C++ program. The same routine is called every time. The only tricky difference between the editor and a C++ program is the framework object, but that has been covered in the Lua tutorial. The whole "framework" thing has been kind of a mess. It works the way it is now, and I am not going to change it, but that's one little detail I feel like the design of could have been better. You don't think its worth changing while you can? I mean the LUA functionality has only been out for a month or two. Or is it too fundamental a change to dive into now? Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
Josh Posted February 5, 2010 Share Posted February 5, 2010 You don't think its worth changing while you can? I mean the LUA functionality has only been out for a month or two. Or is it too fundamental a change to dive into now? Why would I want to change the design? What's wrong with this approach? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Scott Richmond Posted February 5, 2010 Share Posted February 5, 2010 Why would I want to change the design? What's wrong with this approach? You tell me hah. I was just commenting on this: The whole "framework" thing has been kind of a mess. It works the way it is now, and I am not going to change it, but that's one little detail I feel like the design of could have been better. Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
macklebee Posted February 5, 2010 Share Posted February 5, 2010 You tell me hah. I was just commenting on this: The whole "framework" thing has been kind of a mess. It works the way it is now, and I am not going to change it, but that's one little detail I feel like the design of could have been better. i think he meant that in past tense... like the framework implementation before could have had a better design Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Scott Richmond Posted February 5, 2010 Share Posted February 5, 2010 ahhh. Nevermind me then. Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
Josh Posted February 5, 2010 Share Posted February 5, 2010 Oh, I see. I mean, my original design for the renderer was too low-level for most people to understand. I am not sure what I would have done differently, but it is clear that people want commands like SetBloom(), etc. But then they also want it to be easily customizable. It seems like some kind of higher-level effects layering system would be best, but then it is so hard to use texture memory efficiently and minimize the number of passes. You throw in water reflections, and the whole thing just gets incredibly complex. I think rasterized graphics are just too damn complicated. There should be a mechanism to read the underlying pixel's value, then we wouldn't have to do all this buffer swapping back and forth. Early depth discard is utilized 0% of the time when rendering post-processing effects, so I don't see why it can't be done. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.