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 9 of 10 |
Author: | Henri Beauchamp [ 2018-07-26 13:52:03 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
Alas, most control flags are ephemeral (reset on agent update after they have been sent to the sim server) and AGENT_CONTROL_SIT_ON_GROUND is one such flag. I added a specific flag for next release, and the corresponding "sitting_on_ground" key/boolean pair in the table returned by GetAgentInfo(). |
Author: | ZaneZimer [ 2018-07-26 16:06:53 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
|
Author: | ErikaThorkveld [ 2019-05-22 12:25:12 ] |
Post subject: | Re: Lua scripting related requests |
I was looking into Lua scripting to see if I could do something I've always wanted: give a specific color to the avatar tag and/or the minimap dot to people for whom I've entered something into the 'My notes' tab in their profile, and/or to people I've already talked to. Changing name tags or minimap dot colors for a given avatar seems to be quite easy, thanks to the Lua script example provided in the Lua reference post. But I can't find a way to figure out the conditions, i.e something is present in the av's 'My notes' tab, or there's something recorded for the av in the IM history. I saw that Lua can be called from LSL, but I can't find anything about these conditions in LSL either. And anyway, it feels to me that I would then need a call the other way: since changing the colors would be done via the OnAvatarRezzing Lua callback, it looks like I would need to call some LSL from there rather than the other way round. Did I miss something? Is there any way to do what I want to do or is it hopeless? |
Author: | Henri Beauchamp [ 2019-05-22 13:43:34 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
Not sure what you mean by "condition" neither what you try to achieve... In the example script I gave, you simply set the avatar name tag/dot color via the Lua pie menu for that avatar (popped up with SHIFT + right click on the avatar). You could also auto-color the the avatars in your friends list via the OnAvatarRezzing() callback function and the IsAgentFriend() function, for example. If you wish to make those color settings permanent as well (so that they are remembered over sessions), you can by using the GetPerAccountData() and SetPerAccountData() (or GetGlobalData() and SetGlobalData()) functions, for example. There is no need for LSL scripts... even though you could as well use one to interact with Lua (via the AutomationMessage() function and OnAutomationMessage() callback, for the LSL to Lua communication and via SendChat() for the Lua to LSL communication). There is however no way to recover the contents of the avatar profile "My notes" tab from either Lua or LSL. This info in only retrieved when you open the corresponding tab in the Profile floater for an avatar. |
Author: | ErikaThorkveld [ 2019-05-23 11:22:02 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
Mmm, rereading my question, no wonder why it was difficult to understand. That'll teach me to ask something when I'm not sure about what I actually want to do. ![]() Anyway, you answered half of the question:
That was one of the things I wanted to do: read the "My notes" tab in someone's profile and if there's something in it, give them a specific color on the minimap. So it seems I can't do that. I also wanted to give another specific color to people I've already talked to, which would - I guess - require to read my IM logs. So that would have to be on client side, since the server knows nothing about my logs. And since I haven't seen anything allowing to read IM logs in Lua, I guess it's dead too. Well, OK, that was a silly idea. ![]() |
Author: | Henri Beauchamp [ 2019-05-23 17:11:30 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
On the other hand, you could achieve a similar result with the existing functions (and for all future IM conversations) with the OnInstantMsg() callback, registering the UUID of the avatar IMing you into a Lua table of the automation.lua script, and saving that table with the SetPerAccountData() (or SetGlobalData()) function and restoring it on login with GetPerAccountData() or (GetGlobalData()). Then you could color the name tags and dots accordingly to what is in that table... As for the notes, you could achieve the same result (classifying avatars following your own criteria) with the provided Lua pie coloring example (perhaps replacing the color names in the pie menu with meaningful adjectives for your classification: e.g. "Friendly", "Interested", "Indifferent", "Aggressive")... And of course also saving the resulting table and restoring it at each session. |
Author: | ErikaThorkveld [ 2019-05-28 06:53:25 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
And that works very nicely, thanks for the solution! ![]() |
Author: | Henri Beauchamp [ 2019-05-28 07:37:02 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
|
Author: | Catten [ 2020-07-31 19:22:03 ] |
Post subject: | Re: Lua scripting related requests |
Will it be possible to get a lua command to enable and disable the avatar hitboxes? Edit: In theory a lua command that would let you edit the debug settings on the fly would be rather cool. |
Author: | Henri Beauchamp [ 2020-07-31 19:33:50 ] | |||||||||
Post subject: | Re: Lua scripting related requests | |||||||||
This is already possible... Just white-list the "RenderDebugHitBox" debug setting and use the SetDebugSeting() Lua command... Please, see the existing documentation. |
Page 9 of 10 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |