So I have just updated to 1.2.158 and tried bundling again.
Thanks to your tip, @Mathias_Westerdahl, it’s easier for me to capture the output by opening the game using the console. This is what I get:
E:\Fates of Ort builds\20190709 Win 64 v4\x86_64-win32\Fates of Ort>FatesofOrt.exe
INFO:DLIB: Log server started on port 58911
INFO:ENGINE: Engine service started on port 8001
INFO:ENGINE: Defold Engine 1.2.158 (3d63d05)
INFO:ENGINE: Loading data from: dmanif:./game.dmanifest
INFO:ENGINE: Initialised sound device 'default'
ERROR:SCRIPT: maps/map_dictionary.lua:11: module 'maps.map_codes.h_potion_hut' not found:
no file 'maps.map_codes.h_potion_hut'
stack traceback:
[C]: in function 'require'
maps/map_dictionary.lua:11: in main chunk
[C]: in function 'require'
game controller/game_controller.script:9: in main chunk
WARNING:RESOURCE: Unable to create resource: /game controller/game_controller.scriptc
WARNING:RESOURCE: Unable to create resource: /game controller/game_controller.goc
ERROR:GAMEOBJECT: Could not instantiate game object from prototype /game controller/game_controller.goc.
WARNING:RESOURCE: Unable to create resource: /main/main.collectionc
I export .lua files from Tiled and put them in the resource tree:
Data about each map is stored in a table. Each line includes a require which I use to access the data in the .lua file:
M.map_info[hash("h_potion_hut")] = {script_require = require "maps.map_codes.h_potion_hut", [other vars trimmed for readability]}
Map data is then loaded like this in a map spawner file:
local map_dictionary = require "maps.map_dictionary"
map_info = map_dictionary.map_info[hash("h_potion_hut")].script_require
Given the above setup, are we saying that I have misunderstood how requiring files works? I am trying to understand what @britzl said in his last post but I am a bit confused. I think the gist of it is that the way I have set things up means that my .lua map files aren’t being included in the bundle and that I need to write some kind of custom function (like @britzl provided) to trigger the bundling in the way I am intending it.
I’ve read the resource manual and the require reference but I am still unsure about some things, e.g. the difference between “Custom Resources” and “Bundle Resources” and why my map data won’t load when it seems my other .lua modules work fine. I’m happy to mess around with the suggestions @britzl provided but would love to understand what I’m doing a bit better.
Thanks for the help!