DarthRaff Posted January 9, 2013 Share Posted January 9, 2013 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 Quote Link to comment Share on other sites More sharing options...
macklebee Posted January 9, 2013 Share Posted January 9, 2013 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 Quote 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 More sharing options...
DarthRaff Posted January 9, 2013 Author Share Posted January 9, 2013 Thank you very much Macklebee, it's working at last Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 12, 2013 Share Posted January 12, 2013 try this one: Quote Link to comment Share on other sites More sharing options...
DigitalHax Posted January 12, 2013 Share Posted January 12, 2013 There is a receive message being used in the switch object seen in the tunnels demo map. That's how I learnt to use it. Quote Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5. Life is too short to remove USB safely. Link to comment Share on other sites More sharing options...
DarthRaff Posted January 12, 2013 Author Share Posted January 12, 2013 Ok, thank you very much Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.