These forums are CLOSED. Please visit the new forums HERE
Clicking one prim will move other prims...possible? |
|
|
Groovdafied Jie
Registered User
Join date: 28 Apr 2007
Posts: 15
|
06-07-2007 17:36
I have two sliding doors, and when I click one of them I would like both of them to slide open in opposite directions. HOw can this be done?
|
|
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
|
06-07-2007 17:42
I have two sliding doors, and when I click one of them I would like both of them to slide open in opposite directions. HOw can this be done? very possible, but this should be in the Scripting Tips forum. _____________________
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 |
|
Groovdafied Jie
Registered User
Join date: 28 Apr 2007
Posts: 15
|
06-07-2007 18:14
very possible, but this should be in the Scripting Tips forum. Sorry...I wasn't able to locate it for some reason...could someone help me with this though? |
|
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
|
06-07-2007 18:57
Sorry...I wasn't able to locate it for some reason...could someone help me with this though? /54/1.html _____________________
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 |
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
06-07-2007 19:04
Sorry...I wasn't able to locate it for some reason...could someone help me with this though? You weren't able to locate what? The scripting forum? Scroll down a little. All the forums in the Content Creation section are listed in alphabetical order. Scripting starts with S so it falls a bit further down the page than Building, which starts with B. Oh heck, here's the link: /54/1.html Anyway, the most common way to do what you're asking about is to use a 3-prim solution. The parent prim will be the "track" for the two doors (it doesn't really need to be track shaped, but I just call it that since in RL, what makes a pair of sliding doors actually a pair is the fact that they're both on a single track). The track prim will contain the main script that talks to the two door prims. Each of the door prims will have a movement script that triggers on command from the track prim. That's the general setup. You could actually do it with just two prims instead of 3 if you want, but the scripting would be a little more complicated. For the specifics of how to write the scripts, I'm sure someone in the scripting forum can help you. Again, the address is /54/1.html _____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested. |
|
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
|
06-07-2007 19:30
Oh heck, here's the link: Bravo to you, Chosen. LOL You have more patience than me (and quite a bit more sarcasm). ![]() _____________________
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 |
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
Some starting points for moving multiple prims
06-08-2007 07:53
The scripting forum can give you specifics, but here's some useful starting points, from a builder's perspective.
Method 1: (3 prims - linked) * Two door prims that move, and one invisible prim linking them as the root prim. * Each door has a listener script in it that does the door movement. * The root prim (the invisible track) has a script in it that accepts a touch event and used llMessageLinked to send a command to the two door prim scripts, causing them to open or close. It could also include a timer so the doors close on their own after a set period of time if left open. Method 2: (2 prims - linked) * Two door prims that move * Each door has a listener script in it that does the door movement. * The root prim (one of the doors) has a script in it that accepts a touch event and used llMessageLinked to send a command to the two door prim scripts, causing them to open or close. It could also include a timer so the doors close on their own after a set period of time if left open. The difference between methods one and 2 are nominal. Both would use llSetPos and a relative position from the current position in the linkset to effect movement. In essence, you have to reposition a prim in a linkset, while it is still part of the linkset. In short, method 1 really doesn't need the extra prim. Method 3: (2 or more prims per door - unlinked between the doors) * Two door prims (or linksets) that move. Each door is a seperate linkset. * Each door has a listener script in it that does the door movement. * Both doors have a script in it that accepts a touch event and uses llWhisper, llSay, llShout, or llRegionSay on a non-zero channel to send a command to the two door prim scripts, causing them to open or close. It could also include a timer so the doors close on their own after a set period of time if left open. In this method, you can use LSL commands that move the whole linkset, You can also move complex doors that require more than one prim to model. It has the down side that each door has an open listener script that will add somewhat more to lag. However, this could also affect more parts at once. For example, opening all the gunports on the starboard side of a frigate, or opening several pairs of curtains in a room. _____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
|
Abba Thiebaud
PerPetUal NoOb
Join date: 20 Aug 2006
Posts: 563
|
06-09-2007 05:39
Bravo to you, Chosen. LOL You have more patience than me (and quite a bit more sarcasm). ![]() Wit, not sarcasm. Sarcasm (to me anyway) denotes lack of empathy. Wit, on the other hand infuses the empathy with humor to make the point. The scripting forum can give you specifics, but here's some useful starting points, from a builder's perspective. Method 1: (3 prims - linked) Method 2: (2 prims - linked) Method 3: (2 or more prims per door - unlinked between the doors) And Method 4 (one prim operates as both doors) can be found in the scripting forum as a free to use/modify script. To quote one of my favorite forum posters, oh heck, here's the link : /54/53/150641/1.html. And BTW, Ceera, you're one of my favs too, you just got the full on bracketslashquoteclosebracket dealiebopper. A _____________________
http://www.ponystars.com/abbathiebaud Pony Up.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
06-09-2007 07:21
Thinking about Method 3, for modest-sized doors, it would be possible now to do that with all the prims in a single linkset, using the relatively recent llSetLinkPrimitiveParams() function, doing away with the listeners. It actually wouldn't be too difficult for *sliding* doors, but for rotating, well, I'd leave that as an exercise for the reader.
But unless you're really stuck with multiple prims per door, Seagel's single-prim slider, cited above, is very cool. |