Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Disccusion: A different kind of DOOR...Air-Lock

Mitzpatrick Fitzsimmons
Neurotican Mage
Join date: 20 Sep 2004
Posts: 62
05-07-2005 17:37
OK... Here is a neat type of door I use in some ODD builds of mine.

Just read the "EXTRA-LONG" description in the script, and if you still have questions, I would be happy to answer them.

Since this is the first script I am posting, it would be nice to get some feedback (good{YAY} or bad{BE NICE})
CODE
//_____________________________________________________________________

//Air-Lock Door Script by Mitzpatrick Fitzsimmons
//********************** DESCRIPTION *************************
// This door script differs from most, as it uses the
// llSetPrimativeParams function to simulate an open
// or closed door. It can be used with any Prim Type,
// however, the script will need to be modified slightly.
// I find the best effect is with BOX or CYLINDER, as it
// reminds me of a Star-Trek type operation.
// The benefits with this type of door is that no rotation
// factors need to be calculated (as there is no real movement)
// but it might not be the best solution for a "HOUSE-TYPE" door.
// I use this on my space-ship, and it looks pretty cool IMHO.
// Note that the prim you use will need to be rotated 90 on the X
// or Y axis for a door that you would walk through, or if you plan
// to jump/fly through you can leave it as is.

// This script is set to the owners chat commands on channel 1
// but can easily be modified to a touch responce or other method.

// Feel free to modify this script as you see fit, and NO you
// dont need to give me any credit, OR leave this 'EXTRA-LONG'
// DESCRIPTION in it....heheh :)



//---------------------------------------------------------------------------------- GLOBAL VARIABLES

// I find it is easier to copy the UUID of your sounds and then set them as Globals rather than to have
// mulitple copies stuffed inside your prims... just a thought. You dont need to use sounds, but it's more fun.

key DOOR_OPEN_SOUND=" "; //Paste the UUID of your favorite door sound between the quotes
key DOOR_CLOSE_SOUND=" "; //Paste the UUID of your favorite door sound between the quotes

//---------------------------------------------------------------------------------- FUNCTIONS

OPEN_DOOR() {
llPlaySound(DOOR_OPEN_SOUND, 1);
llOwnerSay("Door open!");
// Here is where the door open effect comes into play. the setting is 0.60 (just above half) play around with it to suit your needs.

llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <0.0, 1.0, 0.0>, 0.60, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
}

CLOSE_DOOR() {
llPlaySound(DOOR_CLOSE_SOUND, 1);
llOwnerSay("Door closed!");
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
}

//---------------------------------------------------------------------------------- MEAT & POTATOES

default
{
state_entry() {
llListen(1,"",llGetOwner(),""); // Listens for the OWNER on channel 1
llOwnerSay("Activated"); // Just something I use to know the door is working. You can leave this out if you want.
}


listen(integer channel, string name, key id, string message) {

if(id==llGetOwner()) { // WE WILL ONLY LISTEN TO THE OWNER
if( message == "open door1" ) { // I number doors so I can call on just one specific door at a time
OPEN_DOOR();
}

if( message == "open all" ) { // For multiple doors to open simutaneously
OPEN_DOOR();
}

if( message == "close door1" ) {
CLOSE_DOOR();
}

if( message == "close all" ) {
CLOSE_DOOR();
}

}else
{
llSay(0, "You are not the OWNER." ); // In case someone else trys to open your door
}
}
}



// Heheh...it seems I am a little behind the times...but I just got turned on to llOwnerSay, which is a great thing to use instead of llSay/llWhisper...so Im going to be updating alot of my scipts... including this one :) Thanks 2 Jiffies !
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
05-13-2005 09:57
/15/6b/45502/1.html
_____________________
i've got nothing. ;)
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
05-13-2005 12:28
From: Mitzpatrick Fitzsimmons
OK... Here is a neat type of door I use in some ODD builds of mine.


Neat idea. :cool:

It made me realize that there are potentially many interesting door effects you could get by manipulating other parameters to llSetPrimitiveParams(), such as cutting, twisting, shearing, changing topsize.

Too bad that it has a 0.2 second delay built in.
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Lefty Belvedere
Lefty Belvedere
Join date: 11 Oct 2004
Posts: 276
05-13-2005 19:15
i've used a touch cut for cylenders as doors for a while. It works well but crashes me every 100th use or so. Not sure why but it's the only script that seems to crash me. Once in 100 clicks isn't too bad but still something i curious about.

~Lefty
Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
05-13-2005 21:05
From: Nada Epoch


ummm, why are you posting the link to the thread that your on on every thread?
_____________________
Other than that, Mrs. Lincoln, how was the play?
Saul Lament
Mean & Evil
Join date: 24 May 2004
Posts: 163
05-14-2005 00:10
From: Douglas Callahan
ummm, why are you posting the link to the thread that your on on every thread?

Due to the typo, I am not quite sure what your asking here - but I will give it a stab.
Nada Epoch is our moderator for the scripting threads. The moderator approves all script posts in the script library, then creates a discussion thread for that script, then creates a back-link in the discussion thread to the original script post.

#1 - Somebody posts a script to the script library.
#2 - Nada approves the post.
#3 - Nada creates a thread in the library with said script.
#4 - Nada creates a thread in the scripting tips forum to discuss said script.
#5 - Nada posts the link to the scripting tips thread in the script library forum.
#6 - Nada posts the link to the script library thread in the scripting tips forum.

That is my understanding on how things work. Now my head hurts.
Dragon Steele
Artist/conservationist
Join date: 3 Jan 2005
Posts: 183
05-18-2005 20:11
From: Saul Lament
Due to the typo, I am not quite sure what your asking here - but I will give it a stab.
Nada Epoch is our moderator for the scripting threads. The moderator approves all script posts in the script library, then creates a discussion thread for that script, then creates a back-link in the discussion thread to the original script post.

#1 - Somebody posts a script to the script library.
#2 - Nada approves the post.
#3 - Nada creates a thread in the library with said script.
#4 - Nada creates a thread in the scripting tips forum to discuss said script.
#5 - Nada posts the link to the scripting tips thread in the script library forum.
#6 - Nada posts the link to the script library thread in the scripting tips forum.

That is my understanding on how things work. Now my head hurts.



LOL That just seems to be a convoluted way of doing it, But I guess they have there reasons. lmao

Oh yah What's a UUID??
_____________________
Boycot the spam farms and the ads on them. Ban the spamers from your land. Look for the clocktower network for a blacklist to put on you land that is grid wide.
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
05-20-2005 16:44
From: Dragon Steele
Oh yah What's a UUID??


UUID = Universally Unique IDentifier = key

Well Dragon, as you may know, every object in SL has its own unique key. Textures and sounds also have keys. Scripts can reference keys, or UUID's, instead of referencing an inventory object.

Why would you do such a thing? There are a few reasons...

1) With a key, you don't have to worry about forgetting to put a sound in a scripted object and getting an error message.

2) If you want to sell a copyable object that uses textures, such as a particle generator, but don't want people to steal your textures, a UUID will do the job perfectly.

Also, instead of doing an owner check on something that's already listening to the owner, how about just doing it, because you know it's the owner?
Dragon Steele
Artist/conservationist
Join date: 3 Jan 2005
Posts: 183
05-21-2005 07:35
From: Keknehv Psaltery
UUID = Universally Unique IDentifier = key

Well Dragon, as you may know, every object in SL has its own unique key. Textures and sounds also have keys. Scripts can reference keys, or UUID's, instead of referencing an inventory object.

Why would you do such a thing? There are a few reasons...

1) With a key, you don't have to worry about forgetting to put a sound in a scripted object and getting an error message.

2) If you want to sell a copyable object that uses textures, such as a particle generator, but don't want people to steal your textures, a UUID will do the job perfectly.

Also, instead of doing an owner check on something that's already listening to the owner, how about just doing it, because you know it's the owner?


Wow that's Cool, I never knew this Thank You. Now How does one find these UUID?

Is there any kind of reference manual or the equivalent there of for All this nifty stuff?
_____________________
Boycot the spam farms and the ads on them. Ban the spamers from your land. Look for the clocktower network for a blacklist to put on you land that is grid wide.
Naztee Thatch
Registered User
Join date: 30 Apr 2005
Posts: 8
05-23-2005 18:29
Is there anyway to slow the hollowing process down so that it gives a more "iris" effect?
Davo Huber
Coffee!
Join date: 28 May 2004
Posts: 8
05-31-2005 08:28
Well you could just put in more llSetPrimitiveParams and make it open slower, not the best way to do it but works
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
05-31-2005 08:36
From: Davo Huber
Well you could just put in more llSetPrimitiveParams and make it open slower, not the best way to do it but works


I was thinking about this, too. Yes, this is the most obvious approach. However, llSetPrimitiveParams has a built in delay (0.2 sec?), so I think it won't be possible to have it move smoothly in a timely manner.

My best guess at this point is to use an iris animation. You could apply an animation with an expanding alpha hole in the middle. Just ditch the hollowing altogether and turn the whole thing phantom when the animation is complete.
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Frans Charming
You only need one Frans
Join date: 28 Jan 2005
Posts: 1,847
05-31-2005 08:56
Great Idea.
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
05-31-2005 09:41
I actually do have a decently smooth iris-door that's made out of a sphere... You can see it in action at Club Element, and it was at elka Lehane's domicile.

It's very possible to do it without any extra animations. You can contact me later if you'd like to see it in action.

From: Dragon Steele
Wow that's Cool, I never knew this Thank You. Now How does one find these UUID?

Is there any kind of reference manual or the equivalent there of for All this nifty stuff?


It's easy, if you have a texture or sound with full permissions, just right click it and select the option "Copy UUID to the clipboard", and then you can paste it into scripts. About the manual... There IS a wiki that has tons of this kind of stuff on it.