Using llSitTarget to teleport based on group???
|
|
Eiji Mayo
Registered User
Join date: 5 Jun 2007
Posts: 79
|
06-12-2007 10:36
Sorry... I was wondering how to use a llSitTarget as a fake transport, based on a group you are in? I am playing the FF-vii RP and am making a device that lets you teleport, and am not sure how to go about it... I know that I have to get the group's key and whether the use is part of the group, but am not sure how( -_- ); Can some Pleeeeeeeeaaaaase help me out( ;_; )
Thank you, Eiji Mayo
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-12-2007 12:33
If you mean you want the teleporter to determine if the sitter is in the teleporter's group before teleporting, I think you're out of luck, cuz the first event the script will get is the changed() event from sitting, by which time the sitter is already teleported. I think you probably want one of the warpPos-based teleporters, where you'd test llSameGroup() in the changed() event (and perhaps other events, like touch_start() if you'll be giving them a menu of destinations). In any case, you won't need to get the group's key.
If you mean to dispatch avatars differently depending on group membership, you're really out of luck, cuz scripts can only tell if the avatar belongs to the same group as the script itself. For "differential dispatching" you need something other than SL groups... I think you'd be stuck with categorizing the avatars in notecards or some such hack.
|
|
Eiji Mayo
Registered User
Join date: 5 Jun 2007
Posts: 79
|
06-12-2007 13:49
No I mean like alot of the Teleporters that are only usable by group members... The way mine works is if you are in the group you put the bangle on and type '/1 drop crystal', and it drops it (that part works), and when you want to be fake teleported to that crystal you type '/1 teleport' and it sends you there... It needs to so that anyone in the group using a Bangle can use it.
I ran into another problem anywayXD It won't teleport me... lol... I tried testing with just me, but I think I still did something wrong(-_-) It will say "Teleporting now" but my Avi won't Teleport....
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-12-2007 14:35
Wait... is a "bangle" another name for the "tag" over your head when you change the active SL Group? or, by any lucky chance, something you actually wear? (Which sounds much like the old "Personal Teleporter" from the scripting library, /15/e2/57441/1.html ... which rezzes something you'd need to sit on to teleport.) If it TPs when you just *say* something, not when you *sit on* something... short of physical movement (and a nasty collision with the first thing encountered in the path), I can't see how it would work.
|
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
06-12-2007 15:50
My method is to have the sit teleporter in a "disabled" state with no sit target. When someone touches the object, I run a group check: if (llDetectedGroup(0)) state enabled; The enabled state sets the sit target to the correct coordinates and starts a short timer. Once the user TPs or the timer hits, the "disabled" state is reactivated, clearing the sit target. llDetectedGroup() - works in touch/collision events http://lslwiki.net/lslwiki/wakka.php?wakka=llDetectedGroupllSameGroup() - works in listens/anywhere else http://lslwiki.net/lslwiki/wakka.php?wakka=llSameGroup
|
|
Eiji Mayo
Registered User
Join date: 5 Jun 2007
Posts: 79
|
06-12-2007 17:31
(^_^) Thank you both. No, When I say "bangle" I mean a wrist attachment. Picture it as a bracelet with powerXD... Yes, sorry, I should have more dicriptive(^_^);... It is a listen item, there is not a single touch command with it. The process goes like this:
1) User puts on Shadow Bangle 2) User types '/1 drop crystal' to drop (rezzes a copy) crystal 3) User goes elsewhere (in the same SIM) 4) When user wants to teleport to the Crystal, user types '/1 teleport' 5) When user is done with the crystal user types '/1 destroy crystal' to delete it
What this does is by saying '/1 teleport' it relays a command to the crystal which then teleports the user to the crystal via llSitTarget (located in the crystal's script)
I'm just VERY stuck... Should I post the code???
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
06-12-2007 17:34
If you really want to use a SitTarget teleporter and have it only work for certain people or a certain group without them needing to click or chat a command first, the way to do it is when unathorized users sit on the thing have it rotate in such a way that the sit target ends up buried in the ground directly below the teleporter, unsit them, then rotate back.
edit: Eiji, you made your last post while I was typing mine, so I see now you're looking for something more specific and different from what I posted. Oops.
|
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
06-12-2007 19:07
From: Eiji Mayo What this does is by saying '/1 teleport' it relays a command to the crystal which then teleports the user to the crystal via llSitTarget (located in the crystal's script) You have to sit on something so that you use ll SitTarget, don't you?
_____________________
 Seagel Neville 
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-13-2007 02:46
From: Seagel Neville You have to sit on something so that you use llSitTarget, don't you? This is what has me so confused. Both llSitTarget() and the warpPos teleporters do non-physical movement of the avatar, so s/he can get past stuff without collisions... but an object becomes physical upon attachment, so I don't think it can be the "bangle" doing the teleporting... and the "crystal" is off somewhere else, presumably providing a target for the teleport, and not sat upon (unless... well, too much magic to contemplate). The easy way to do this would be for the "bangle" on command to rez the llSitTarget() teleporter with the location of the dropped "crystal" as its destination, but that would require the avatar to sit on that rezzed teleporter. Anti's suggestion about group-conditional rotation of the llSitTarget() prim is new to me, and clever. Actually, I think instead of rotating (which could have amusing consequences above ground-level), it could warpPos to exactly counter the llSitTarget() offset for non-group sitters. Of course, a warpPos teleporter can be group-conditional anyway, but at least for group members, this approach would use the less-laggy sit target for transport within the range of llSitTarget().
|
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
06-13-2007 04:04
The reasonable way will be the followings.
1) User puts on Shadow Bangle 2) User types '/1 drop crystal' to drop (rezzes a copy) crystal 3) User goes elsewhere (in the same SIM) 4) When user wants to teleport to the Crystal, user types '/1 teleport' 5) A teleport prim is rezzed. 6) The teleport prim communicates with the Crystal and gets its location. 7) User sit on the teleport prim and teleports to the Crystal. 5) When user is done with the crystal user types '/1 destroy crystal' to delete it
You can have the telport prim detect sitters' group.
_____________________
 Seagel Neville 
|
|
Galbraith Karami
Registered User
Join date: 12 Dec 2006
Posts: 25
|
06-13-2007 04:22
From: Seagel Neville You have to sit on something so that you use llSitTarget, don't you? Good point Seagel. I don't remember if one can use the sit command on an attachment... it would need some experimentation on the field. Seems unlikely though, trying to on, say, your backpack or your curly hair could lead to weird results...  moreover, scripts cannot get an avatar to sit, and this trick works only when he sits on something. So, until you change how the whole thing works, what the character have to do to teleport, I don't see a solution to this problem. Maybe rezzing some object under the butt of your char, so you can sit on it immediately after typing the command (or clicking the bangle, or whatever), and after it teleported him it deletes itself. About the group-only teleport... it wouldn't hurt to read the LSL wikis, to look for useful advice. Because for llSitTarget it reads "After defining a sit target, llAvatarOnSitTarget can be used." llAvatarOnSitTarget is a command that, if an avatar is sitting on that object, returns his/her key, that you can then pass to llSameGroup to know if the object the script is in and the avatar are set to the same group. (thus you must remember to set the sit object to your group, and activate yout group tag if you want to TP). A whole different solution would be to simply memorize the location you were in when you dropped the crystal inside a variable in the bangle script; when you type the command, it calls llMapDestination. Although it would bring up the world map, and use the REAL SL teleport.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-13-2007 04:32
From: Galbraith Karami Good point Seagel. I don't remember if one can use the sit command on an attachment... (you can't) From: Galbraith Karami About the group-only teleport... it wouldn't hurt to read the LSL wikis, to look for useful advice. Because for llSitTarget it reads "After defining a sit target, llAvatarOnSitTarget can be used." But by then it's too late: the llSitTarget() has already been applied--*but*, as Anti pointed out, you can still do evil stuff to the prim itself, effectively canceling out the sit target displacement for non-authorized users before you llUnsit() them. From: Galbraith Karami A whole different solution would be to simply memorize the location you were in when you dropped the crystal inside a variable in the bangle script; when you type the command, it calls llMapDestination. Although it would bring up the world map, and use the REAL SL teleport. Oh wow... if this was the intent of the original poster's "teleport" then we sure have been chasing our tails with embarrassing vigor!
|
|
Galbraith Karami
Registered User
Join date: 12 Dec 2006
Posts: 25
|
06-13-2007 07:20
From: Qie Niangao (you can't) (thought so)  From: someone But by then it's too late: the llSitTarget() has already been applied--*but*, as Anti pointed out, you can still do evil stuff to the prim itself, effectively canceling out the sit target displacement for non-authorized users before you llUnsit() them. uh-hu... or you can be even more evil. SitTarget is a _property of the prim_: so you can leave it to default, do your checks, then change it to the teleport location calling again llSitTarget() and then unsitting the avatar. But this has to be tried out, I don't know if it actually works and with the grid down I can't right now. From: someone Oh wow... if this was the intent of the original poster's "teleport" then we sure have been chasing our tails with embarrassing vigor! Hehe  I don't think it was the original intent, he wanted a SitTarget teleport, that is very fast and efficient... the downside is that you MUST sit your avatar on something. This other method can be set with any script event etc., but has the downside that is a true teleport, so it's subject to lag, teleport failure problems of the grid... and requires some user intervention anyway, since that command just makes the map pop up with a teleport destination already marked on, you still have to click on the "teleport" button. It's up to Eiji to weight pros and cons and decide what works better for him (or what he likes better.)
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-13-2007 10:46
From: Galbraith Karami [...] SitTarget is a _property of the prim_: so you can leave it to default, do your checks, then change it to the teleport location calling again llSitTarget() and then unsitting the avatar. But this has to be tried out, I don't know if it actually works and with the grid down I can't right now. Managed to get into the beta grid to try it, and llSitTarget() appears to apply to the next avatar to sit but not to one already seated. Hence conservation of evil is preserved. 
|
|
Galbraith Karami
Registered User
Join date: 12 Dec 2006
Posts: 25
|
06-14-2007 05:03
Dammit. I hoped it worked the other way. Well, conservation of evil if fundamental, if you believe in Yin-Yang  One problem I see is that sit teleport is really fast, so any trick you'd want to pull to send intruders somewhere else gets kinda in a race on who affects first: for instance, the SitTarget, or the SetRot ? Unless you rotate immediately after the sit, and before UnSitting, beating the avatar pushing "Stand Up"... In another thread /54/b2/189255/1.htmlother than discussing stuff similar to this, Osgeld Barmy suggests using a seat with warp-pos, and that would be a solution too. Now it's just up to Eiji to show up and decide what he likes best. 
|
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
06-14-2007 09:18
From: Galbraith Karami One problem I see is that sit teleport is really fast, so any trick you'd want to pull to send intruders somewhere else gets kinda in a race on who affects first: for instance, the SitTarget, or the SetRot ? Unless you rotate immediately after the sit, and before UnSitting, beating the avatar pushing "Stand Up"... But in this situation, one who rezzes the telport prim should be only its owner. Just being rezzed, it can detect the group tag, that is, before he/she sits. llSameGroup(llGetOwner()) And of course, it can be used by just the owner. Once he/she uses, it should be killed.
_____________________
 Seagel Neville 
|
|
Galbraith Karami
Registered User
Join date: 12 Dec 2006
Posts: 25
|
06-14-2007 10:44
you're right; why didn't I think of that? This way the only inconvenience would be to have to sit on the object, but with a bit of practice it will become automatic I bet.
|