Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with sounds

LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
11-13-2006 16:06
From: Llauren Mandelbrot
Yeah, but those are tougher problems.:) Especially the animation issue.

As far as rezzing three different versions of him, one at a time, I think that you might be better off making one version that does all three things at different times.



Hi, sorry Llauren you lost me on this one, could you explain a bit more your thought on this.

I can live without the licking himself as that maybe more of an animation thing. But i have two poses of him now one staring at food bowl and randomly meowing (ty guys) and one of him on his back snoring. I am trying to figure out a way to rezz these two items randomly so at any given time he maybe sleeping or he may be waiting for food.

I wouldnt even know where to begin animating this. rezzing two objects randomly seemed more tangible.


Thanks for all your help and input so far.
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-13-2006 16:42
....At the risk of starting the Mutual Apology Society off on another round of mutual apologies...:)

I`m sorry, but if you can get the cat to animate properly --which is doable, but VERY difficult-- then the two poses come essentialy "for free", as part of the animation system. Are you familiar with "key frame animation"?

The basic idea is that you animate the cat by moving the various prims around under script control. A master script tells all prims, using linkmessages "go to position # such-and-such", and all prims use suitable calls to llSetLocalPosition() and llSetLocalRot() [or equivalent] to position and turn themselves to the desired local coordiates.

It isn`t really so much difficult as tedious. The actual scripts themselves are really rather trivial, but you need a script in every prim, and you need to update every script for every position you want the cat to assume in every frame of the animation. There are techniques
, such as linear interpolation, that can be used to make the animation smoother with less work on your part, but this complicates the scripts somewhat.

On the whole, it has potential to be very laggy.

Do you wish to go this route?
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
11-13-2006 16:57
um...

no not at all...lol

other than the headache i got from that just now...the laggy part is what i am hoping to avoid.

I use zero prim rezzers all over my property and that is where i got the idea about just rezzing a couple of objects.

Meanwhile i was checking out Hiro's vendor script but i think this is more than i am capable of doing on my own.

anyway thanks abunch for all your help Llauren! : )
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-13-2006 17:02
What? huh?? Did someone say something??? heehee
You could make a prim named "cat rezzer", make it invisible and put this script in. It is made for 3 different cats. Every 3 minutes a cat will have to die though and a new one is rezzed. (Please do not tell the PETA!!!)
CODE

integer cat = 0;
float time = 180.0;

neTimed()
{
llRezObject((string)llGetInventoryName(INVENTORY_OBJECT, cat), llGetPos(), ZERO_VECTOR, ZERO_ROTATION, 42);
}

default {
touch_start(integer num_detected)
{
neTimed();
llSetTimerEvent(time);

}
timer() {
llSay(-1032, "Die Cat Die");
if(cat != 2){
cat = cat + 1;
}
else {
cat = 0;
}
neTimed();
}
}


and in each cat:
CODE


default {
state_entry(){
llListen( -1032, "cat rezzer", NULL_KEY, "" );
}
listen(integer channel, string name, key id, string message){
if(message == "Die Cat Die"){
llDie();
}
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-13-2006 17:55
um...

no not at all...lol
Hokay.other than the headache i got from that just now...:eek:I`m sorry!:o...the laggy part is what i am hoping to avoid.I don`t know just how laggy it would be. That would depend upon how many prims your cat is made of, and how often it moves. The less often it moves, the less lag, and the less work it takes to set up, and the less realistic it looks. Like I said, the scripts themselves are trivial.I use zero prim rezzers all over my property and that is where i got the idea about just rezzing a couple of objects.That would work, but it wouldn`t be very realistic, seeing a cat just vanish and re-appear, instead of moving. Still, your cat, your choice.:)Meanwhile i was checking out Hiro's vendor script but i think this is more than i am capable of doing on my own.Don`t need a vendor for this! Jesse`s script would be more than adaquate.anyway thanks abunch for all your help Llauren! :)You are very welcome! ::hugs::

Um, I`m sorry, Jesse, but suppose someone wants several cats. How about the llResObject() call tells the cat what channel to listen on, and the rezzor selects a random negative channel when it is itself rezzed?
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-13-2006 18:09
From: Llauren Mandelbrot
Um, I`m sorry, Jesse, but suppose someone wants several cats. How about the llResObject() call tells the cat what channel to listen on, and the rezzor selects a random negative channel when it is itself rezzed?

The code could handle a lot of improvements. Frand and a random cat integer would be nice but I didn't know how to do it yet. Probably want to go longer then 3 minutes too? Could have made the if test integer the quantity of inventory objects minus one to be flexible. So basically I could have done a lot more but I have been busy bug hunting in Beta all day. Plus I have been wanting to use the command "Die Cat Die" for sooooooo long now.

Edit: Ah just thought of something. Now it would be kind of cool if the cat vanished and then rezzed in a different location within the 10 meter limit. But that would work on the lawn and not in the house. Unless you wanted to store different locations like maybe the floor, counter top etc.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-13-2006 18:24
The code could handle a lot of improvements. Frand and a random cat integer would be nice but I didn't know how to do it yet.cat=(integer)llFrand(NumberOfCats)?Probably want to go longer then 3 minutes too? Could have made the if test integer the quantity of inventory objects minus one to be flexible.Yep; thought of those, too.So basically I could have done a lot more but I have been busy bug hunting in Beta all day.Thank you! ::HUGS::!!!Plus I have been wanting to use the command "Die Cat Die" for sooooooo long now.::giggle::Edit: Ah just thought of something. Now it would be kind of cool if the cat vanished and then rezzed in a different location within the 10 meter limit. But that would work on the lawn and not in the house. Unless you wanted to store different locations like maybe the floor, counter top etc.Indeed. Good thoughts. Quite doable, though.
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
11-13-2006 20:04
Hello,

Thankyou guys for all your help. Jesse's script works, but the cat rezzes out of position, in otherwords, not the position he is in when i place the script in him.

does: ZERO_VECTOR, ZERO_ROTATION, 42

that part of the script control positioning?

thanks for all the hand holding...he he

I mos def own you guys some steak dinner.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-13-2006 20:28
Change this line:

CODE

llRezObject((string)llGetInventoryName(INVENTORY_OBJECT, cat), llGetPos(), ZERO_VECTOR, ZERO_ROTATION, 42);

to:
CODE

llRezObject((string)llGetInventoryName(INVENTORY_OBJECT, cat), llGetPos() + <0.0, 0.0, 0.0>, ZERO_VECTOR, ZERO_ROTATION, 42);


You will need to adjust these numbers for the position ; <0.0, 0.0, 0.0>.
Thank you for the offer but this isn't done till the fat cats sings!!!. (OMG that was bad) LOL

eeeek! don't know why it keeps doing that. It should be INVENTORY_OBJECT with no spaces
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
11-13-2006 23:20
Jesse,

Wow you have put some work into this project!

I took a pic for clarification. the position i spoke of was the way the cat rezzes and not so much its proximity to the rezzer. I included a link to a pic showing two cats same model next to each other.

The cat on the right is correct and sits up right. the cat on the left is slumped and buried...that one is the one that rezzed.

so the alignment is off not the proximity, but the ability to adjust the proximity is a plus also.

hope the pic helps, and you can see sebastian now...lol
...and yes, he REALLY is that fat...


http://www.angelfire.com/realm/1066/fatcat.html
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-14-2006 06:05
OMG Sebastian is soooooo cute!!!!!!!!!

I help because I can. I have no real previous experience in scripting and don't know any other languages. But because of the help of so many here in Scripting Tips I can do alot now. Of course one name always comes to mind and that is Newgate Ludd!!!!!! So for the scripting questions that I do know the answer for, I pop in and try to take the load off of the more advanced scripters. Plus it is fun and helps me learn more anyway.

Okay now that that is out of the way. To make Sebastian rezz correctly in different forms you will need to create a small invisible prim with ZERO_ROTATION and make it the root prim. Just FYI the root prim is the last prim selected when linking. You would also want to make this prim all the same height in each version of the cats so that when they rezz they still all rez on the same plane. Take the "DIE CAT DIE" script out of the existing cats and put back in this prim too.

After doing that then Sebastian in all of his fat, glorious forms will rez in the right spot and rotation. ENJOY!!!!!!!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
ickle thought
11-14-2006 08:03
Could use temp on rez and just let them disappear of their own accord every minute or so....

From: Jesse Barnett
But because of the help of so many here in Scripting Tips I can do alot now. Of course one name always comes to mind and that is Newgate Ludd!!!!!! So for the scripting questions that I do know the answer for, I pop in and try to take the load off of the more advanced scripters. Plus it is fun and helps me learn more anyway.


Thanks for the high praise Jesse, but I really cant take credit for your ability to learn.
I just enjoy helping and scripting. And like you say, explaining or solving problems often improves your own skills.
LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
11-14-2006 08:18
jesse ty again.


one last bit, but this is minor i think. The die cat die script isnt removing the former cat when the new one appears. i came in today to find that my 3000 plus prim property had 3 prims left...lol. so 45 mins of "killing da kitties" and i followed your instructions with the invisible prim. the cats are now positioning correctly. woot!

is there anything i need to specify in the die cat die script to make it eliminate the last one?


: ) i musta killed a hundred cats today...i feel so bad...he he
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-14-2006 14:55
Well Cats Have Nine Lives After All......
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-14-2006 15:05
Did you remember to name the rezzer "cat rezzer" with no quotation marks? I made the "Die Cat Die" script listen only to an object named that.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-14-2006 15:07
I will try to work on mouse rezzer to give Fat Cat some exersize:-)
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-14-2006 15:33
From: Jesse Barnett
I will try to work on mouse rezzer to give Fat Cat some exersize:-)



Was thinking about a dog to chase him too....

My twist on Jesse's idea, have the cats kill themselves

Rezzer script
CODE
integer cat = 0; 
integer maxcats = 0;

default
{
state_entry()
{
maxcats = llGetInventoryNumber(INVENTORY_OBJECT);
}

touch_start(integer num_detected)
{
state running;
}

changed(integer change)
{
// Test for a changed inventory
if (change & CHANGED_INVENTORY)
{
llResetScript();
}
}
}

state running
{
state_entry()
{
llSetTimerEvent(0.1);
}

touch_start(integer num_detected)
{
llSetTimerEvent(0);
state default;
}

timer()
{
integer num = cat;
while(num == cat)num = (integer)llFrand(maxcats);
cat = num;

llRezObject((string)llGetInventoryName(INVENTORY_OBJECT, cat), llGetPos() + <0.0, 0.0, 0.0>, ZERO_VECTOR, ZERO_ROTATION, 42);

llSetTimerEvent(llFrand(300)+30);
}


changed(integer change)
{
// Test for a changed inventory
if (change & CHANGED_INVENTORY)
{
llResetScript();
}
}
}


Cat Script
CODE
default 
{
state_entry() { llSetTimerEvent(llFrand(200)+30); }

timer() { llDie(); }

}


P.S. Sorry I'm late replying.......
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-14-2006 16:07
From: Newgate Ludd
My twist on Jesse's idea, have the cats kill themselves


Now I don't know which idea I feel worse about. Cat murder or feline assisted suicide.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-14-2006 20:44
Now I don't know which idea I feel worse about. Cat murder or feline assisted suicide.:)

My idea: have the on_rez event of the cat script shout "Die, Cat, Die!" at all existing cats.
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-14-2006 22:20
From: Llauren Mandelbrot
:)

My idea: have the on_rez event of the cat script shout "Die, Cat, Die!" at all existing cats.


ohhhh Feline mass murderers....
1 2