Rick Posted December 30, 2009 Share Posted December 30, 2009 Are we supposed to be able to have our objects in pak files and still work with the editor? I have an object that works fine when not in a pak file and then when I zip it and rename the extension to .pak it doesn't work. It shows up in the editor, but when I place it nothing seems to happen like it should. If this could work it would be a nice convenient way to distribute objects for the editor. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 30, 2009 Share Posted December 30, 2009 hmmm doesn't appear to work now outside of the editor either... and I know I have zipped up my models into a pak before and the program would load them... 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...
Josh Posted December 31, 2009 Share Posted December 31, 2009 when I place it nothing seems to happen like it should What doesn't happen like it should? Your coffee maker starts squirting gravy? The purple cats outside your window fly upside-down? Be specific. If you mean that your script has no effect, Lua can't run a file from a .pak file, since that is our convention, and Lua doesn't know what it is. I think the best solution is probably to have the engine search for any script by the right name, if one is not found in the same folder as the model. There are reasons for doing the file directly instead of loading the string and passing that to Lua. Only the lua_dofile() command can run a compiled Lua script. It also make debugging easier, because Lua knows what file it is running, and can pass that information back in any error messages that occur. 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...
macklebee Posted December 31, 2009 Share Posted December 31, 2009 What doesn't happen like it should? Your coffee maker starts squirting gravy? The purple cats outside your window fly upside-down? Be specific. answered my question with your edited comment. 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...
Rick Posted December 31, 2009 Author Share Posted December 31, 2009 What doesn't happen like it should? Your coffee maker starts squirting gravy? The purple cats outside your window fly upside-down? Be specific. If you mean that your script has no effect, Lua can't run a file from a .pak file, since that is our convention, and Lua doesn't know what it is. I think the best solution is probably to have the engine search for any script by the right name, if one is not found in the same folder as the model. There are reasons for doing the file directly instead of loading the string and passing that to Lua. Only the lua_dofile() command can run a compiled Lua script. It also make debugging easier, because Lua knows what file it is running, and can pass that information back in any error messages that occur. First off, your imagine is clearly working to come up with coffee squiring gravy and purple cats Yeah, the script doesn't run and I also don't get the _icon.dds file displayed like I do when it's not in the pak file. Second, it sounds like your second part is you thinking out loud on how to fix this? Quote Link to comment Share on other sites More sharing options...
TylerH Posted December 31, 2009 Share Posted December 31, 2009 Internally, if you load the contents of the file using the Leadwerks file system into a stream, you should be able to run the stream via the lua_doblock or some similar method. Google the net for ways of "running lua scripts from memory" or "running lua scripts from a stream" or something of that thing. That means you can then use your abstract::, cache::, zip::, http:: protocols Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Rick Posted December 31, 2009 Author Share Posted December 31, 2009 I'm confused? Are you telling me to do this or Josh? My impression is that this should work at an LE level and not something we should have to deal with. Quote Link to comment Share on other sites More sharing options...
TylerH Posted December 31, 2009 Share Posted December 31, 2009 That was to Josh. The command to look at is lua_dobuffer Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
L B Posted December 31, 2009 Share Posted December 31, 2009 Internally, if you load the contents of the file using the Leadwerks file system into a stream, you should be able to run the stream via the lua_doblock or some similar method. Google the net for ways of "running lua scripts from memory" or "running lua scripts from a stream" or something of that thing. That means you can then use your abstract::, cache::, zip::, http:: protocols Sounds interesting. Worth an entry in Feature Requests. Quote 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.