Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

i need help for the script door stretch

Lorjo Qinan
Registered User
Join date: 3 Nov 2007
Posts: 5
08-06-2008 13:13
hello, i want to create the door stretch. I have the script that i think it's good but i don't know where i change the axes for the open make it. i put the script here and help me please thank's.

This script i take for the store:

integer up;
vector startSize;
float endSize = 0.196; //In meters, how long the prim will end up being along it's Z axis.
float rate = 0.1; //In meters, how much it stretches every roughly 0.5 seconds.
curtainTransition()
{
if (up)
{
startSize = llGetScale();

float i;

for (i = startSize.z; i < endSize; i += rate)
{
vector scale = llGetScale();
vector pos = llGetLocalPos();
llSetScale(<scale.x, scale.y, scale.z + rate>;);
llSetPos(<pos.x, pos.y, pos.z - (rate / 2)>;);
}

up = FALSE;
}

else if (!up)
{
float i;

for (i = endSize; i > startSize.z; i -= rate)
{
vector scale = llGetScale();
vector pos = llGetLocalPos();
llSetScale(<scale.x, scale.y, scale.z - rate>;);
llSetPos(<pos.x, pos.y, pos.z + (rate / 2)>;);
}

up = TRUE;
}
}
default
{
state_entry()
{
up = TRUE;
startSize = llGetScale();
//llListen(55555, "", NULL_KEY, "curtain";); //Uncomment this if you're using the listen event for activation.
//llListen(55555, "", llGetOwner(), "curtain";); //Uncomment this instead if you only want it to listen to the owner.
}

on_rez(integer start_param)
{
up = TRUE;
startSize = llGetScale();
}

///Below this line are three means of activation. You might want to delete the ones you're not using.
touch_start(integer total_number) //Use this event to make the curtian activate when touched.
{
//if (llDetectedKey != llGetOwner()) return; //Uncomment this line to make owner-only.
curtainTransition();
}

link_message(integer sender_num, integer num, string str, key id)
{
if (str == "curtain";) curtainTransition(); //Activates the curtains when this prim receives a link message containing "curtain" as the string. To make link_message owner only, that will have to be specified in the script sending the link_message.
}

listen(integer channel, string name, key id, string message)
{
if (message == "curtain";) curtainTransition(); //Activates the curtains when it hears "curtain" on channel 55555. (Make sure to uncomment the llListen() line in state_entry() if you're going to use this.)
}
}
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
08-06-2008 14:06
the door has to be cut so that the center becomes an edge.
_____________________
Lorjo Qinan
Registered User
Join date: 3 Nov 2007
Posts: 5
08-06-2008 17:09
hello Dikka, thank's for your answer but the door which i want to make it's same the blind.