// anim SMOOTH Script
// By Doug Linden (I think)
//
// If you are interested in scripting, check out
// the Script Help under the help menu.
// The double slash means these lines are comments
// and ignored by the computer.
// All scripts have a default state, this will be
// the first code executed.
default
{
// state_entry() is an event handler, it executes
// whenever a state is entered.
state_entry()
{
// llSetTextureAnim() is a function that animates a texture on a face.
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES,0,0,0,0, 0,0.20);
// animate the script to scroll across all the faces.
}
}
//** Script by Vik Bethune ****
//** Created: 12/12/2006 ****
//** Updated 27/12/2006 ****
//** Copyright (C) 2006 ****
//******************************************************
float gSpeed = -0.01; // Speed (rate) of the texture
integer gChannel = 12; //Talk channel
float MIN_SPEED = 0.001;
float MAX_SPEED = 0.02;
integer SIDE = ALL_SIDES; // Which side of prim to animate, can use ALL_SIDES
float MOVEMENT = 1; // MOVEMENT(length) How far the texture moves
integer X_FRAMES = 1; // In Standard Mode - defines the number of Horizontal frames or pieces to subdivide the texture into
integer Y_FRAMES = 1; // In Standard Mode -defines the number of Vertical frames or pieces to subdivide the texture into
float START = 1.0; // specifies the frame number to begin animating from (frames are numbered from left to right, top to bottom, starting at 0)
string gUsage = "";
myHelp()
{
gUsage = "\n **** Current Speed is: " + (string)gSpeed + "\n" + "**** Current Channel is: " + (string)gChannel + "\n"+"Use channel /"+(string)gChannel+ " to Enter speed between: " + (string)MIN_SPEED + " and " + (string)MAX_SPEED +", example: /"+(string)gChannel+" 0.525 \n" +" To reset script enter: /"+(string)gChannel+ " reset ";
llOwnerSay(gUsage);
}
//+" To change channel enter: /"+channel+ " new channel number, example: /"+channel+" 639 \n"
default
{
state_entry()
{
llSetStatus(STATUS_PHANTOM, TRUE); // set object to phantom
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, SIDE, X_FRAMES, Y_FRAMES, START, MOVEMENT, gSpeed);
llListen(gChannel, "", llGetOwner(), ""

; // listen to my owner
//myHelp( (string) gChannel, (string)gSpeed);
}
on_rez(integer start_param)
{
// this ensures that if we're transferred to a new owner, we're listening to them and not still to the previous one
llResetScript();
}
changed(integer change) { // something changed
if (change & CHANGED_OWNER) llResetScript(); // changed owner - reset script
}
// Alow only owner to set speed of animation on touch
touch_start(integer number)
{
myHelp();
//myHelp( (string) gChannel, (string)gSpeed);
//llListen(gChannel, "", llGetOwner(), ""

; // listen to my owner
}
listen(integer channel, string name, key id, string message)
{
if (message == "reset"

llResetScript();
else if ((float)message >= MIN_SPEED && (float)message < MAX_SPEED)
{
gSpeed = (float)message;
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, SIDE, X_FRAMES, Y_FRAMES, START, MOVEMENT, gSpeed);
}
else{
llOwnerSay("*** Invalid Command ***"

;
myHelp();
//myHelp((string)channel, message);
}
}
}
so the parameters can be predefined and redefined live.. but i still would like to know how
i can set a random variable and determine globals that can work across prims without linking.