-
Posts
7,936 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Rick
-
What/where is this error function then? Is it a lua function or C++ function? Right now it's hitting this error function and returning false in App:Start() in C++ so I'm dead in the water right now on my next debugging steps to see why this isn't working. Since it's returning false on: if (!Interpreter::Invoke(1,1,errorfunctionindex)) return false; I assume this means it can't find the error function to call? Why would that be? At this point in the code I haven't even done any of my own stuff.
-
I didn't use the BMX file. I have no idea how to run a BMX app, but I'm not really interesting in messing with that right now. I only have 2 headers so I just manually copied and pasted to the pkg file. So I added the dofile and rquire declarations in the package and just changed to referenced Leadwerks version of these in the generated code. ie. replace dofile() with Leadwerks::dofile(). After adding the dofile() and require() it gets passed the !Interpreter::ExecuteFile("Scripts/App.lua") fine now, but hits false on: if (!Interpreter::Invoke(1,1,errorfunctionindex)) return false; I get error: "Lua Error error in error handling" and the program quits. So I think for sure we need to have the dofile and require code at the end of our package and need to replace it with Leadwerks:: versions in the generated code, because that makes it do ExecuteFile() works (since the Lua files use dofile and require), but now we have this errorfunctionidex issue. So not sure what's up with that error function invoking error.
-
Well I screwed something up. Now App.lua is saying it can't find a script that it was finding before I started screwing around adding RakNet and using tolua++. Erroring on: require "Scripts/States/StateManager.lua" even though it does exist. Any ideas?
-
The tolua++ generated code makes a call to lua_gettop(). What would Leadwerks::Interpreter equal be? I couldn't find anything that seems to fight.
-
I'll give this a try, but sort of a bummer we can't push objects directly with a void* without having to derive from Leadwerks::Object.
-
OK, I see you wrapped up some of the lua functions. I see GetGlobal() and Invoke() which would match 2 of the 3 functions I have. What about lua_pushlightuserdata()? I'm pushing a class object pointer to one of the classes I also exposed via tolua.
-
Note that this doesn't seem to like private members as it tries to access them directly :/ And you have to include your class headers that it's making stuff for in the final output. Also note you can't use using namespace Leadwerks in your header files. All namespaces seem to need to be on the types.
-
It doesn't for me. What do I need to include for a header? I included "Leadwerks.h" and the following give me linker errors saying the functions don't exist. lua_getglobal(Interpreter::L, luaHandlers[msg].c_str()); lua_pushlightuserdata(Interpreter::L, &reader); lua_pcall(Interpreter::L, 1, 0, 0); 1>lua-gluecode.obj : error LNK2019: unresolved external symbol "int __cdecl lua_gettop(struct lua_State *)" (?lua_gettop@@YAHPAUlua_State@@@Z) referenced in function "int __cdecl tolua_luacommands_RakNetNetwork_new00_local(struct lua_State *)" (?tolua_luacommands_RakNetNetwork_new00_local@@YAHPAUlua_State@@@Z) 1>RakNetNetwork.obj : error LNK2019: unresolved external symbol "int __cdecl lua_pcall(struct lua_State *,int,int,int)" (?lua_pcall@@YAHPAUlua_State@@HHH@Z) referenced in function "public: void __thiscall RakNetNetwork::Update(void)" (?Update@RakNetNetwork@@QAEXXZ) 1>RakNetNetwork.obj : error LNK2019: unresolved external symbol "void __cdecl lua_pushlightuserdata(struct lua_State *,void *)" (?lua_pushlightuserdata@@YAXPAUlua_State@@PAX@Z) referenced in function "public: void __thiscall RakNetNetwork::Update(void)" (?Update@RakNetNetwork@@QAEXXZ) 1>RakNetNetwork.obj : error LNK2019: unresolved external symbol "void __cdecl lua_getfield(struct lua_State *,int,char const *)" (?lua_getfield@@YAXPAUlua_State@@HPBD@Z) referenced in function "public: void __thiscall RakNetNetwork::Update(void)" (?Update@RakNetNetwork@@QAEXXZ) 1>C:\Leadwerks\Projects\Duck\Projects\Windows\..\..\\Duck.debug.exe : fatal error LNK1120: 4 unresolved externals ws2_32.lib OpenGL32.lib Glu32.lib winmm.lib Psapi.lib These are the only libs you have in the project so the actual lua functions don't exist anywhere.
-
Under source/libraries I see LuaJIT & Lua 5.1.4. If I need to make Lua calls using Interpreter::L which library do I need to download the source for and include it in my project LuaJIT or Lua 5.1.4? If it's LuaJIT what version?
-
http://www.leadwerks.com/werkspace/files/file/216-tolua/ So I should make my code I want to be exposed just like normal (own header/source per class) and then copy/paste the header files all into this one file you mention? How would we create new objects in Lua? Do we need to follow the Class::Create()?
-
Do we have access to the Lua state in 3.0 from C++? If so how do we get it? Going to work on exposing RakNet so I can nework from Lua.
-
right click->new->script, leave it as the default name (by pressing cancel or OK with default name) right click->new->script [name it Test] I end up with no script named Test in the directory and have: New script.lua New script (1).lua I guess the logic of making the script and then renaming is probably leading to this strange behavior. I would think the less confusing method and more straight forward logic (to avoid such bugs like this) would be to not actually make the script until they give it a name and then to validate that name doesn't exist.
-
If I select New Script from the context menu, then hit cancel a new script is created anyway with the name New script.lua. The actual file creation should be when we press OK not when we select the context menu New Script. There is also something else screwed up in this area as I created a script and it showed up fine. Then I did this new script cancel and now one of my scripts don't show up anymore. Something in this area is just off.
-
I can't get the debug version of a lua app to hit any breakpoints. Anyone have this issue?
-
Those are header files not source files.
- 1 reply
-
- 1
-
[EDIT] Now with sound! I'm making a game that revolves 100% around old school final fantasy battle style fighting. I thought about what often slows me down and kills my motivation in games I've tried to make in the past. My conclusion was that dealing with graphics (models, UI, animations, etc) often slows me down in various ways. So as an experiment for this game I'm going to first code the entire core gameplay in a console application with a basic text based interface first. I'm hoping this will allow me to quickly tweak the battle system to both balance the game and make encounters fun and challenging. I'm also taking a very iterative approach to making this game. I wrote down the basic idea of the game and I'm leaving the details to be defined as I'm writing the code. I write the basic functionality in a crude way, then I go back and factor the hell out of that. Rinse and repeat until I get something I think it fun. I'm hoping that once I have the core gameplay done in this manner that transferring the code over to C++ and introducing graphics via LE won't be a ton of work. Below is a link to a very raw implementation of a battle. It's in .NET so as to be developed quicker since it has some built-in features like text color to help describe things more while in the console environment. The blogs have been pretty dead lately so thought I'd just share something https://dl.dropboxusercontent.com/u/1293842/RPG/RPG.rar
-
Yeah, I did a little debugging but because it's tied to key presses it's a pain to do normal breakpoints and step through because code runs when no key is pressed which stops it completely. I will need to print values out but I was lazy last night and just watched a movie instead I'll see what my motivation is like tonight. Thanks for the help.
-
I'm pretty sure Josh overloaded the multiply operator on Vec3 class otherwise I'm thinking this wouldn't even compile. I'm using C++.
-
_pivot->SetVelocity(_pivot->GetVelocity() * (0.9 * Time::GetSpeed())); This works but it's an instant stop which I find odd. I would think it would take longer to reduce it to zero.
-
I just want to see if I can get this working with physics now I'll check out setting velocity directly to slow it to zero when not pressing a key down. If not opposite force should basically do the same thing although I have a feeling I'll always get more sliding than I want when trying to stop :-/
-
Is there any air resistance available? Dampening as Flex put it? Seems like it could have some uses. I'm sure I could do it by applying opposite forces, but that's seems like a pain.
-
I guess I thought the friction settings would be applied no matter what but maybe I'm wrong.
-
Yeah, it seems I will have to do that. Although it would seem one should be able to get the physics to do this. I don't know why it slides for so long after not applying force to it.
-
What's the force you are adding to it? What's the mass it has? Also note that I'm not applying gravity so it's not moving against the ground, which might add extra friction?