Jump to content

pak files


Rick
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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. :lol:

 

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.

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

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 :lol: 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?

Link to comment
Share on other sites

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 :(

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

That was to Josh.

 

The command to look at is lua_dobuffer

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

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 :lol:

 

Sounds interesting. Worth an entry in Feature Requests.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...