Tuesday, December 02, 2008
USERLOGIN PASSWORD Remember?
You are here » Learning Center ยป Forums

Openlife Forums

 Openlife Grid Forums
Minimize
 
  Openlife Forums  Scripting  LSL Discussion  need a prim moving script that creates a trail.
Previous Previous
 
Next Next
New Post 10/13/2008 1:26 PM
User is offline Arachia Botanical
5 posts
Openlife Newbie


need a prim moving script that creates a trail. 

looking for a script that will move a prim tem meters and create a prim along the trail while doing so.

I need it for a DNA RNA transcription translation animation that I am making.

 
New Post 10/13/2008 2:26 PM
User is offline Arachia Botanical
5 posts
Openlife Newbie


Re: need a prim moving script that creates a trail. 

okay I got it to move using this

//June 2008
//Macca Rox's version
//---/---/---/------------------------------------------//_______________________>>
vector      DIST    = <-1.5,2.0,0>; //set movement amount and direction. Use a minus for reverse
float       SLEEP       = 0.5;      //set time between movements
//float       VOLUME      = 0.8;      // sound volume, 1.0 loudest, 0.0 to disable sound
//key         SOUND_OPEN  = "";
//key         SOUND_CLOSE = "";
vector      Pos;//Get the prims position
//---/---/---/------------------------------------------//_______________________>>
open()
{
         //llTriggerSound(SOUND_OPEN, VOLUME);
         Pos = llGetPos();
         llSetPos(llGetLocalPos() + DIST); //Add or remove these pairs for more or less steps
         llSleep(SLEEP);
         llSetPos(llGetLocalPos() + DIST);
         llSleep(SLEEP);
         llSetPos(llGetLocalPos() + DIST);
         llSleep(SLEEP);
         llSetPos(llGetLocalPos() + DIST);
         //llWhisper(0,"Opened");
         llSetObjectDesc("1"); //Sets object Description for open position
}
close()
{
         //llTriggerSound(SOUND_CLOSE, VOLUME);
         Pos = llGetPos();
         llSetPos(llGetLocalPos() - DIST);
         llSleep(SLEEP);
         llSetPos(llGetLocalPos() - DIST);
         llSleep(SLEEP);
         llSetPos(llGetLocalPos() - DIST);
         llSleep(SLEEP);
         llSetPos(llGetLocalPos() - DIST);
         //llWhisper(0,"Closed");
         llSetObjectDesc("0");//Sets object Description for close position
}
//---/---/---/------------------------------------------//_______________________>>
default
{
    state_entry()
    {
        if(llGetObjectDesc()=="") llSetObjectDesc("0"); // if any, initialize Object's Description as storage variable
    }  
    on_rez(integer start_param)
    {
        llResetScript();
    }
    changed(integer change)
    {
        if(change & CHANGED_OWNER) //Check for a new owner
        llResetScript();
    }
   
      
    touch_start(integer total_number)
    {   
        if(llGetObjectDesc()=="0")
        {
            open();
        }
        else if(llGetObjectDesc()=="1")
        {           
            close();
        }
     }
  
}
 

 now I need to know how to get it to spawn a prim every time it sleeps along the length of the movement.

 
New Post 10/13/2008 11:59 PM
Online now... Galen
69 posts
Openlife Apprentice


Re: need a prim moving script that creates a trail. 

Hey Arachia,

 

you can rez prims using the llRezObject function.

Put a prim in your main (moving) prims inventory, give it a name (eg. "trail"), and then after each move of your main prim, add

 

llRezObject("trail", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, 0);

That should do the job.

 

Greetings, Galen

 
New Post 10/15/2008 4:43 AM
User is offline Arachia Botanical
5 posts
Openlife Newbie


Re: need a prim moving script that creates a trail. 

Okay how do I link the trails together?

 
Previous Previous
 
Next Next
  Openlife Forums  Scripting  LSL Discussion  need a prim moving script that creates a trail.
Privacy Statement | Terms Of UseAll Rights Reserved 2007,2008 3DX - Openlifegrid.com