Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
|
10-21-2005 02:47
Okay, I've set up myself a very simple (but pretty robust) set of automatic doors on my shop. When the user collides with an invisible object this object becomes phantom and the doors open for 5 seconds before closing again. The owner can click the doors to lock/unlock them.
However, one concern I have is should the sim ever crash, and the doors are open at the time, when the sim starts up again the doors may begin in their open position. This is a terrible thing, because it means that when they come to open, they will be opening EVEN MORE, causing them to move off too far in the wrong direction.
So what I want to do is have a simple check on state_entry whereby each door looks to see if it is open or closed (based on how far it is from it's parent object, the rail at the top) and close if it has somehow started open.
But I don't really know the best way to do this, I'm assuming I can use a vector and just check the co-ordinate that concerns me (the Y axis) which I can do, but I don't know how SL presents the result of it's llGetLocalPos. For example, if the door is normally at <0,0,0> in relation to it's parent, after it has moved two metres, will it's output be <0,2,0>? If so then I can do a simple comparison with a bit of luck.
Thanks for any help!
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
10-21-2005 02:53
Sim crashes don't reset scripts, AFAIK. From: someone But I don't really know the best way to do this, I'm assuming I can use a vector and just check the co-ordinate that concerns me (the Y axis) which I can do, but I don't know how SL presents the result of it's llGetLocalPos. For example, if the door is normally at <0,0,0> in relation to it's parent, after it has moved two metres, will it's output be <0,2,0>? If so then I can do a simple comparison with a bit of luck.
Entirely correct 
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|
Templar Baphomet
Man in Black
Join date: 13 Sep 2005
Posts: 135
|
10-22-2005 23:41
Just IMHO, but "auto-open" doors versus "no doors' is just showing off. 
|
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
|
10-23-2005 04:16
Except I can lock my automatic doors if I want to, and tint the windows so people can't see in while I redecorate my shop =)
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
10-23-2005 09:55
Well...let's see...
...I walk into a shop with no doors selling prefabs/custom building/scripts...I can look around and decide to buy or not to buy...but it sticks in my head that there were no doors on the shop...
...I walk into a shop with cool-lookin' automatic doors selling prefabs/custom building/scripts and think "Hey...this person can DO stuff..."
At least that's the way I look at things. I OFTEN look all over at the quality of a store before I buy anything in it.
(Yes, I know some stores are built by people other than those selling in them...)
|