Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-04-25 10:33:27



Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next
Lua and SetAvatarMinimapColor 
Author Message

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
Catten wrote:
Question though. Isn't that feature in the radar just as "expensive"?
The scroll list is only refreshed 4 times per second (this is adjustable from 1 to 10 in the "Options" tab of the radar), but it does take some time to render. This said, you can close the radar once you got the avatar(s) marked: just make sure it got the "Announce incoming avatars even when closed" box checked in the Options tab, so that even when its floater is closed the radar keeps working in the background.

Also, "expensive" via the radar for a (specific and occasional) purpose such as yours is better than expensive in the mini-map for everyone else not caring about such a feature.. Bloat is the enemy.

Catten wrote:
Another question. If I enable moderation and alert. It looks like it enable it globally for everyone in the radar and not the individual person, unlike the other features of the radar?
Lua is your friend and OnRadar() will allow you to distinguish important alerts with any mean of your choice (sound, notification tip, additional chat, etc): the 'marked' parameter could be used for such a purpose together with 'range'...

I might extend the Lua/radar interface in the future.


2020-07-05 18:22:30
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 362
Reply with quote
Yep, I'll just use the onradar event, it will work fine I'm sure.

Thank you again. Any help avoiding firestorm is a huge help haha


2020-07-05 19:29:07
Profile

Joined: 2011-09-17 11:12:19
Posts: 362
Reply with quote
If you are extending it in the future, having an option so it just does a lua callback but not a chat text would be nice. Then it would be possible to override the behavior to your liking as well as not showing double text if you want a custom text or only alert for certain people.


2020-07-05 21:11:05
Profile

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
Catten wrote:
If you are extending it in the future, having an option so it just does a lua callback but not a chat text would be nice. Then it would be possible to override the behavior to your liking as well as not showing double text if you want a custom text or only alert for certain people.
In fact, you are not forced to make the radar emit text by itself: OnRadar() is called for any incoming avatar, regardless of the text alert...


2020-07-05 21:26:18
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 362
Reply with quote
Yes. I just noticed, sorry about that.


2020-07-05 21:31:25
Profile

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
I was more thinking about adding a tracker triggering function, and a callback for marking actions i.e. on use of the "(Un)mark" button.


2020-07-05 21:34:20
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 362
Reply with quote
That could be very useful and would make sense in the current context.


2020-07-05 21:45:33
Profile

Joined: 2011-09-17 11:12:19
Posts: 362
Reply with quote
For anyone wanting the same atm, so far this function is more likely to color the "enemy" red than using the rezzed callback, since it colours them if they enter the sim and if they are within draw / chat distance and doesn't depend on where you look.

function OnRadar(avatar_id, name, range, marked)
local color = avatars_colors[avatar_id]
if color then
SetAvatarMinimapColor(avatar_id, color)
SetAvatarNameTagColor(avatar_id, color)
end
end


2020-07-05 22:01:11
Profile

Joined: 2009-03-17 18:42:51
Posts: 5550
Reply with quote
Catten wrote:
For anyone wanting the same atm, so far this function is more likely to color the "enemy" red than using the rezzed callback, since it colours them if they enter the sim and if they are within draw / chat distance and doesn't depend on where you look.

function OnRadar(avatar_id, name, range, marked)
local color = avatars_colors[avatar_id]
if color then
SetAvatarMinimapColor(avatar_id, color)
SetAvatarNameTagColor(avatar_id, color)
end
end

Nope... It won't work if the avatar is not within draw distance (i.e. when the avatar object is not yet created or got destroyed)... The name tag and mini-map colours are stored inside the LLVOAvatar object, so without it SetAvatarMinimapColor() and SetAvatarNameTagColor() return 'false' to denote a failure.

You are just making more Lua calls than with OnAvatarRezzing() for the exact, same result...


2020-07-05 23:03:38
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 362
Reply with quote
Ah ok, seems I was a bit too fast then.


2020-07-06 17:48:59
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 22 posts ]  Go to page Previous  1, 2, 3  Next

Who is online

Users browsing this forum: No registered users and 61 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:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.