Hello~ it’s me again. I thougt I understand messaging and adressing now. Turns out I’m wrong appearently it only makes sense in my head. So sorry for another post
My hero character is colliding with objects of the collision group „month“. Depending on the ID of the colliding Object I want the hero script to send a message to my gui.
Before I used for every month a own collision group and it worked fine (I know, I know not very efficent but it worked!). So I think the error must be in my hero script. I thought the identifier for the object to collide with was the „other_id“ and the ID it needs is the ID of the game object of the “months”.
Here the responsible part of my hero script
function on_message(self, message_id, message, sender)
(…)
elseif message_id == hash("collision_response") then
if message.group == hash("month") then
if other_id == hash("2feb") then
msg.post("/level/blubb#messages", "feb")
elseif other_id == hash("3mae") then
msg.post("/level/blubb#messages", "mae")
elseif other_id == hash("4ap") then
msg.post("/level/blubb#messages", "ap")
(...)
For the record: I’m not getting any ERROR messages from my console
Thanks al lot for helping me out!
elseif message.group == hash("month") then
print(messsage.other_id)
if message.other_id == hash("feb") then
msg.post("/level/blubb#messages", "feb")
and I don’t know what changed over dinner but now I’m getting the ERROR notice
ERROR:SCRIPT: /hero/hero.script:138: attempt to index global 'messsage' (a nil value)
stack traceback:
/hero/hero.script:138: in function </hero/hero.script:106>
Ok, have you tried the suggestion from @britzl ? Set a breakpoint at the first line in the function and stepping into it to see where the execution goes?