Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-03-28 23:45:05



Reply to topic  [ 95 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 10  Next
Lua scripting related requests 
Author Message

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
ZaneZimer wrote:
I haven't isolated a pattern yet, but there might be something wrong with the new Lua pie menu functionality. First, when I stop the automation script the pie menu doesn't always revert to default. I was trying to use pie menu type 4, slice 1 to add a simple, clickable SendChat() greeting. Second, sometimes stopping or loading a new script causes the viewer to crash. I will try to provide more details as I learn them.

In OnLogin(), I have:
Code:
LuaPieMenuSlice(4, 1, "Howdy...", "AutomationMessage(\"avatar-say-howdy|\" .. GetPickedObjectID())")

I found the problem (in HBLuaPieMenu::removeAllSlices(): I forgot the indices and as a result it clears the vectors instead of emptying their string). It will be fixed in next release. In the mean time, avoid reloading a Lua automation script... Note that it won't crash the viewer under Linux (the vectors staying apparently allocated), and that's why I didn't notice the bug sooner...


2017-04-09 20:57:35
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
I found the problem (in HBLuaPieMenu::removeAllSlices(): I forgot the indices and as a result it clears the vectors instead of emptying their string).
Cool. Glad you were able to isolate it from my crude description of the problem. For now, I'll just comment out my pie menu initialization. I was really only tinkering with them to see how they worked. I was having a hard time coming up with a 'real' use case for pie menu functions anyway. :-)


2017-04-09 21:29:18
Profile

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
I was pondering a bit last night. Which occurs first, the LuaPieMenuSlice 'command' or the OnLuaPieMenu 'event'? Also, would it be beneficial to have the slice index passed in the 'data' coming to OnLuaPieMenu?


2017-04-10 13:31:18
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
ZaneZimer wrote:
I was pondering a bit last night. Which occurs first, the LuaPieMenuSlice 'command' or the OnLuaPieMenu 'event'?
The command line (when not "nop") is executed first, then the event (if any) is called.

Quote:
Also, would it be beneficial to have the slice index passed in the 'data' coming to OnLuaPieMenu?
That has already been added for next release (I thought about it as I was compiling v1.26.20.16 for release, so it was to late for it).


2017-04-10 14:36:05
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
The command line (when not "nop") is executed first, then the event (if any) is called.
I figured the order was consistent and assumed that they were executed in that order. Thanks for confirming.
Quote:
That has already been added for next release (I thought about it as I was compiling v1.26.20.16 for release, so it was to late for it).
Cool. I should have known that you would have thought of that.


2017-04-10 16:51:49
Profile

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
Should ApplySkySettings() return true for the pseudo-setting names: "region", "sunrise", "noon", "sunset" and "midnight"? Right now the function call does change the setting but returns false, implying it didn't locate the name.


2017-04-11 22:38:54
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
ZaneZimer wrote:
Should ApplySkySettings() return true for the pseudo-setting names: "region", "sunrise", "noon", "sunset" and "midnight"? Right now the function call does change the setting but returns false, implying it didn't locate the name.
Yes, it should... Fixed for next release.


2017-04-11 23:45:15
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
I have verified the ApplySkySettings() fix. Thanks for getting that in.

I'm running into something I can't seem to track down. CallbackAfter() doesn't fire many times. I have a simple function like:
Code:
if AgentSit() then
    CallbackAfter(30, AgentStand)
    OpenNotification(0, "Sitting on ground.")
else
    OpenNotification(0, "Unable to sit on ground.")
end
My avatar sits properly but then never stands. I use CallbackAfter() in another function to callback to itself and it works fine. If I reload (stop and load) the automation script, the code above starts working.

As a side, a reload menu option might be nice to stop and reload the automation script instead of popping the file picker dialog.


2017-04-17 16:13:26
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
ZaneZimer wrote:
I'm running into something I can't seem to track down. CallbackAfter() doesn't fire many times. I have a simple function like:
Code:
if AgentSit() then
    CallbackAfter(30, AgentStand)
    OpenNotification(0, "Sitting on ground.")
else
    OpenNotification(0, "Unable to sit on ground.")
end
My avatar sits properly but then never stands. I use CallbackAfter() in another function to callback to itself and it works fine. If I reload (stop and load) the automation script, the code above starts working.
It depends where you put that piece of code... If it's in not inside a callback, it's obvious it will not be executed aside from on viewer startup (or on script reload), while the agent is not yet initialized, which will result in a "nop"...


2017-04-17 16:59:23
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
It depends where you put that piece of code... If it's in not inside a callback, it's obvious it will not be executed aside from on viewer startup (or on script reload), while the agent is not yet initialized, which will result in a "nop"...
Right. The code is in the OnSendChat() callback. I'm keying off of '/sit' as a 'command' to execute that block.


2017-04-17 17:12:13
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 95 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 10  Next

Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.