Address fail (SOLVED)

#1

My project basically recreates this example:

However when I tried send a message from the loaded level back to the loader I get:
ERROR:SCRIPT: /MC title/mc title.script:8: Could not send message ‘loadSWtitle’ from ‘mcTitle:/mc script#mc title’ to ‘main:/scenes#loader’.

The prime difference (in my project) is the name of the addressee script. In my project, main.collection contains a game object named “scenes” which points to a script file named “loader.script”. From what I can tell in the example, ‘main:/scenes#loader’ should be the correct address to send a message to that script instance. (please note that the example fails to provide the actual name of the script file in the ‘loader’ GO. The reader must figure out what the file name is based on the address string, which is less than helpful - I assume the file name is ‘script.script’ - this should be shown in the example)

Object hierarchy:
object%20hierarcy

0 Likes

#2

A quick and easy way to debug messaging problems is to print the full URL of a script. Put this in the init function of the loader.script:

print(msg.url())

Is the printed URL the one you sending the message to?

1 Like

#3

I think I found the problem. I had renamed a file, and somehow it changed the bootstrap collection in the game object. I was just ‘lucky’ that the game ran at all.

I’ll run through the code and verify that it works as intended. Thank you @britzl.

0 Likes