Page 1 of 1

Editing LOVE's source .lua files

Posted: Sun Sep 08, 2013 10:46 pm
by MinatureCookie
Hey everyone,

First of all, just wanted to say hello. Hello!

Secondly, I was hoping for a bit of help messing about with the LOVE framework.

tl;dr: What's up with boot.lua -> boot.lua.h?

Basically I've got everything all running fine, and I started trying to edit the boot.lua (src/scripts/boot.lua). Now, long story short, I finally worked out that boot.lua actually does nothing, and boot.lua.h is where it's all at - as a hex string representation of the boot.lua file

Now, I mean... I could set up a script to convert the boot.lua file into the boot.lua.h format no problem... But I'm guessing this is a standard approach to using Lua with C++, that I just know nothing about.

Also sorry if this isn't strictly the right place to be seeking help about this? I know this is primarily a forum for seeking support with using the framework, rather than building it!

Re: Editing LOVE's source .lua files

Posted: Sun Sep 08, 2013 10:48 pm
by Boolsheet
Yes, you have to convert it first. Edit boot.lua and then use auto.lua to generate the new boot.lua.h.

Go into the scripts directory and execute.

Code: Select all

lua auto.lua boot

Re: Editing LOVE's source .lua files

Posted: Mon Sep 09, 2013 10:06 am
by MinatureCookie
Ahh, I didn't spot auto.lua, thanks!

Is this method of lua binding a standard? I've noticed by trawling the web there's a few ways of doing this, such as luabind

Re: Editing LOVE's source .lua files

Posted: Mon Sep 09, 2013 2:26 pm
by Boolsheet
You mean the interface between LÖVE and Lua? Nothing special there, just straight up Lua C API calls. I don't think there's a standard for that, but there are a few projects out there that try to simplify it, as you noticed.

The embedding of the Lua files is just a simple and convenient way to have the data accessible at run-time.