Extension-lua-preprocessor: Small and simple Lua preprocessor

extension-lua-preprocessor

A small and simple Lua preprocessor for Defold. This extension hooks into the Lua builder plugin system in bob.

Requirements

Defold version 1.4.2 or higher

Installation

To use this library in your Defold project, add the needed version URL to your game.project dependencies from Releases

Example

-- Use one of the following keywords: RELEASE, DEBUG or HEADLESS
--#IF DEBUG
local lives_num = 999
--#ELSE 
local lives_num = 3
--#ENDIF

If you have any issues, questions or suggestions please create an issue

17 Likes

Interesting! Is it possible to create custom keywords? For example in order to bundle for GOG I currently must go to a script and add (uncomment) this:

gog = require "gog_galaxy.gog"

Would be nice if I could do this:

--#IF GOG
gog = require "gog_galaxy.gog"
--#ENDIF
2 Likes

If we can add defines to bob, then yes. Add a feature request.

1 Like

Awesome! Thank you!

Done, not really sure what I’m asking for so I’ve been pretty barebones!

We need a way to decide how and where to take such keywords. Maybe they should be specified in a special field in game.project, or maybe it should be checking for a field itself, like:

--#IF gog_platform.active
...
--#ENDIF

It should be avaliable from both Bob and Editor.

1 Like

Let’s keep those discussions in the ticket I think, to avoid duplicate comments :slight_smile:

3 Likes

I agree, I posted it there

1 Like