Elevator script?
|
Sareth Amos
Registered User
Join date: 23 May 2005
Posts: 7
|
05-31-2005 09:33
I have talked to a linden about this and she said that it was possible but she didnt know if it had been done before. SO I was wondering if this has been done and if not how would I go about making one. I have not done any scripting before but by looking at the scripts it seems like it shouldnt be too hard to learn. Here is what I am thinking. I know there are teleporter scripts that would work just as good but this is something I really want in my continuely expanding estate  . I want a real live working elevator one where I climb into a box and "tell" the box where I want it to go and it takes me there elevator style but rising up slow enough my av can stay on it and not fall through the floor. I was also thinking about this can be an entire tube transport system....if it works on the Z why not on the x and y. I could say to the elevator "3rd floor" and it would take me there straight up the central tube to the 3rd floor grand hall or I could tell it...west wing and it would take me to the west wing main hall. So...any help would be apreaciated. I was also thinking about how I would go about an object "cuting" when I touch it? this woud save prims big time on the elevator I could just create a hollow cube or cylinder and when I touch it it cuts a set amount and basically creats a door and when I touch again the door closes. So how would I go about that too? Once again thanks all in advance for your help and sorry for the long post 
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
05-31-2005 09:39
Yes, this is all definitely possible. I could probably script this for you; I'll be on when the systems are done updating.
I have actually been working on a physical elevator that can go to certain floors with an up/down button, but it could easily be made to be voice activated.
I'll contact you when I log in.
|
Sareth Amos
Registered User
Join date: 23 May 2005
Posts: 7
|
05-31-2005 09:43
Well thank you I wont be on then but I should be on around 5-6 mtn time Im at work now  How much would you charge? hehe...Im not a rich person by any means and right now Im just buying money through IGE lol its costing me a small fortune to keep up my hobby of making the Amos estate one of the grandest houses on all of SL 
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
05-31-2005 09:47
My prices are pretty cheap. I'm not trying to support 11 children off of my SL money, anyways  . I'll start coding it now, while I have nothing else to really do. (I love Scite-EZ)
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
05-31-2005 17:21
Elevators have been done. There are both voice control and button control versions. There is a kit called "Elevator in a Box," but I'm not sure if it's still available from the creator. I'd bet that 90% of the elevators in SL were built around that script/kit. From it, I've created elevators with two doors for each floor... one set to close the elevator, the other to close the elevator shaft. I've also created a script to make the buttons inside the elevator light-up and work as in RL elevators. And yet another script to display the elevator's current position at each floor's waiting area.
All of that isn't to say, though, that it can't be done better. And for the most part, it's a very good project to teach yourself scripting. If you have any scripting questions, you can always send an IM and I'll try to help.
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
05-31-2005 18:11
_____________________
---
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
06-01-2005 09:35
Jeffrey, if you read through the request again, it says how elevators have been made to go up and down, but one is wanted that can go laterally as well. That simple elevator script isnot at all what is being sought.
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
06-01-2005 17:20
Typical elevator scripts use the simple command, llMoveToTarget(). Most elevators go up and down, but there's nothing to stop you from making the target at a horizontal offset. Though, if you want an elevator that move sideways, you'll want to make av's 'buckle-in' by sitting first. Otherwise, they're likely to slam against the sides or fall out of the elevator.
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
06-01-2005 18:12
What DoteDote said. I'm just adding my $0.02 on a place to start.
_____________________
---
|
Sareth Amos
Registered User
Join date: 23 May 2005
Posts: 7
|
06-02-2005 08:07
From: DoteDote Edison Typical elevator scripts use the simple command, llMoveToTarget(). Most elevators go up and down, but there's nothing to stop you from making the target at a horizontal offset. Though, if you want an elevator that move sideways, you'll want to make av's 'buckle-in' by sitting first. Otherwise, they're likely to slam against the sides or fall out of the elevator. I might get a good laugh out of that one though  yea I think tonight when I get home I will see what I can start doing with scripting by looking at commands from other scripts and such. Im still interested in your script though Keknehv so let me know when you got a working copy.
|
Wark Cruyff
Kamizake Astronaut
Join date: 25 Oct 2004
Posts: 7
|
06-03-2005 18:35
I actually have an elevator in-game that will move from any point to any other defined point. Currently it uses call buttons to bring the elevator to a location and a dialog to send it to a target, but there is no reason it couldn't be changed for more generic target locations as you suggest. Hit me up in game and I'll give you a copy, Sareth.
|
Sareth Amos
Registered User
Join date: 23 May 2005
Posts: 7
|
06-04-2005 08:35
ok I put that basic elevator script into a chair for now until I get a better script but I cant get the bloody thing to work!! any ideas? I dont know how to post scripts  so if you contact me in game or tell me how I will show you what I have inputed
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
06-04-2005 18:56
Here's an even simpler one. I write ones like this every so often if they serve my purposes. The elevator will move laterally along the Y-axis of the object. integer SPEED = 1; // speed of elevator integer MAX_Z = 100; // maximum height integer MIN_Z = 20; // minimum height integer MAX_SIDE = 100; // maximum sideways movement integer MIN_SIDE = 20; // minimum sideways movement float IDLE_TIME = 20; // maximum idle time before script resets key passed_key = ""; // Key passed on from script
// Nothing much happens here. This just defines collision behavior default { state_entry() { // State cleanup llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_PHANTOM | STATUS_PHYSICS,FALSE); llStopMoveToTarget(); } collision(integer total_number) { if(llGetAgentSize(llDetectedKey(0)) != <0,0,0>) // I prefer using this method { passed_key = llDetectedKey(0); state move_it; } } }
// Our actual movement stuff happens here state move_it { state_entry() { llRequestPermissions(passed_key,PERMISSION_TAKE_CONTROLS); llSetTimerEvent(IDLE_TIME); } run_time_permissions(integer perm) { if(perm) { llSetTimerEvent(IDLE_TIME); // Reset the timer llTakeControls(CONTROL_UP | CONTROL_DOWN | CONTROL_LEFT | CONTROL_ROT_LEFT | CONTROL_RIGHT | CONTROL_ROT_RIGHT,TRUE,FALSE); // Fire up physics llMoveToTarget(llGetPos(),0.3); llSetStatus(STATUS_PHYSICS,TRUE); llSetStatus(STATUS_ROTATE_Z,FALSE); } } control(key id, integer level, integer edge) { llSetTimerEvent(IDLE_TIME); // Refresh our timer vector pos = llGetPos(); // Get our current location if(level & CONTROL_UP) { pos.z += SPEED; if(pos.z > MAX_Z) pos.z = MAX_Z; } if(level & CONTROL_DOWN) { pos.z -= SPEED; if(pos.z < MIN_Z) pos.z = MIN_Z; } if(level & (CONTROL_LEFT | CONTROL_ROT_LEFT)) { pos -= <0,SPEED,0> * llGetRot(); if(pos.x > MAX_SIDE) pos.x = MAX_SIDE; else if(pos.x < MIN_SIDE) pos.x = MIN_SIDE; if(pos.y > MAX_SIDE) pos.y = MAX_SIDE; else if(pos.y < MIN_SIDE) pos.y = MIN_SIDE; } if(level & (CONTROL_RIGHT | CONTROL_ROT_RIGHT)) { pos += <0,SPEED,0> * llGetRot(); if(pos.x > MAX_SIDE) pos.x = MAX_SIDE; else if(pos.x < MIN_SIDE) pos.x = MIN_SIDE; if(pos.y > MAX_SIDE) pos.y = MAX_SIDE; else if(pos.y < MIN_SIDE) pos.y = MIN_SIDE; } llMoveToTarget(pos,0.3); } timer() { llReleaseControls(); llSetTimerEvent(0.0); state default; } }
_____________________
---
|