Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Heartbeat Scripting Issues

PeachToadstool Pink
Designer
Join date: 6 Oct 2006
Posts: 37
01-12-2007 19:58
I am attempting to script a set of anime heart eyes I built for a beating motion. However, I am new to scripting in Second Life, so my abilities are quite limited. I have conducted some research on listening and scaling, but I still cannot make my object do what I want.

A major part of my problem is that, using llSetScale, I can resize one prim in the object, but not whole groups. My heart eyes contain two hearts, part of one object, that need two separate pivot points for resizing. I don't know what I can do to make this work correctly. To my knowledge, a beating motion will require timers, but that's all I really know for sure. I would be most appreciative if someone could assist me with how I can go about scripting my heart eyes.

Edit: *blink* The LSL Wiki posted in this forum is not the same as the scripting Wiki (which is currently disabled) from the main site. Well, that sure threw me off. I ignored the link here simply because I thought it was the same.
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
01-12-2007 21:44
No easy way to scale linksets although the llScaleImage writeup on the scripting wiki gives code for this. As for coordination you can have both eyes listening to a channel (preferably not channel 0) every second or two and trigger off of that.

Instead of prim hearts, might I recommend using texture animations to represent the pulsing hearts? That'll be a lot less frustrating - and for the full effect maybe you could have them emit tiny heart particles as well.
PeachToadstool Pink
Designer
Join date: 6 Oct 2006
Posts: 37
01-12-2007 21:51
The heart eyes are one single object attached to the chin, because anything attached to the eyes moves with the eyes--an event I do not want to occur. I'm investigating the Wiki right now. As I mentioned in the edit of my previous post, I completely ignored the link because I thought that Wiki was the same disabled Wiki from the main site.
PeachToadstool Pink
Designer
Join date: 6 Oct 2006
Posts: 37
01-13-2007 19:20
Okay, I have changed my strategy from llSetScale to llSetPrimitiveParams. I'm experimenting with LINK_SET to make full groups change size. It's not working as of yet...

Update: I have reverted to llSetScale for now, and I have resizing working halfway. I can resize a full heart smoothly and efficiently, but the other heart resizes based on the center of mass prim I created in the middle of the properly functioning heart. I need two centers of mass--one for each heart. I am not sure if I can accomplish this without dividing my anime heart eyes into two independent hearts. I think that I may need an expert's assistance....

For those who wish to see what I'm trying to accomplish, I have attached an image of the left, front, and right-side views (compressed) of the same object I made in 2D, for a different world. The only element am not trying to emulate is the distortion from the inflation. A basic heart resize is enough for me.
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
01-14-2007 13:28
Syncing with messages is one approach, but what if you just used local timers. In pseudocode...

Suppose you want to flash once per second

CODE
forever
get the time
calculate how long to the beginning of the next second
sleep that long
flash
PeachToadstool Pink
Designer
Join date: 6 Oct 2006
Posts: 37
01-14-2007 17:56
Okay, yes, that would be timers... Once I figure out a successful method to resize both hearts accurately, I can apply timers to make it repeat indefinitely. Thanks for the logic of the pseudocode, though.
Seth Sixgallery
Pet me!
Join date: 6 Oct 2006
Posts: 5
01-15-2007 11:28
The first thing that came to my mind was Particles. You could make the actual objects the smaller size, and script them to drop slightly larger heart-textured particles with a very short lifespan.

The only problem might be synchronizing the pulses with each eye(if that's even a priority). Maybe you could put an invisible prim in the center of the face, and a single particle texture that accounts for both hearts? Someone please elaborate on my half-baked idea!