Error loading collections

You probably included the build and .internal folders which take up a lot of space. It should be fine if you exclude those from the zip file.

1 Like

how do i not include them, my files are a huge mess

j.zip (740.8 KB)
try this

1 Like

Yep thatā€™s the right one. Iā€™ve got your project running but there doesnā€™t seem to be any errors? Playing the game, winning and losing all work just fine.

2 Likes

have you waited just until the health goes to zero, or after? the strikes are a bit messed up so u have to wait a long time until the lose screen tries to load and then the error I posted earlier shows up.

basically the aliens have to reach the bottom like 20 times after the health is at 0, for some reason - its a problem for a later date

@jess: This is what I did:

I opened loader.script and in the beginning of on_message() I added a print() of the message_id and sender like this:

function on_message(self, message_id, message, sender)
	print(message_id, sender)
	if message_id == hash("start") then

Next, I played the game (I hacked speed in enemy_spawner.script so that aliens moved faster) and after a while I saw the error you mentioned, but I also saw this in the console:

DEBUG:SCRIPT: hash: [lose_ending]	url: [main:/healthbar#healthbar_script]
DEBUG:SCRIPT: lose ending load
DEBUG:SCRIPT: hash: [lose_ending]	url: [main:/healthbar#healthbar_script]
DEBUG:SCRIPT: lose ending load
DEBUG:SCRIPT: hash: [lose_ending]	url: [main:/healthbar#healthbar_script]
DEBUG:SCRIPT: lose ending load

The lose_ending message is sent 3 times, not 1!

And all three times it is sent from the healthbar_script.script. @AGulev mentioned this in a reply eariler (Error loading collections - #6 by AGulev). It looks like you did you not fix that?

I would set a flag in healthbar_script.script to ensure that the message is sent only once. Like this:

	elseif self.strike > 49 and not self.game_over then
		self.game_over = true
		msg.post("loader:/loader_go#loader", "lose_ending")
	end
3 Likes

im really sorry, how would i set the flag?

self.game_over is the flag in britzlā€™s example.

Ive done that, and got the debug message of lose ending load but a black screen, and no error message. going to check loader etc

ive set print statements after every line in the loader script to see if theyre being carried out, theres no error message now and in the debugger after every line the print message is there. But a black screen comes up and the lose ending collection isnt spawning

It works now!!! the most stupid mistake. hadnā€™t added the game object to the lose ending collection with the gui.