Kipz Arado Posted August 3, 2011 Posted August 3, 2011 So I've been playing SL since the beginning of 06, and i've been off and on with scripting. Most of the time I do minor things like scripting things for friends, customers, and just anyone really. However, to keep my question short, recently my friend and I have decided to go out and buy a quarter of a sim. Anyways, my friend built himself a house, and he was wondering if i could script him some buttons that he could click on to manage different settings in his house, be it the opacity of the windows, or the locking of a few doors.To get to my question, I know one of the most important things in reguards to scripting would be the efficiency of it. I could easily script this several different ways, but to not be a "noob" about it, how would be the best way to make all of these object communicate with each other? I could use Linked Messages but the items would have to be linked, what if he has a big house too big to link everything together? I thought.. I could use listener scripts, I don't want listener scripts all over his house, the sim wouldn't like me very much. Is there possibly another way that I am forgetting?I am also sorry for the wall of text for a fairly simple question.
Void Singer Posted August 3, 2011 Posted August 3, 2011 listens should be fine for oversized unlinked builds, as long as they are tighlty filtered. you can do distributed linked listeners to optimize it, but they aren't very good for things you might relink.... in that set up each object has a single script that listens, and re transmits the message as a link message... optimally built into one of the scripts that is doing one of the effects.... I did a similar setup for a regionwide lighting system. link messages only would be optimal of course, but it's not always doable in larger builds
Kipz Arado Posted August 3, 2011 Author Posted August 3, 2011 Thank you so much for the reply! Yeah, I've wanted to go with link messages the most I possibly could. I'm glad to hear that listener scripts won't be THAAT bad if they are filtered properly. Would it be possible to have doors still open and close while being linked to the button on a wall. Last time I checked, a rotation function will rotate the root prim, unless I just did it wrong, which was very possible. I also know exactly what you mean when it comes to the order of linking prims. I did that for a HUD, and the second to last linked prim did this when touched.. etc.. but itll be way to hard for a large home always changing.
Void Singer Posted August 3, 2011 Posted August 3, 2011 rotation works on the whole object if the root prim is targeted, otherwise on the individual child... you can check out the basic hinge script in the forum library for the basis of a door that works in both scenarios. it can be rewritten to work from a different prim, but takes a little extra math.
NicholasKulp Posted August 3, 2011 Posted August 3, 2011 If it's too large to link... were you thinking of putting a listen script in each window? Because couldn't you simply split up the built and have them both listen for the same thing and then send the message out to the child prims (windows). Example: Left side of house, all windows attached, and a pannel to adjust settings. Right side of the house also has all the windows attached, but separate. When a user clicks the pannel on the left side of the house, it sends a linked message to it child prims (now that side's windows are changed) and it then sends out one message so that it can communicate with the other side of the house. One window on the other side then has a script running to search for these messages, and it then sends it out to all linked prims. As opposed to: Panel sending out a message to xx number of windows, all running a script waiting for a message. Wouldn't this make less work for the sim?
Void Singer Posted August 3, 2011 Posted August 3, 2011 =) that was my second suggestion above, but it has a draw back of not handling de/re linking perfectly. might work for commercial builds, but not so much for custom ones that are likely to change
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now