Mowri Panache Posted May 24, 2020 Share Posted May 24, 2020 Hello scripting gurus; I'm wondering if it's possible to make a script that limits an avatar to sitting on a specific item / prim / chair etc to once per set amount of time. Examples: - A prize chair that allows them to sit in it once a day only - A dance pole that only allows one 'shift' - A once a day teleporter etc Can anyone help with this idea or is it a pipe dream? Link to comment Share on other sites More sharing options...
Rolig Loon Posted May 24, 2020 Share Posted May 24, 2020 (edited) You can always limit any action simply by storing the name (or UUID) of a person in a list, along with the time when the action occurred. Then, when anyone tries that action, have your script check the list. If the person is already on the list and has a recorded a time that is too recent, reject them. ( In your case, you can decide what "reject" means -- unseat the person? set her on fire? make a loud, embarrassing noise? ) Then, of course, empty the list periodically ( or lop off any entries that are more than a day old ) to keep it from overflowing the script's memory. Edited May 24, 2020 by Rolig Loon 1 Link to comment Share on other sites More sharing options...
Mowri Panache Posted May 24, 2020 Author Share Posted May 24, 2020 Set them on fire. I love that idea haha! FLOOF! Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted May 25, 2020 Share Posted May 25, 2020 And if you absolutely don't want them to be able to sit without some kind of prior checking, you can also use PRIM_SCRIPTED_SIT_ONLY for llSetLinkPrimitiveParamsFast() and involve an experience that uses llSitOnLink() for scripted sitting only. 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted May 25, 2020 Share Posted May 25, 2020 That's an excellent idea, and it's what I would probably do myself if I were scripting in an Experience. I suspect, though, that the OP does not. It's probably simpler for him to write a script that allows the sit, does the security check, and then immediately does an llUnSit to toss the person off the seat. It's a bit more dramatic than simply denying the seat -- perhaps more dramatic than you'd like it to be -- but it's easier to script and just as effective. If you want to reduce the drama, of course, you could forget about unseating the person at all and merely deny the prize. 1 Link to comment Share on other sites More sharing options...
animats Posted May 25, 2020 Share Posted May 25, 2020 Yes, just go with llUnsit. An error message to the attempted sitter is nice, too. PRIM_SCRIPTED_SIT_ONLY is mostly for things you don't want sat on at all, or where someone might be able to sit on the wrong part. 1 Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted May 25, 2020 Share Posted May 25, 2020 (edited) 4 hours ago, Rolig Loon said: forget about unseating the person at all and merely deny the prize. You'd still need to use llUnSit() else you'd have either idiots or bots blockading your lucky seats. 2 hours ago, animats said: PRIM_SCRIPTED_SIT_ONLY is mostly for things you don't want sat on at all, or where someone might be able to sit on the wrong part. It's for whatever can be made useful with it. I use it with the furniture in my adult animesh application to keep people from using the sit targets to sit from any location in the region. I use it with my teleporters in my adult animesh application to "sit teleport" people to/over parcels that have teleport routing blocked. I use it to bypass parcel landing points in regions that have at least one parcel with public rezzing allowed. I use it with my NPV so I don't have to manually select it and choose to sit on it, risking me accidentally sitting on any nearby object covering based perms grabbers. I use it with my movelock as a backup(along with scripted teleporting) in case it is overpowered by re-energizing pushers or KFM orbiters. Granted, most of all that uses llSitOnLink(), but PRIM_SCRIPTED_SIT_ONLY is present. 😉 Edited May 25, 2020 by Lucia Nightfire 1 Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted May 25, 2020 Share Posted May 25, 2020 (edited) 1 hour ago, Lucia Nightfire said: I use it with my teleporters in my adult animesh application to "sit teleport" people to/over parcels that have teleport routing blocked. I use it to bypass parcel landing points in regions that have at least one parcel with public rezzing allowed. I use it with my NPV so I don't have to manually select it and choose to sit on it, risking me accidentally sitting on any nearby object covering based perms grabbers. I use it with my movelock as a backup(along with scripted teleporting) in case it is overpowered by re-energizing pushers or KFM orbiters. How does disabling manual sitting help with any of these? Edit: NPV? Edited May 25, 2020 by Wulfie Reanimator 1 Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted May 25, 2020 Share Posted May 25, 2020 (edited) 1 hour ago, Wulfie Reanimator said: How does disabling manual sitting help with any of these? Well, scripted sitting requires the presence of a sit target, and I don't want idiots or bots blockading it and/or delaying usage by sitting on stuff meant for only me or the intended user to sit on. Additionally, I mentioned the reason manually sitting on an NPV can be dangerous. If you've ever spent significant time in LL's weapons testing sandbox, you'll know why. Edited May 25, 2020 by Lucia Nightfire 1 Link to comment Share on other sites More sharing options...
Qie Niangao Posted May 25, 2020 Share Posted May 25, 2020 19 hours ago, Mowri Panache said: Examples: - A prize chair that allows them to sit in it once a day only - A dance pole that only allows one 'shift' - A once a day teleporter I suspect that the idea here is to control pre-existing scripted interactions that are triggered by sitting, rather than scripting the whole thing from scratch. Ignoring that, though, looking at this short list I'm reminded of how often in SL we use a "sit" interaction to trigger some wholly unrelated event -- nothing about conventional "sitting" at all -- because scripts get these handy artefacts of the avatar being on a scripted seat assembly. Teleporting, for example. We all know (variants of) how sit teleporters work. Anybody new to SL, though, must wonder why ever they should "sit" on a thing in order to be transported somewhere else. After a while we get so used to it that we worry that, instead, walk-thru (Experience) portals might "break immersion" -- as if being transported by sitting is somehow more intuitive. We can disguise the "sittingness" of the interaction with llSetSitText(), but still it involves an explicit right-click gesture, unless we've also llSetClickAction to _SIT, but that makes a mouse cursor with that universal symbol for left-click teleportation: a chair! I have no idea why a prize chair should be a chair. Somebody scripted one that way once, I guess. Maybe it give a hint of exclusion to others who'd want to claim the prize? because the sitter is occupying the space while the prize is distributed, and maybe a new random letter is chosen? From the prizewinner's point of view, though, the chair is just weird. Analogue of a throne for coronation? Dunno. The dance pole is the least artificial. The real reason, of course, is to lock the dance animation to the location of a static prop (the pole), and using "Dance!" as the sit text makes it a little better (although the chair -ClickAction mouse cursor is no more evocative of poledancing than of teleporting -- i.e., not even a little). So I guess I favor, whenever possible, adopting some more natural interaction, even if it needs to secretly trigger a scripted "sit" behind the scenes -- except when literally choosing a place to play a real sit animation. 2 Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted May 25, 2020 Share Posted May 25, 2020 5 hours ago, Wulfie Reanimator said: NPV NPV = Non-Physical Vehicle What people typcially in combat regions use to move around on while sitting. 1 1 Link to comment Share on other sites More sharing options...
Mowri Panache Posted May 25, 2020 Author Share Posted May 25, 2020 I love the conversation this started! :) Unfortunately as a new scripter, I'm still whacking my head against the desk trying to add this simple feature to a pre-existing [mod] item. I can't get in to the pre-existing script as it is non-mod itself, but I would think have a separate script in the item that checks when the last time an avatar used the item was, and denies them more than X number of uses per Y number of hours, would be easier than Im making it. I dont even have anything written other than on paper yet haha. Link to comment Share on other sites More sharing options...
Rolig Loon Posted May 25, 2020 Share Posted May 25, 2020 (edited) Aha! You didn't mention that you are trying to add functionality to an object that already has another script in it, and a non-mod script to boot. That's not going to be possible. You can certainly write a separate script to find out when a person last used the object, but you can't use that information to tell the original script whether it's OK to hand out a prize. You can't even count on unseating the person fast enough to beat the prize-giver script. The only solution that comes to mind (other than replacing the original script with your own simple prize-giver) is to use your own script to toggle the prize-giver between "running" and "non-running" after it figures out whether the person has touched it recently. That might work, but it's kind of clumsy and much harder than simply writing a new script. Edited May 25, 2020 by Rolig Loon typos, of course 1 Link to comment Share on other sites More sharing options...
Mowri Panache Posted May 25, 2020 Author Share Posted May 25, 2020 Balls. WEEEELP...anyone wanna make some lindens on a scripting project? lol (Seriously fire me an IM). Ill keep tinkering by making a new script from scratch or cannibalizing parts of open source scripts, mashing them together and hoping that works :P Link to comment Share on other sites More sharing options...
Mowri Panache Posted May 26, 2020 Author Share Posted May 26, 2020 (edited) . Edited May 26, 2020 by Mowri Panache Link to comment Share on other sites More sharing options...
Qie Niangao Posted May 27, 2020 Share Posted May 27, 2020 On 5/25/2020 at 11:20 AM, Rolig Loon said: Aha! You didn't mention that you are trying to add functionality to an object that already has another script in it, and a non-mod script to boot. That's not going to be possible. You can certainly write a separate script to find out when a person last used the object, but you can't use that information to tell the original script whether it's OK to hand out a prize. You can't even count on unseating the person fast enough to beat the prize-giver script. The only solution that comes to mind (other than replacing the original script with your own simple prize-giver) is to use your own script to toggle the prize-giver between "running" and "non-running" after it figures out whether the person has touched it recently. That might work, but it's kind of clumsy and much harder than simply writing a new script. Well.... Did we decide an Experience script is out of the question for this application? It probably is, but otherwise PRIM_SCRIPTED_SIT_ONLY could actually control sit access to those existing, no-mod scripts -- but only if it had experience permission from the approved sitter to be able to llSitOnLink. 1 Link to comment Share on other sites More sharing options...
Qie Niangao Posted May 27, 2020 Share Posted May 27, 2020 13 hours ago, Mowri Panache said: . Wait... wasn't there a whole bunch of code here? Maybe it had license restrictions or something, I just want to be sure my response didn't discourage or confuse things. I mean if there are pre-existing sit scripts that do what's desired and if these items can get Experience permissions from any avatar wanting to use them, then it would be pretty easy to add a little script to do that (and add a little logic that gates whether they should have access at the moment or if it's too soon since the last time). But if the scripts do not yet exist -- which I remember wondering when I skimmed the earlier post -- then it'll be much easier to just skip the whole Experience thing and build-in llUnSit() for avatars trying to use the item too soon. You were correct in that now-absent post: If you stick around here for help, we will try to convince you that learning LSL is both possible and fun -- which really isn't intended to be abusive, but YMMV. 😉 Link to comment Share on other sites More sharing options...
Mowri Panache Posted May 27, 2020 Author Share Posted May 27, 2020 There was, but I thought better of it. lol I have someone helping out in world now thank goodness. :) Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now