How do you embed lua files?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
stefan
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 2
Joined: Sat Jul 25, 2009 12:58 pm

How do you embed lua files?

Post 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.
User avatar
Netwatcher
Chaos Rift Junior
Chaos Rift Junior
Posts: 378
Joined: Sun Jun 07, 2009 2:49 am
Current Project: The Awesome Game (Actual title)
Favorite Gaming Platforms: Cabbage, Ground beef
Programming Language of Choice: C++
Location: Rehovot, Israel

Re: How do you embed lua files?

Post 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.
"Programmers are the Gods of their tiny worlds. They create something out of nothing. In their command-line universe, they say when it’s sunny and when it rains. And the tiny universe complies."
-Derek Powazek, http://powazek.com/posts/1655

blip.fm DJ profile - http://blip.fm/Noobay
current code project http://sourceforge.net/projects/vulcanengine/
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: How do you embed lua files?

Post 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. :|
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

Re: How do you embed lua files?

Post by K-Bal »

You can precompile lua files which makes them unreadable for the average user.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: How do you embed lua files?

Post 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.
stefan
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 2
Joined: Sat Jul 25, 2009 12:58 pm

Re: How do you embed lua files?

Post 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. :)
Post Reply