Page 1 of 1

How do you embed lua files?

Posted: Sat Jul 25, 2009 1:02 pm
by stefan
Hi.

Is it possible to embed lua files into the program so that if you send your file to someone, they only get the program and not all of the resources as separate files?

Thanks in advance.

Re: How do you embed lua files?

Posted: Sat Jul 25, 2009 2:16 pm
by Netwatcher
I can't tell if there is a way to do it BUT Prototype comes with a script.lua file and it is a retail game so I don't think you should worry about that much.

Re: How do you embed lua files?

Posted: Sat Jul 25, 2009 3:36 pm
by dandymcgee
I'm not sure if you can pack the actual .lua files, but I know you can interpret lua code at run-time by calling a function directly from your C++ code. I doubt that's any help to you though. :|

Re: How do you embed lua files?

Posted: Sat Jul 25, 2009 4:20 pm
by K-Bal
You can precompile lua files which makes them unreadable for the average user.

Re: How do you embed lua files?

Posted: Sun Jul 26, 2009 11:44 am
by Falco Girgis
Use luac to compile Lua code. This makes it unreadable to the user (as well as uneditable).

But it seems like you aren't worried about editing, you just don't want to have to worry about a bunch of files.

I believe you can do what you want with a resource editor, though.

Re: How do you embed lua files?

Posted: Sun Jul 26, 2009 4:00 pm
by stefan
GyroVorbis wrote:Use luac to compile Lua code. This makes it unreadable to the user (as well as uneditable).

But it seems like you aren't worried about editing, you just don't want to have to worry about a bunch of files.

I believe you can do what you want with a resource editor, though.
Thanks. :)