My other question is if there's a way to detect if the owner of an object is away. I can just tell my object I'm not there but I'd rather it detect my awayness

These forums are CLOSED. Please visit the new forums HERE
A way to self-right a physical object? oh, and away detection |
|
|
Taun Patel
Geothermal Madman
Join date: 5 Mar 2004
Posts: 222
|
02-02-2005 15:58
I'm working on a little pet project and it's a follower. While I know I could use the lock on STATUS_ROTATE_X | STATUS_ROTATE_Y as FALSE to keep it from flipping over in the first place, I want to allow a variance of about 15-20 degrees up or down on the x and y axis angles to keep it from flipping over. In the event of a flip, is there a way to self-right it?
My other question is if there's a way to detect if the owner of an object is away. I can just tell my object I'm not there but I'd rather it detect my awayness ![]() |
|
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
|
02-02-2005 17:14
The second question is easier: your "pet" can llSensorRepeat("", llGetOwner(), AGENT, 15. PI. 10) where 15 is the range in meters that it will look for you and the ten means to scan every 10 seconds. When the no_sensor() event is triggered, that tells the pet you've left its 15m sphere. The pet can do any number of things upon losing you: llDie() is the simplest, but a little cruel; it could look a little farther - with another llSensor - and try to catch up with you. I've seen some active objects that IM you with their location when "lost".
As far as the movement, I blew the better part of a day trying to make a boat rock from side to side as you describe. I failed. The path that I'd go down now would be to make the pet physical but very bottom heavy. Different materials "plastic", "metal" etc. have different densities and a hollow prim is much lighter than an identical non-hollow prim. The function llGetCenterOfGravity() will return the center of gravity of the pet and you can rez a marker at that location to see where the CoG is. Another approach would be to turn it into a vehicle which do have stabilizations, but I don't think they can move autonomously. Also vehicles are even more confusing than rotations and torques. I hope that gets you in the right direction at least. |
|
Taun Patel
Geothermal Madman
Join date: 5 Mar 2004
Posts: 222
|
02-02-2005 17:33
Oh I'm sorry, I wasn't clear on the 2nd part of the question... I want him to be able to detect my "away" status and if I'm away, tell people that and offer them some options (like record a message for me, remember that they wanted my attention ... something like that. I couldn't find a call in any of the agent functions for away status detection.
The llDie'ing or IMing me his position is a good idea, since he could get lost easily. I have him scanning 30 meters right now, to account for lag or flying speeds. |
|
Brian Mifflin
Scripting Addict
Join date: 15 Dec 2004
Posts: 182
|
02-02-2005 17:33
That was my thought, maybe put a heavy invisible keel of sorts on the bottom of it, but in game we already talked about prim count. :-/
|
|
Driftwood Nomad
Registered User
Join date: 10 May 2003
Posts: 451
|
02-02-2005 17:41
Speaking from experience: If you add an IM function when they get "lost", make sure you cap the maximum number of IMs. Our dogs used to IM constantly until found, and that resulted in people that were offline getting hundreds of emails from their lost pooch!
![]() _____________________
Driftwood Nomad
D&D Dogs Co-founder "Second Life’s first AI companion animal" The Second Opinion, 08/05/2003 D&D Dogs HQ Pawaii (127, 63) Mainland Store Kuula (214, 124) http://www.sldogs.com SL Dogs Zazzle store! ![]() |
|
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
|
02-02-2005 18:08
Re the Away detection. There aren't any functions to detect away status, although maybe that's a feature you could suggest. A few ideas:
* Have your follower listen to everything you say, and reset a timer after every listen() event, that way if you don't say anything for a while and the timer goes off it can assume that you are away. and once you speak again it will know that you are back. if it's following you, you could use a similar idea to set you to away using the sensor event if you don't move after a set amount of time, or both of these together might work better. If you want an example script let me know. As for the rotation, have you looked at llRotTarget(), and it's related events? I haven't used them, so can't help but they may be able to do what you are after. |
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
02-02-2005 18:35
Actually, I believe there are attachment (macros?) that can be written as a form of away status detector. I forget how exactly it's done, but I have seen these in action.
Another way to do it is with a 120-second timer. If your position stays constant two consecutive timer events, trigger away mode on pet. And yes, I believe you're looking for llRotLookAt and llLookAt for the first question. Try here: http://secondlife.com/badgeo/wakka.php?wakka=Dynamics _____________________
---
|
|
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
|
02-02-2005 19:48
llRequestAgentData(...) is the call you are looking for to find on/off-line status of a player (a.k.a. AGENT).
|
|
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
|
02-02-2005 20:01
what you could do is make a gesture for /away that also chats something on a channel the object listens on. that way when you go "away" it hears /3away or something like that and knows to change its behavior. then assign that gesture to F5 or whatever and hit that when you want to go "away".
|
|
Rysidian Rubio
Ruby Red Head
Join date: 14 Jan 2004
Posts: 263
|
02-02-2005 20:25
what you could do is make a gesture for /away that also chats something on a channel the object listens on. that way when you go "away" it hears /3away or something like that and knows to change its behavior. then assign that gesture to F5 or whatever and hit that when you want to go "away". OOh great idea Zuzi!! |
|
Chalky White
Second Life Resident
Join date: 1 Nov 2004
Posts: 140
|
02-03-2005 07:08
I made a follower using llMoveToTarget which stayed upright using llRotTarget. Worked fine.
|
|
Pete Fats
Geek
Join date: 18 Apr 2003
Posts: 648
|
02-03-2005 08:57
What about using the vehicle system? Built in are:
VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY VEHICLE_VERTICAL_ATTRACTION_TIMESCALE Not sure what kind of effects you are looking for, but I think these might be useful. _____________________
![]() |