Message Addresses with Proxy Collections? (SOLVED)

I’m trying to get a msg to post to a gui script and because it’s through a collection proxy I’m fumbling with the exact address…

CardChoice1.collection is the collection
It has a game object called CardsProxy (I’m using monarch)
attached to this game object is CardChoices (same ID) which is the gui file
The guiscript for that GUI file is : CardsGui1.script

In my main collection I have a game object: cards
that connects to CardsProxy ID for the collection pointer to : CardChoice1.collection

I’m just not sure the right URL…

I have tried:
msg.post(“CardsProxy#CardChoices#CardChoices.gui”, “NewTurn”)

But it doesn’t work. I’ll keep trying some other possible routes but maybe someone can help me.

Thank!

and… I got it to work:

msg.post(“CardChoice1:/CardsProxy#CardChoices”, “NewTurn”)

I didn’t have to reference the script – I saw elsewhere on the boards you did… ¯_(ツ)_/¯


socket:/path#fragmet

in my case i have everything with the same name (bad example, sorry)

exit_confirmation:/exit_confirmation#exit_confirmation

2 Likes

A bit better example:


name_of_collection_as_socket:/name_of_go_as_path#component_id_as_fragment

4 Likes

nice! thanks. and in my case the fragment is the gui file itself and by default that ends up being processed by the attached gui script without having to specifically name the script.

GUI is a component. gui_script just a part of this component with logic in Lua.
Also, you can’t send messages to file on disk - files exist only in a file system. Messages work only with loaded into memory entities.
That means if you want to send something to the some_name.gui file, this file should be used as a component on some game object in one of your collections.

Full information about message passing is available in our manuals: https://defold.com/manuals/message-passing/

Also, we have a few videos about this topic:



2 Likes