Cool VL Viewer forum
http://sldev.free.fr/forum/

Lua scripting related requests
http://sldev.free.fr/forum/viewtopic.php?f=9&t=1737
Page 8 of 10

Author:  ZaneZimer [ 2017-06-11 13:14:42 ]
Post subject:  Re: Lua scripting related requests

I was mostly curious. I could/can deal with the form as it is. It was just a combination I hadn't expected.

Author:  Henri Beauchamp [ 2017-06-11 13:59:16 ]
Post subject:  Re: Lua scripting related requests

ZaneZimer wrote:
I was mostly curious. I could/can deal with the form as it is. It was just a combination I hadn't expected.

Just a matter of convention... I had to adopt one, which is indeed totally arbitrary. :D

Author:  ZaneZimer [ 2017-07-23 18:17:19 ]
Post subject:  Re: Lua scripting related requests

I have found that the chat type returned in OnReceivedChat() can contain CHAT_TYPE_DIRECT = 9. This seems to come from prims/objects with llInstantMessage() used within them. The id then seems to be the owner of the prim/object and name is the name of the prim/object. The documentation listed at: Lua scripting and viewer automation feature seems to indicate otherwise. I found that chats using llInstantMessage() weren't being processed by my Lua script because I wasn't handling type '9'.

Author:  Henri Beauchamp [ 2017-07-23 21:55:28 ]
Post subject:  Re: Lua scripting related requests

ZaneZimer wrote:
I have found that the chat type returned in OnReceivedChat() can contain CHAT_TYPE_DIRECT = 9. This seems to come from prims/objects with llInstantMessage() used within them. The id then seems to be the owner of the prim/object and name is the name of the prim/object. The documentation listed at: Lua scripting and viewer automation feature seems to indicate otherwise. I found that chats using llInstantMessage() weren't being processed by my Lua script because I wasn't handling type '9'.

Well, like I wrote in the documentation:
Quote:
OnReceivedChat(type, from_id, is_avatar, name, text) is called each time the viewer receives a chat line. 'type' is a positive number (corresponding to the e_chat_type enum in indra/newview/llchat.h)

So, to get the full list (beside the main examples I gave), you'll have to look into that source file... The same thing goes for all the functions where I give a source file pointer in the Lua doc...

Author:  ZaneZimer [ 2017-07-23 22:18:34 ]
Post subject:  Re: Lua scripting related requests

I do use the header files and I even copy the names and values to comments in my automation script for quick reference. I am only referencing
Quote:
1 for normal avatar chat or scripted objects llInstantMessage()
where llInstantMessage() is described as being 1 for normal chat. I believe the callback behavior is correct and am perfectly happy with it. :-)

Author:  Henri Beauchamp [ 2017-07-29 08:05:15 ]
Post subject:  Re: Lua scripting related requests

ZaneZimer wrote:
I do use the header files and I even copy the names and values to comments in my automation script for quick reference. I am only referencing
Quote:
1 for normal avatar chat or scripted objects llInstantMessage()
where llInstantMessage() is described as being 1 for normal chat. I believe the callback behavior is correct and am perfectly happy with it. :-)

Documentation updated/fixed.

Author:  ZaneZimer [ 2017-07-31 04:24:26 ]
Post subject:  Re: Lua scripting related requests

Henri Beauchamp wrote:
Documentation updated/fixed.
Thanks Henri.

I was looking at the Lua Pie Menu functions that you have made available. I have read the documentation and I don't believe it is possible to do 'nested' menu items (like the native browser pie support), correct?

Author:  Henri Beauchamp [ 2017-07-31 07:52:39 ]
Post subject:  Re: Lua scripting related requests

ZaneZimer wrote:
I was looking at the Lua Pie Menu functions that you have made available. I have read the documentation and I don't believe it is possible to do 'nested' menu items (like the native browser pie support), correct?
If by "nested", you mean sub-menu pies, then yes, you are correct. One possibility to obtain something in that vein, would be for you to simply dedicate a pie slice to a "pie toggle" item, that would change the Lua pie; but you'd have to re-pick (SHIFT+right click) on the object a second time to get the redefined pie to appear.

Author:  ZaneZimer [ 2017-07-31 13:03:55 ]
Post subject:  Re: Lua scripting related requests

Henri Beauchamp wrote:
If by "nested", you mean sub-menu pies, then yes, you are correct. One possibility to obtain something in that vein, would be for you to simply dedicate a pie slice to a "pie toggle" item, that would change the Lua pie; but you'd have to re-pick (SHIFT+right click) on the object a second time to get the redefined pie to appear.
I had also thought of your suggestion or using the slice to open a dialog detailing a list of options, selected by a numerical index. I'm just pondering ideas. I have no real need for such a structure yet.

Author:  ZaneZimer [ 2018-07-08 18:27:19 ]
Post subject:  Re: Lua scripting related requests

GetAgentInfo() and control_flags:

I've been trying to determine if there is a way to distinguish between sitting on an object vs sitting on the ground. I know GetAgentInfo() provides the `sitting` Boolean, but it is for any type of sit. I thought perhaps the control_flags could indicate this distinction, since indra/llcommon/llagentconstants.h contains AGENT_CONTROL_SIT_ON_GROUND. I'm likely misinterpreting what that flag is used for and/or means, as I have only found it in use at line 5457 in indra/newview/llviewermenu.cpp. A little tracing makes it seem like that flag means that I think it does, but I didn't go too far. I have also tried the various ways to sit on the ground, including the AgentSit() method but the control_flags remain 0 while sitting. I have used AGENT_CONTROL_AWAY from control_flags successfully, however, so I know some of the flags are as I expect them. Cheers and thanks for reading.

Page 8 of 10 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/