Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Walking in circles... intentionally

Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
03-27-2009 20:27
I am trying to script something that will allow an avatar to appear to walk in a circle. The purpose is to do roleplay for performing "magical rituals", which require walking around a full or quarter circle and then doing various activities at each compass point, like lighting candles or making an invocation. Others standing near me need to be able to see me moving along that path and stopping at the right points, so my movement and what I am saying in text chat remain in sync. I have a scripted attachment for the invocations and gestures when I stop moving, but I need a way to move from station to station that won't send me running off into the woods if lag gets too bad while I try to move around the circle. (Which is why I don't just want to manually walk the avatar from station to station.)

The basic concept, as I see it would be a root prim that is a phantom and invisible box prim, cut in half so its rotational center is at one end. Then at the other end of that prim there would be a linked pose ball. (It would need to have some sort of beam-shaped prim extending toward the pose ball so the link distances work for a 5M radius or so circle, right?) By adjusting the length of the controlling root prim beam, and thereby the distance of the linked pose ball from the root prims center of rotation, one could control the radius of the circle to be walked. Basic concept would require manually adjusting the linkset for the radius you need. Advanced idea would allow scripted control of this radius distance.

Once on the pose ball, I would start facing away from the center of the circle, and hopefully could trigger other animations to gesture while standing there, without the circle movement controller interfering. Then I need to be able to issue a command to choose to change my facing to face either clockwise (or counter clockwise), which presumably means I rotate the pose ball on its local axis, and then I should be able to issue another command so I appear to walk clockwise (or counterclockwise), either 90 degrees around the circle, or 360 degrees around, presumably by rotating the linkset while a walk animation plays. When I stop that circular movement, the walking should stop and I should be rotated to face outward again, and be free to do other gesture animations.

So, I have the rough idea, and I'm certainly willing to write most of this code myself, but I need to know what LSL commands to look for to do some of these steps.

1: What LSL command would I use to rotate the linkset around the center of the root prim, so the avatar on that pose ball is seen to actually move in a circular arc, with the same shoulder continuong to point toward the center of the circle, and not just "pop" from one position to the next? I suppose a loop and some sort of variable for start and stop rotational position would be needed, to rotate the linkset in several steps? Detecting the start rotation and position, and then adding a vector to that to determine if the movement will be full-circle or quarter circle, and then rotating in x steps from the start to end positions?

2: How do I position the avatar facing outward when betwen rotational movement actions, yet still allow another attachment to move my body and expecially my arms to make gestures? Would I have to get off the pose ball, do the activity at that station, and then get back on the pose ball again? Or can I just do a "stop all animations" after setting my facing, without getting off the pose ball?

3: How do I switch from that standing or uncontrolled animation position to a walking animation, and back, when the rotating movement around the circle starts and stops?

Is there an easier way to do this? Some method for just making the pose ball itself move or doing this as a vehicle that can move in a circular path and do these things?

Or am I envisioning something so horribly complex that I am better off dropping the whole idea and just walking the circle manually, with my graphics prefs turned way down, so lag doesn't affect me so much?

At worst, I could manage with a gadget that would have me gesture, then hop on a pose ball and ride 90 degrees and get unseated, gesture, then get on another pose ball for another 90 degree ride... But it would be better if I could remain on the gadget until I no longer need to walk the circle's stations.

I would preferably want to be able to initialize the device to face one of the four compass points, such as setting a variable so the start position is facing East. Then commands might be something like CW-S to go 90 degrees in a clockwise motion, stopping it at the South, or CCW-E to go counter clockwise, full circle from East (where I am at that point) to East again.

Ideally, I should be able to retain my arm and upper body positions as I walk the circle, so for example if I trigger an animation that has me holding a dagger out to my Left, the arm remains in that position while I walk. But I would guess that is not possible without a custom walking animation that has no data for upper body motion.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
03-27-2009 21:24
Instead of trying to drag an avatar around with an attachment, which can be done, but would be difficult with what your describing, you might be better off paying someone to make an avatar animation that has the avie do all the complex walking around. Then, take those animations, and drop them in a hud that lets you trigger which animation you want, when you want. You're really tackling it the 'hard way' by trying to do it as you're suggesting.
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
03-27-2009 23:06
A few bits and pieces related to animations that I hope will be helpful:

From: Ceera Murakami

2: How do I position the avatar facing outward when betwen rotational movement actions, yet still allow another attachment to move my body and expecially my arms to make gestures? Would I have to get off the pose ball, do the activity at that station, and then get back on the pose ball again? Or can I just do a "stop all animations" after setting my facing, without getting off the pose ball?

This part is easy, as one can design animations that only effect the orientation of your avatar (rotating the hips) while leaving everything else untouched. These could be started and stopped in script without interrupting anything else, and could even provide a smooth interpolated "turning to face another direction" motion if allowed to ease in and out over a period of a second or two.

From: someone
Ideally, I should be able to retain my arm and upper body positions as I walk the circle, so for example if I trigger an animation that has me holding a dagger out to my Left, the arm remains in that position while I walk. But I would guess that is not possible without a custom walking animation that has no data for upper body motion.
If your upper body animations are made with a sufficiently high priority (no real reason not to use the maximum, 4, in this situation) and the walking animation is anything less, then walking won't interrupt the position of your arms and such.

From: someone
1: What LSL command would I use to rotate the linkset around the center of the root prim, so the avatar on that pose ball is seen to actually move in a circular arc, with the same shoulder continuong to point toward the center of the circle, and not just "pop" from one position to the next? I suppose a loop and some sort of variable for start and stop rotational position would be needed, to rotate the linkset in several steps?
One thing I've always wanted to try but haven't got around to yet, is rather than trying to imitate perfectly smooth walking motion by breaking a non-physical movement into a very large number of very small sections while looping a normal walking animation, instead make an animation that plays a single step (left foot) and another for a single step (right foot) and trigger them timed with appropriately-scaled movements of the prim. So each step is marked by a single half-stride animation and a single movement of the prim. Done right I think it could end up looking a lot more like a walking biped and a lot less like the second hand on a digital clock. ;)

Just a variation to think about if you do end up working with a looping fractional prim rotation type of arrangement like most end up using.

---

From: Johan Laurasia
Instead of trying to drag an avatar around with an attachment, which can be done, but would be difficult with what your describing, you might be better off paying someone to make an avatar animation that has the avie do all the complex walking around. Then, take those animations, and drop them in a hud that lets you trigger which animation you want, when you want. You're really tackling it the 'hard way' by trying to do it as you're suggesting.
Excellent point, but I'm seeing a couple of potential problems:

- It's not hard to animate an avatar walking from one place to another, but once the animation is stopped you end up right back where you started. It's something of a classic problem faced by people wanting to crawl up a ladder or climb a rope by animations alone. One could in theory loop the very last frame of the animation endlessly to "freeze" your avatar in a particular position along the circular path before continuing, but I'd worry that the transition to the next segment would end up with the avatar jumping back to the start then jumping ahead rather awkwardly, download latency and lag being what it is. I'm picturing all kinds of surreal zapping around under anything other than the most ideal circumstances.

- I took from the initial question that the size of the circle may be different in different circumstances, and any change there would require a whole new set of animations.

EDIT: Thinking about I realized you might be able to do it with animations alone if they were carefully crafted and included a set of single-frame animations that do nothing but lock the avatar into the correct rotation/position around the circle, stacked on top of the previous segment and not stopped until the next segment was underway. A tricky bit of business but it might work well if done properly, with a lot of attention payed to the timing of things. You'd still need a whole new set of animations for a differently sized circle.
EDIT2: And none of your ceremonial animations could affect the hips in ANY way during this whole ceremony, including bending forward and other innocuous-seeming movements, since that would yank your hips (and the rest of you) back to the zero point in the process.
---

Hope some of this is helpful or provides food for thought.
_____________________
Designer of sensual, tasteful couple's animations - for residents who take their leisure time seriously. ;)

http://slurl.com/secondlife/Brownlee/203/110/109/

Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-27-2009 23:27
using the standard hug script method of moving in short stops around the arc of the circle should work... the formula for getting those positions is one I've spammed the forums with before

position = circle center

offset = distance to circles edge (and your start point)

current rotation = accumulates the rotation around the center as you move start at ZERO_ROTATION

arc = how much of a move to calculate for each target

target = where you want to walk to

formula:
target = position + (offset - offset * arc) * current rotation
current rotation = arc * current rotation
(could be used in a pose ball also, current rot applied as it's own to maintain facing)

if you have your object send the new points to move to it's even faster formula
Formula:
target = position + offset
offset *= arc
current rotation = arc * current rotation


poseball method:
Plus: facing can be maitained for you
Minus: hard to get a good walk between points, and more jumpy, hard to fix for variable av height)
needs: llGetLocalRot, llGetpos, llSetRot, llSetPos,

hugger styled method:
Plus: walk defaults to AO
Minus: you have to manually control your facing (I like click hold on nametag)
needs: llMove2Target, moving events, at_target event.

center driven variant (works for any)
plus: center is logical home point for clicking/sitting
minus: same as the others it's applied to
needs: some communication method with the movement method, listen link message

additional needs:
probably llEuler2Rot and DEG_TO_RAD too (for converting arc from a vector in degrees to a rotation), and some sort of detection method for getting the center in hug style, or hard coded in a poseball

hardest would probably be the hug style, but it gives more control, including over possible radius (you pick the circle size)

linked poseball would be the easiest, but it's hard to adjust it, and may not look as authentic

thoughts on the animation method:
it could work, you'll end up having to size your circle to the animation, and remember to loop the last frame of each (so you don't snap back) it'll definitely be a bonus in fluidity(assuming skilled animator, but walks/paths are easy), but alignment, and viewer lag for the playing animation may ruin the effect/timing.

ETA:
I also know someone that scripts and makes ritual gear for SL, and may already have almost the exact thing you're looking for, contact him inworld if you see him "Sra Echegaray", very friendly helpful guy
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
03-28-2009 06:19
Thanks for the feedback so far. I'll look it over in more detail after I've consumed another cup of coffee or two and managed to wake up all the way.

Ideally I am trying to make this a versatile system that could be used for a variety of different ceremonies and locations. For example, next weekend I'll be performing a handfasting ceremony (Wiccan wedding). So that particular ceremony has a somewhat standard "opening" that has me walking the circle 3 times as a full circle clockwise from East to East again, returning to the West of the altar at the center after each revolution, and then once in 4 steps of 90 degrees. At the start of each full circle and at each stop in the quarter circle and at each stop at the altar I have spoken parts to copy and paste into chat, and chat commands to my scripted dagger that pose my body and do hand and arm gestures... And that is just to "prepare the area for the ceremony". The closing ceremony has a different pattern to be walked. And different rituals may require more or less complicated patterns at start and end.

While that ceremony is being done outdoors and has a 9M diameter circle I will need to walk, The next ceremony might be indoors, and have a 12 M diameter circle to be walked. The next time, I might have to do a solitary ceremony in a 3 M diameter circle...

I'll look all this over, but it sounds like I may just be trying to do too much by automation. And while I do want to be able to do this sort of ceremonial roleplay, doing handfastings and other ceremonies is not something I do all that frequently. So it's not necessarily worth doing a lot of custom animating for, unlike if I was a minister doing weddings every week.

I checked with the maker of my scripted ritual Athame, and they knew of no gadget to do this sort of circle walking. I'll definitely want to check out what "Sra Echegaray" has to offer. Even if they can't solve this problem, I'd love to see their other ritual items.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
03-28-2009 09:07
Circle walking ... really sounds like a vehicle to me. You COULD cobble this together using one of those terrific "tour" systems commercially available, and stocking a dance HUD with your celebrant anims. There are tour systems where you can program the vehicle path yourself and replace the tour balloon or whatever with an invisiprim. However, it sounds to me like a custom vehicle script would suit you better, since who wants to be fiddling around triggering anims when you're supposed to be all sacral?

Presumably the custom vehicle would be notecard-programmable with a list of 'stops' and animations to perform at each stop, and the walk to use in between. That way you could have several versions easily, a wiccan celebration and a native american one, without bothering the scripter. Although I would set up the script to have a 'totally automatic' mode, where it uses timers to control when the avatar moves between stops, I think the celebrant (you) would also want a mode where it was HUD controlled, so that s/he could move between stops whenever s/he chooses.

Another plus to using a vehicle is that it would allow for multiple celebrants, each with their own set of animations at each stop, for ceremonies best performed with an acolyte.
.