|
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
|
08-27-2007 16:59
Lately I keep finding myself running into exceptions to rules and having to re-do something I've done because I was not aware of a certain limitation, or rule, or exception or what have you. With regard to llListen and the listen event... Is it okay to have two prims in the same linked object each with an llListen and an associated listen event, and on separate listen channels? I can't think of why this would be a problem but I tend to get in trouble every time I try to think. Thanking you in advance, Bartiloux Desmoulins
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-27-2007 17:25
I have several different huds I have built that will have different scripts with seperate listens in different linked prims. Just be thoughtful about lag and make a liberal use of pass touchs, link messages etc where ever you can cut down on the listens.
Also using pass touchs can make it so that one script can replace a handfull. I have one 9 button hud that had Flight Assist, Set target Elevation, Stop, Radar, Rez Object, and a teleporter that records the designated TP point info itself and only displays TP's for the sim you are in. It only has 3 scripts in it;
One set text to name the buttons as they change, one tp script and one script that does all the rest.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-27-2007 19:26
From: Bartiloux Desmoulins I can't think of why this would be a problem but I tend to get in trouble every time I try to think. No matter what don't get discouraged Bart, you'll get there. What I finally started to do back when I was learning my way around the scripts was to make a simple proof of concept script first for something new I was learning. Saves umpteen jillion hours of scripting time in the long run. Do something simple like put scripts in two objects and link them. Each script will use a diffecrent channel and one script will llOwnerSay "moo" when the object is touched and the other object will say "meow". Iron it out and get that simple set up working first and then go from there. This will show you how to keep the touches being passed etc. A lot easier to debug in steps then debug 150 lines of code at one time.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
08-27-2007 19:36
From: Jesse Barnett No matter what don't get discouraged Bart, you'll get there. What I finally started to do back when I was learning my way around the scripts was to make a simple proof of concept script first for something new I was learning. Saves umpteen jillion hours of scripting time in the long run.
Do something simple like put scripts in two objects and link them. Each script will use a diffecrent channel and one script will llOwnerSay "moo" when the object is touched and the other object will say "meow".
Iron it out and get that simple set up working first and then go from there. This will show you how to keep the touches being passed etc.
A lot easier to debug in steps then debug 150 lines of code at one time. aye break it down to each element and get those working right before moving on, if you need a listen set that all up before you start calculating xy positions, need a sensor? get it working exactly the way you want before moving on to the particle pointer ... ect and get used to making a debug flag in your scripts so you dont get dummy functions mixed in with your program as you make progress ... mine is //DEBUG! at the end of a line, stands out like a giant firecracker
|
|
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
|
08-27-2007 19:44
Wow! Thank you for all the words of encouragement as well as all the helpful hints in creating something big from a bunch of smaller pieces. I guess it goes along with that ol' saying, "The best way to eat an elephant is one bite at a time."
If I might bend your ear for one more question... In these replies references were made to "pass touch" and that is a phrase / concept with which I am unfamiliar. It sounds like a most handy thing and was wondering if someone might shed some light on what, exactly, that is? Thank you, again... Bartiloux Desmoulins
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-27-2007 20:20
Put this script in one prim: //script 1 default { touch_start(integer total_number) { llOwnerSay("Prim 1"  ; } } Then in the second prim place this one: //script 2 default { touch_start(integer total_number) { llOwnerSay("Prim 2"  ; } } Now touch each prim and they will do what they should and if you right click/edit and select prim 2 1st and then prim 1 and link them then they will still work right. But if you use this script in the second prim: //script 2 default { touch_start(integer total_number) { llPassTouches(TRUE); llOwnerSay("Prim 2"  ; } } Then no matter which prim you touch the linkset will still say "prim 1". Go to the wiki and look at llPassTouches for more info. (OOOOPS my bad. This is what I get for not scripting in several months. In this case with the llPassTouches script, if you touch prim 1 then it will say "prim 1" but if you touch prim 2 it will say "prim 1", "prim 2". The script did what it should and then also passed the touch to prim 1 so both scripts were activated.) Now this is a fun exersize but to be more efficient and to save on script load then you would reallt want to use just one single script and llDetectedLinkNumber to get the same results. Take the two scripts out of the prims and place this in just the 1st prim instead: //script 1 default { touch_start(integer total_number) { integer primnum = llDetectedLinkNumber( 0); if(primnum == 1) llOwnerSay("prim 1"  ; if(primnum == 2) llOwnerSay("prim 2"  ; } }
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Bartiloux Desmoulins
Think Kink? Think Bart!
Join date: 27 Sep 2005
Posts: 121
|
08-28-2007 19:01
Very interesting stuff! Thank you for the explanation. I can see this technique being very handy for a number of different applications.
Bartiloux Desmoulins
|