Windows Bundle exe is not loading collection script (Solved)

Solution: Block Comment formatting was incorrect, block comment must follow Brtizl’s example in comment 18-

--[[
foobar
--]]

Thank you to everyone for your help!


Edit: question title has been updated.
the collection is currently being loaded (at least sprites associated with it are being loaded), but the script that would load the initial main menu isn’t being hit. Still trying to figure out why.

Hello,

I’ve been working with Defold for a couple months now, and so far my local builds have been fine, this is what the screen loads to on a build, it has menu music:

I’m now at the point where I wanted to get the game play tested; to make a sharable exe I read that I needed to bundle it, and since it’s a desktop game, and I’m on a 64-bit windows machine, I set it up as such. I assume that, since this is meant to be a “released” version of the game, i would bundle it in release mode.
However, when I bundle into a windows release version:

I end up with a folder containing what I assume to be the correct files, and an exe

However when i run the exe, either normally or as an administrator, I get a black screen, no audio.

could it be that I’m missing an important step here?

Also I get no build errors, and the report reads:

I also run the DefOS extension/package, if that’s something that could be causing an issue.

Finally, I tried to bundle a tutorial project, and that works just fine, which leads me to believe it’s more of a code issue than a setup-steps issue.

Try to set debug mode instead of release and check the output

Changed *the version to Debug, all other settings the same, got this in the debug console window
does this mean it could be loading slowly?

Edit1:
Just had a thought:
My default collection when loading the game is this loading handler, and it’s loading all these collections, maybe it’s the settings for it that are causing the issue?

Edit2:
yep! I changed the Main collection and it loads fine now, of course the issue is that I can’t really use this, since it doesn’t allow me to load anything. I’ll look into the loading handler script and see if there’s a fix. I’ll update with the solution if i find one.

1 Like

Try to check the name of the collection. It should be different for everyone.
Usually it gives an error in this case, but may be this change will help


It was one of the first issues I ran into when I first started, but to be safe I checked through all the collections, they all have their own unique name, so no default conflicts there. I might just swap the Main Collection to each one and see if any don’t load.

Edit: each one loads fine on its own if it’s made the default collection, so I think it’s isolated down to the loading handler, it basically holds every collection in the program through those collection proxxies, maybe it’s overloaded?

As an idea: add print to all init functions and check if the collection is loaded or not.
Also add to on_message in loader script to check proxy_loaded message and add print to loader’s init function. Try to find which collections are loaded and which are not, including the main one

So I have one here:

and this is my init for the handler:
image

I threw in a few prints into the Init before each line, and also into the load function it calls, I also tossed one into the script itself:

nothing in the console; I swapped the main collection to the main menu and added a print there, just to make sure it would show up, and I got a print then, so I think the issue is the program isn’t hitting the loading handler at all.

What is the size of your biggest atlas in the project?

1 Like

Kalispera in project you have put the correct name of the main collection? also is there any problem with camera or any object that missing to render properly? Thanks

nothing past a few 1280x72 backgrounds, the total package is about 5 MB, the report says most of that is the music files I have for the menus

I tried following the path and it seems to link just fine. I think if it were a camera problem I’d still hear the music, as it stands it looks like the main collection just isn’t reaching the loading handler.
Edit: also strangely enough locally this still works and hits just fine, so I’m extra confused as to what could cause that to suddenly not load correctly.

Make a copy of the project, and begin deleting parts and bundling until it appears to work again. :slight_smile:

tried this, didn’t really get anywhere, it looks like it’s not even the case of the loading handler- I’m just having trouble getting Loading messages to pass in general.
I placed all the functionality into the main menu screen and while it would load locally, it wouldn’t load from the bundle exe.

is there some kind of nuance with bundles and load messages?

Just noticed this:

my local build with all the messages hits the prints before it gives the IP address info.

on the bundle, it bypasses those prints:

is there somewhere I can throw prints into that would run before the main collection? like a render script or something?

Edit: maybe the fact this “build/default” isn’t mentioned is the issue? like it could be doing something the project can’t do in a bundled format, so it’s missing that functionality?

okay so I did some extra checking, Here is what I found:
If i Add a physical component to the loading handler collection, I see it, what this means is that the collection IS getting hit (thank god), but it means the script isn’t loading. I’ll continue to update as I get closer to figuring it out.

Edit1: I think there’s something preventing the script from being loaded, is there a way to make sure that the script is loaded when the collection is loaded? or is it just expected to be done by default?

Edit 2: also looks like the other files and their inits aren’t happening, I don’t think that’s out of the ordinary though

Edit 3: the only difference between this collection and others is the collection proxxies it has, maybe there’s something there that’s causing an issue as well.

I can take a look if you wish to share the project with me (bjorn@defold.se).

Sent an email to you, same Username as here; I forgot to add a bundled version of the code, so to observe the issue it needs to be re-bundled using the setup I posted here.
thanks for your time!

1 Like

Ok, so the problem is related to parsing of multi-line comments. The LoadingHandler.script starts with something similar to this:

--[[
foobar
]]--

The above is perfectly acceptable for a Lua block comment (multi-line comment) but it confuses our parser for some reason. The recommended way to write block comments is:

--[[
foobar
--]]

Changing to this style makes your game run properly.

1 Like

Haha, yep that’s what it needed! It’s always the smallest things, thank you so much!

2 Likes