llSensor behaving oddly?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-15-2009 14:30
@OP: I sincerely suggest you rethink your position; without at least a compilable example of the script breakdown it's very likely no one will be able to guess the problem and assist you.
if you feel even that will endanger your IPR then you should realize as an 'experienced' programmer that the exercise will probably highlight the cause of the problem for you.
barring that ,there is nothing left for us to work with and you're effectively on your own. best of luck.
_____________________
| | . "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... | - 
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
Best of luck.
04-15-2009 15:35
What Void said.
After my first 20 years of programming experience, I was certainly capable of crafting a test bed for any problem I faced. I knew which parts were IP and which parts were prior art, so I had no problem protecting it. ~Boss
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
04-15-2009 21:26
Well, for starters, context does matter as Void pointed out. Secondly, you seem to keep referring to the sensor() and no_sensor EVENTS as STATES. Also, in your code, you have... default { // various states....
what exactly does that mean? Are you really changing states? Head for the wiki and read about what exactly a state, event, and function is. It's my guess that that's where you're having an issue. That, or maybe you need to be using llSensorRepeat(). I wrote this, took me all of about 2 minutes, no user defined functions (like yours has), no state changes likeyou keep talking about. Different states... for what? This works fine, and fires both the sensor and no sensor event. I have the range set to 10 meters, just walk 11 meters away and zoom in to see the no_sensor EVENT firing.... default { state_entry() { llSensorRepeat ("", NULL_KEY, AGENT, 10, PI, 1); } sensor (integer num_detected) { llSetText ("avatars detected",<1,1,1>,1); integer i; for (i=0; i < num_detected; i++) llSay (0, llDetectedName(i)); } no_sensor () { llSetText ("no avatars detected", <1,1,1>,1); } }
_____________________
My tutes http://www.youtube.com/johanlaurasia
|
|
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
|
04-16-2009 12:47
From: Argent Stonecutter There you go, traumatizing poor innocent variables by implying that some are more "valuable" than others! How do you expect positive outcomes from your software development environment with that kind of neanderthal approach? What can I say, I tend to favor the variables that have a value. 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-16-2009 14:07
From: Argent Stonecutter There you go, traumatizing poor innocent variables by implying that some are more "valuable" than others! How do you expect positive outcomes from your software development environment with that kind of neanderthal approach? but it's true, some of those variables are just plain worthless! for example: those orphaned variables? all they do is sit around taking up space and eating up resources... I say we get rid of them! =) ETA: and this folks, is why the Department of Children and Families frown on programmers having children...
_____________________
| | . "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... | - 
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
04-16-2009 14:41
From: Void Singer but it's true, some of those variables are just plain worthless! for example: those orphaned variables? all they do is sit around taking up space and eating up resources... I say we get rid of them! =) The best comment I ever saw in a program was this: /* Slay all the children! */ followed by a loop to kill a bunch of child processes. Later on in the same program was a wait() loop with a comment something like /* Bury zombie orphans */. And these were nothing more than simple and accurate descriptions of what the code was doing.
|
|
Ultralite Soleil
Registered User
Join date: 31 Aug 2006
Posts: 108
|
04-16-2009 14:59
And in a game I wrote, I had a legitimate use for functions named DestroyPlanets and AbortChildren O.o
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
04-16-2009 15:05
Geekiest comment I ever put in a program, in the middle of a list of hex bytes:
0x1E, 0x47, 0xB1, // You're my only hope... 0xE1, ...
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-16-2009 15:34
thanks for the laugh =) seen in a busy loop that was polling for a value change from zero //-- wait for it... do{ //-- check some variable; }loop until (Hell_Freezes_Over); or my version that was waiting in a touch state to trigger map destination dynamically... do{ if (llGetObjectDesc() != ""  imWaiting = FALSE; }while (imWaiting); ETA, I forgot my favorite one I stuck in a cleanup function that was removing avatars from a timeout list //-- euthanize the old people... and another from a list capping function //-- thin the herd
_____________________
| | . "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... | - 
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
Herd operations...
04-16-2009 16:06
link_message(integer sender, integer number, string message, key id) { if (0xFEEDBEEF == number) { //-- grow the herd... } if (0xDEADBEEF == number) { //-- thin the herd... } }
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
04-16-2009 16:23
That reminds me of one 64-bit magic number ... 0xFEEDFACEC0EDBABE
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-16-2009 18:44
this is why we need a humor section on the LSL Portal too =) const FatalError = 0xCA11B055; if (Danger = 0xFED5CA11){ drop table all; } and much more fun.... http://www.nsftools.com/tips/HexWords.htm
_____________________
| | . "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... | - 
|