|
AnnMarie Coronet
Registered User
Join date: 20 Nov 2006
Posts: 39
|
03-31-2007 09:53
I'm building my own house (and planning to be able to sell my designs and construction parts), and I've come up with a 'work-in-progress' house control protocol, for use with a house terminal and/or HUD. The idea is that if you use one of my houses, or use the windows, doors, (and eventually servos - mini-objects you can configure to control your own design windows/doors/etc), if you are authorised, you can do everything from opening one window, opening up the ground floor, just the windows in the lounge, etc. The plan for the HUD is that you could do this even if you were sim's away ( so you could let your friends into the house while you stopped off at a shop before returning etc)
So I have the windows and doors scripted to work based on frame and panes/doors... i.e. the windowframe is what deals with the commands of the house terminal, and it knows its own panes to open them etc.
so far so good, but if people use my windows in their own construction, and link two windows into the same section of house, the link numbers and roots go out the window. So suddenly how does one frame know which Panes to talk to, and the panes which frame to listen to. Is there any way to identify wether an object, in this case the window pane(s), is inside the hull of the hollowed cube (window frame)?
|
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
03-31-2007 10:50
From: AnnMarie Coronet Is there any way to identify wether an object, in this case the window pane(s), is inside the hull of the hollowed cube (window frame)? Well, if the pane and frame are concentric, or nearly so, you can use llGetPos() or llGetLocalPos() to return their respective positions, and llVectDist() to find the distance between those positions, and test wether they are within some specified margin. However, llGet[Local]Pos() has to be called from a script within the prim, and those values will have to be communicated to a common "controller" prim via link_message for comparison. Unfortunately, there's no llGetLinkPos() function.
|
|
bucky Barkley
Registered User
Join date: 15 May 2006
Posts: 200
|
03-31-2007 12:33
An idea ... forget the positions of things, and work with identifiers...
Make unique names for your prims. Upon rezzing, build up a mapping of link numbers to prim names. Have an incoming command for "window_pane_sw_1"? Look up the link and fire off the command.
There's a lot of great hidden power in choosing good names for prims. (as opposed to 100 prims named 'Object') ...
Sure, we dont have llMessageLinkedByName(), but lookups on a house with, say 5 doors, 10 windows, 5 lights, etc. should not be too bad.
_____________________
Bucky Barkley -- Mammal, Scripter, Builder, Lover
|
|
AnnMarie Coronet
Registered User
Join date: 20 Nov 2006
Posts: 39
|
03-31-2007 12:56
Thank you both for your suggestions.
I've going to be using the Descriptions to provide the 'path' for the type and the location (eg. HSYS:WINDOW:G:LOUNGE:A) so if the controller sends out a message for a window A in the Lounge, it'll recognise it.... perhaps a mix if the two suggestions would allow the panes to identify the frame surround, and then they could take on an extended name based on the surrounding frame's name.
|