AGulev
January 16, 2023, 1:33pm
1
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
Done, not really sure what I’m asking for so I’ve been pretty barebones!
opened 01:44PM - 16 Jan 23 UTC
feature request
Related to this extension:
https://github.com/defold/extension-lua-preprocessor…
[One request](https://forum.defold.com/t/extension-lua-preprocessor-small-and-simple-lua-preprocessor/72449/2) was the ability to add custom keywords, e.g. like this:
```
--#IF GOG
gog = require "gog_galaxy.gog"
--#ENDIF
```
This can only be achieved if defines are added to bob.
AGulev
January 16, 2023, 1:47pm
6
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
3 Likes
AGulev
January 16, 2023, 1:50pm
8
I agree, I posted it there
1 Like