Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Wanted, Next/back script.

Nella Drillon
Registered User
Join date: 18 Jul 2006
Posts: 49
03-15-2009 12:11
What I am looking for is just the "next" or "back" script that you find in the many vendors left and right prims. All you do is click on it and it goes to the next/back to the pose that I want to view. I'm creating a modeling stand for my models.
Sleepy Xue
I script Pretty HUDs
Join date: 22 Jun 2008
Posts: 57
03-15-2009 13:52
It's easy ;p


CODE

string gCurrentAnimation;
list ANIMATIONS = [];
integer gListLength;
integer gIndex;
changeAnim(integer num) {
if(num) {
if(gIndex != 0) {
gIndex -= 1;
stop&Start();
}
else {
gIndex = gListLength-1;
stop&Start();
}
}
else {
if(gIndex != gListLength-1) {
gIndex += 1;
stop&Start();
}
else {
gIndex = 0;
stop&Start();
}
}
}
start&Stop() {
llStopAnimation(gCurrentAnimation);
gCurrentAnimation = llList2String(ANIMATIONS,gIndex);
llStartAnimation(gCurrentAnimation);
}
default {
state_entry() {
gListLength = llGetListLength(ANIMATIONS);
}
changed(integer c) {
if(c & CHANGED_LINK) {
key avatar = llAvatarOnSitTarget(); //Or something like that
if(avatar != NUL_KEY)
llRequestPermissions(avatar, PERMISSION_CHANGE_ANIMATION); // Or something like that
}
}
run_time_permissions(integer p) {
if(p & PERMISSION_CHANGE_ANIMATION) { //Or something like that
gCurrentAnimation = llList2String(ANIMATIONS, gIndex);
llStartAnimation(gCurrentAnimation);
}
}
touch_start(integer num) {
if(llGetLinkName(llDetectedLink(0)) == "right")
changeAnim(0);
else if(llGetLinkName(llDetectedLinkNumber(0)) == "left")
changeAnim(1);
}
}



ERm. Ok. I jsut wrote that on the spot, so it might be wrong, and I didn't include the animatons and anything else you want, but I pretty much wrote your script minus the build. (I just wrote it on the forums so if it has a syntax error you can IM me and I will fix it for you.)
_____________________
I script pretty HUDs.