Category talk:LSL LinksetData

From Second Life Wiki
Jump to navigation Jump to search

Ok, so now (as of Oct 2022) we have two ways to address a key-value-pair datastore...

... one is for Experiences, the other for everything else.

Since the actual interface to each is so different, I wonder if it makes sense to keep both around? Wouldn't it be simpler to keep the Linkset Data functions (they have a nicer API, IMHO), as well as its own event (instead of the 'slow' dataserver event)? Scripts are already assignable to Experiences, so I guess this would allow all Experiences to 'share' the same KVP, using a common interface (instead of duplicating code).

The purpose would be having the exact same script relying on persistent storage that could work either assigned to an experience or as a stand-alone. Consider a simple snowball launcher script, which counts the number of snowballs that have hit a target (an avatar) and shows the total on hovertext (granted, this would not require, strictly speaking, any KVP storage and still be persistent, but it's just an example). You can use it to play with friends, and the counters hovering over each launcher would display the correct number of targets hit, so that you can 'prove' that you 'won' the ad-hoc game. But if you participate on the annual Linden Snowball Throwing Winter Event, and accept to participate in an Experience, then your snowball launcher would register the count globally on the Experience's own KVP storage instead — possibly to show a leaderboard and award a prize to the avatar that hit more Lindens during the event :)

I'm quite aware that this is a quite forced example, which could be done quite differently and still work, but my point is that you could have certain 'Experience-aware' items that would work outside the Experience as well, without the need of duplicating all the KVP storage code.

This would even allow for a simple way of reusing the same item across different Experiences (obviously assuming these would be 'compatible', of course) and still maintain data persistent — without needing to use HTTP requests to an off-world KVP. This would allow for, say, different hosts to create their own (independent) Experiences, but allow certain items across Experiences — think about role-playing games designed by different people, but where you can acquire a sword on one, acquire XPs or Skill points or whatever, then go to a similar RPG but hosted by someone else, and reuse your battle-tested sword (as well as your XPs!) on that Experience instead.

Again, you can do all the above by using an off-world server and a previously defined API, but how cool would it to do it without any off-world storage at all? :-)

Just my L$0.02...

Gwyneth Llewelyn (talk) 04:23, 20 October 2022 (PDT)