Jump to content

Messages


DarthRaff
 Share

Recommended Posts

Hello,

 

I can't find any example of an object receiving a message of "use" ( sent by the player, i suppose ), and how it works. I found how to send a message when a key is pressed but not how to receive it, can someone, please, help me with that ? I'm very confused with that, thank you

Link to comment
Share on other sites

look at the template.lua file located in the scripts folder as it gives the general layout for the 'object:ReceiveMessage(message,extra)' function as well as all the standard LE lua object functions, but essentially its just:

function object:ReceiveMessage(message,extra)
  if message="use" then
     --'do something here'
  else
     self.super:ReceiveMessage(message,extra)
  end
end

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...