Thanks in Advance, DocThese forums are CLOSED. Please visit the new forums HERE
Door with rotation switch script |
|
|
DoctorWho62 Oh
Registered User
Join date: 4 Jun 2007
Posts: 12
|
05-25-2009 05:58
Hi all as i am a dunce with scripts lol, oh i can change and add lines to them but thats about it at the moment, I was wondering if any one has a door script which will open with a switch using the rotation on the switch making it like a flip switch would be most greatful for the help
Thanks in Advance, Doc |
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-25-2009 11:41
you are looking for a door script that works like a light switch (two positions)? most all of them here will do that, the simplest uses a half cut prim and the following lines
rot_90Dz.s *= -1; llSetLocalRot( rot_90Dz * llGetLocalRot() ); where rot_90Dz is predefined as something like rot_90Dz = llEuler2Rot( <0.0, 0.0, 90.0> * DEG_TO_RAD ); now if you meant something like a two way swing door, that's a little different, but one logic (using +/-1 for the direction of opening) is CODE
_____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
DoctorWho62 Oh
Registered User
Join date: 4 Jun 2007
Posts: 12
|
Thanks
05-25-2009 12:54
I think my words may be misleading slightly i need a door script that opens and closes from a switch. The switch needs to, when touched act like a flip switch. So therefore a script for the door and a script for the switch using a chat channel I would guess.
![]() Sorry if I have misunderstood or made any one understand. |
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
05-25-2009 15:20
ah, that should be easy enough, you can either have the switch linked to the door. and when the switch is clicked, it'll send a link message to the door and the door can open/close when it received the message. you can also have the switch separate. when clicked it can say a command on a specific channel. the door will need to listen on that same channel. when it hear the command, it'll open/close depending on the command.
_____________________
Dark Heart Emporium
http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020 want more layers for tattoos, specifically for the head? vote here http://jira.secondlife.com/browse/VWR-1449? llDetectedCollision* Functions similar to touch http://jira.secondlife.com/browse/SVC-3369 |
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-25-2009 15:54
And if you want the switch to look like it has been flipped, physically, then you just arrange to have the toggle (the little rectangular prim that moves when you touch it) rotate on a horizontal axis as part of the same touch_start event that sends the chat message that activates the door. Assuming that the toggle is supposed to rotate around its X axis, for example, you'd write something like
CODE
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....
![]() Look for my work in XStreetSL at |
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-25-2009 18:09
every door script in existence can be modified to be triggered by whatever you want... instead of a touch handler, you just use your handler of choice... listen, link message, collision, sensor, http response... whatever... and have a different script trigger that handler.
_____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |