Determine id of sender in message? (SOLVED)

Hey everyone. I was wondering if anyone knows a simple way to determine the ID of a sender from a message. I have one object which sends a message to another where the sender data appears as such (from pprint: “url: [world:/instance334#go]”.) The other object prints this out. I am trying to compare it to an ID in a table which appears like “1 = hash: [/instance334]” To do so it appears I need to strip the #go script component from the path but I’m not sure the best way to do this. Any suggestions? Btw: thanks everyone for helping me to learn Defold! :slight_smile:

You can do sender.path to get an url’s path (The ID). (See https://defold.com/ref/stable/msg/#msg.url:urlstring)

3 Likes

Cool thanks, works perfectly. I thought one could only create a URL using those functions not call upon the properties from a created URL. That’s good to know :slight_smile:

1 Like