Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with tire texture script

Karl Greenstein
SL's Hottest Stickman
Join date: 19 Aug 2004
Posts: 33
08-06-2005 16:10
I've got a script free, seeing how I know very little about scripts except how to modify simple ones or those that are well commented. Well, this one doesn't tell me what anything does and I'm stumped on how to make the texture spin the right direction and not change the repeats per face I have set. Currently it is making the texture super tiny and spinning it at a 45ish degree angle. This is on a cylinder prim. The textures on the "top" and "bottom" of the prim spin correctly, but the "side" goes all wonky. Any insight on what lines are doing what, in idiot speak, would be a great help! :D Heres the script I'm using:

CODE
//**********************************************
//Title: Car Rear Wheel
//Author: Aaron Perkins
//Date: 2/17/2004
//**********************************************

rotation Inverse(rotation r)
{
r.x = -r.x;
r.y = -r.y;
r.z = -r.z;
return r;
}
rotation GetParentRot()
{
return Inverse(llGetLocalRot())*llGetRot();
}
SetLocalRot(rotation x)
{
llSetRot(x*Inverse(GetParentRot()));
}

default
{
state_entry()
{
}

link_message(integer sender_num, integer num, string str, key id)
{

if(str == "WHEEL_DRIVING")
{
state driving;
}

}

}

state driving

{
state_entry()
{
SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
llSetTimerEvent(0.5);
}

timer()
{
vector vel = llGetVel();
float speed = llVecMag(vel);
llSetTextureAnim(ANIM_ON|LOOP|SMOOTH|ROTATE,ALL_SIDES,0,0,0,0,speed);
}

link_message(integer sender_num, integer num, string str, key id)
{
if(str == "WHEEL_DEFAULT")
{
state default;
}

}

state_exit()
{
SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
llSetTextureAnim(0,ALL_SIDES,0,0,0,0,0);
}

}
_____________________
Check out Dragon Motorsports on Silver Island (50, 72)
and
Stickman Boarding Co. on Simone (106, 203, 53)
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
08-13-2005 01:54
Bump!

This has been posted on before. You can view the responses here:
/54/a4/54474/1.html
_____________________
---