Rick Posted December 10, 2009 Share Posted December 10, 2009 Do I send messages via the lua entity table or can I send messages directly to the LE model? When I loop through the main world entities I want to send a message to one and then receive it, but from what I see it looks like those messages are via the lua entity. Does the ReceiveMessage() function get fired if I send a message through the LE model? Quote Link to comment Share on other sites More sharing options...
TylerH Posted December 10, 2009 Share Posted December 10, 2009 It will get fired no matter where you sent the message from. SendEntityMessage in C/BMX, model:SendMessage() in Lua. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Rick Posted December 10, 2009 Author Share Posted December 10, 2009 Also SendEntityMessage() from lua I assume then? Quote Link to comment Share on other sites More sharing options...
TylerH Posted December 10, 2009 Share Posted December 10, 2009 You can use that as well. I just prefer the OO approach when possible Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Rick Posted December 10, 2009 Author Share Posted December 10, 2009 I do too, but with the multi-state lua, when I loop through the entities in the world, I think I'm getting the model and not the lua entity table, so I would need to use SendEntityMessage() to send a message with this. Quote Link to comment Share on other sites More sharing options...
TylerH Posted December 10, 2009 Share Posted December 10, 2009 SendMessage is a native BMX method exposed to Lua for TEntity types and derivatives. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Josh Posted December 10, 2009 Share Posted December 10, 2009 SendMessage will remain in place to make sure existing code is supported. However, I think in three months no one will ever use it. It's easier just to do what you want to do to the lua table. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted December 10, 2009 Author Share Posted December 10, 2009 I think SendMessage() can still serve a purpose. I'm thinking of using it to control animations. In my scripts, when I'm moving a character model, before I set the movement in action I would send a message to the character telling them to play the walk animation. Then when DoMoveTo() comes back I would stop the walk animation. Quote Link to comment Share on other sites More sharing options...
Niosop Posted December 10, 2009 Share Posted December 10, 2009 I think he's saying that it will now be easier to just call object:StartWalking() on the character than to go through an intermediate message sending system. Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Rick Posted December 10, 2009 Author Share Posted December 10, 2009 True. I guess it could be preference at that point. 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.