Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

touch_start object cut path help?

Andie Convair
Registered User
Join date: 11 Mar 2008
Posts: 7
07-26-2008 16:23
I figured it out myself finally. Geesh. Sorry :(






Hi, what I'm looking to do is every time you touch an object, have the path cut change once (for instance, object on rez is path cut B: 0.0 - E 1.0 and when you touch the first time it changes to B: 0.1 - E: 1.0), and when it's down to B: 0.9 - E: 1.0 return to B: 0.0 - E: 1.0 again (the initial state).

I'm just not sure how to set it to recognize the state it's in and how to continue the cut path with each new click, then make it reset when it's gone.

If someone could help me out with this, and give me some sort of example I'd greatly appreciate it.
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
07-26-2008 16:53
Good informations about llSetPrimitiveParams():

http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetPrimitiveParams

Scroll down, copy/paste the Example Rule for PRIM_TYPE_CYLINDER and change what you need. Easy as pie... ;-)
Andie Convair
Registered User
Join date: 11 Mar 2008
Posts: 7
07-26-2008 16:55
I've looked at the wiki already, and honestly it mostly confused the heck out of me. I understand the general concept and have the cut path part down mostly but I guess what I actually need help with is setting it to register each new state so it knows to switch to a different cut path? This is what I have so far.

CODE

default
{
state_entry()
{
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <0.8, 0.8, 0.0>, <0.0, 0.0, 0.0>]);
}
touch_start(integer total_number)
{
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <0.1, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <0.8, 0.8, 0.0>, <0.0, 0.0, 0.0>]);
llSay(0, "Have a slice of pie.");

}
}


But I need to add in some sort of integer function to have it recognize what state it's in, so it can switch to the next one. I'm just not familiar with how to do more than the integer hidden = TRUE or FALSE. I have 9 different states that I need to switch through other than the default. Sorry if I'm not making any sense here.
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
07-26-2008 20:22
Why don't you just say you wanted a working script? Hmmm...

integer Slices = 10; // The number of slices.
integer Remains;
float Size;

kbMakePie()
{
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <;(float)Remains * Size, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <0.8, 0.8, 0.0>, <0.0, 0.0, 0.0>]);
}

defaut
{
on_rez(integer param) { llResetScript(); } // Re-bake a pie with every rezzing.

state_entry()
{
Remains = Slices;
Size = 1.0 / (float)Slices; // The size of a slice.
kbMakePie();
}

touch_start(integer total)
{
--Remains; // One slice taken.
if (Remains < 1) // No more pie?
{
Remains = Slices; // Then another pie.
}
kbMakePie();
llSay(0, "Have a slice of pie.";);
}
}
Andie Convair
Registered User
Join date: 11 Mar 2008
Posts: 7
07-26-2008 20:27
Cause I wasn't actually looking for a working script, just looking for input on how to do what I needed to get done. And I appreciate the time you took, but like I posted earer I had already figured it out. Thanks. :)