|
Jack Gelfand
Registered User
Join date: 31 Jul 2006
Posts: 3
|
08-21-2006 05:10
I wrote a script which goes like this: vector down; vector up = <31.392,199.123,354.092>; float time = 5.0; default { state_entry() { closed = llGetPos(); llSetPos(down); }
touch_start(integer total_number) { llSetPos(up); llSleep(time); llSetPos(down); } } I made a chamber and put this script in it. I walked into the chamber and clicked it. It zoomed up 50 on the Z scale but left my avatar behind. So it's not much of an elevator really. Could someone help me please? Also does anybody have any additions to the script?
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
08-21-2006 06:48
It will work, but for sit pos lifts you need to sit on the prim...
The other option is to take the prim physical, different set of scripting calls, and the lift will push you like a RL lift does.
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
08-21-2006 06:50
/15/01/104547/1.htmlGood to see you trying out some code, Jack. This is not a physical elevator. You have to sit on it and then it will take you to where it is going. I have posted a link to another non physical elevator scipt.
|
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
08-21-2006 07:53
Hi Jack, I have a simple elevator-type teleport script that may help and serves most basic needs. It makes a copy of itself, goes one way then de-rezzes, which is not quite what you are after, but may be of interest to you and/or others. Setup: 1) Create a prim and give it a name. 2) Set the prim to default sit on touch (bottom of general tab in edit). 3) Drop this script in it and wait about 10 seconds. 4) Now, take a copy of this prim to your inventory. 5) Drop a one-line notecard into the original one, containing only the target vector. 6) Drop the inventory copy of the prim into the contents of the first. 7) Wait for it to show itself, and click it. // Simple Teleporter (Free to use, unsupported) // Escort DeFarge 2006
vector TARGET = ZERO_VECTOR;
string ANIMATION = "sit_ground";
string NOTECARD = "Properties"; key query = NULL_KEY;
key avatar = NULL_KEY; integer count = 0;
default { state_entry() { llSitTarget(<0, 0, 1>, ZERO_ROTATION); llSetAlpha(0.0, ALL_SIDES); count = 0; llSetTimerEvent(2.0); } timer() { count++; if (llGetInventoryType(llGetObjectName()) == INVENTORY_OBJECT && llGetInventoryType(NOTECARD) == INVENTORY_NOTECARD) { llSetTimerEvent(0.0); query = llGetNotecardLine(NOTECARD, 0); } else if (count > 5) { llSetTimerEvent(0.0); llSetAlpha(1.0, ALL_SIDES); llSay(DEBUG_CHANNEL, "Incorrect inventory - Object \"" + llGetObjectName() + "\" and Notecard \"" + NOTECARD + "\" are required"); } } dataserver(key id, string info) { if (id == query) { query = NULL_KEY; TARGET = (vector)info; if (TARGET != ZERO_VECTOR) { state ready; } else { llSay(DEBUG_CHANNEL, "Incorrect notecard (zero vector)"); } } } changed(integer change) { if (change & CHANGED_LINK) { llSleep(0.1); avatar = llAvatarOnSitTarget(); if (avatar != NULL_KEY) { llUnSit(avatar); } } else if (change & CHANGED_INVENTORY) { llResetScript(); } } }
state ready { state_entry() { llSetSitText("Teleport"); llSetAlpha(1.0, ALL_SIDES); } changed(integer change) { if (change & CHANGED_LINK) { llRezObject(llGetObjectName(), llGetPos(), ZERO_VECTOR, llGetRot(), 1); llSleep(0.1); avatar = llAvatarOnSitTarget(); if (avatar != NULL_KEY) { llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); } } } run_time_permissions(integer perms) { if (perms & PERMISSION_TRIGGER_ANIMATION) { llStopAnimation("sit"); llStartAnimation(ANIMATION); while (llVecDist(llGetPos(), TARGET) > 0.001) { llSetPos(TARGET); } llStopAnimation(ANIMATION); llUnSit(avatar); llDie(); } } object_rez(key id) { llGiveInventory(id, NOTECARD); llGiveInventory(id, llGetObjectName()); } on_rez(integer start_param) { llResetScript(); } }
_____________________
http://slurl.com/secondlife/Together
|
|
Jack Gelfand
Registered User
Join date: 31 Jul 2006
Posts: 3
|
Thanks
08-21-2006 08:43
Thanks, If I made the lift physical would that script work the same as a real lift. I'll try that. If that wont work then do i have to do a different script. Also instead of makeing a target in the script could I use +6 on the Z axis?
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
08-21-2006 14:05
Yes, and yes.
Although "just making it physical" actually means a pretty full rewrite, but it should work.
But you can set the target to llGetPos() + <0.0, 0.0, 6.0>, or even vector pos=llGetPos(); then pos.z+=6.0;
|