|
Roofus Kit
Registered User
Join date: 12 Dec 2006
Posts: 10
|
02-17-2008 15:14
Parent script listening on channel 235 integer listen_handle; default { state_entry() { listen_handle = llListen(235, "", llGetOwner(), "" ; } listen( integer channel, string name, key id, string msg ) { if (msg == "sheath" llMessageLinked(-1, 0, "", "" ; else if (msg == "draw" llMessageLinked(-1, 1, "", "" ;
} on_rez(integer param) { llResetScript(); } changed(integer mask) { if(mask & CHANGED_OWNER) { llResetScript(); } } }
Child script listening for MessageLinked default { on_rez(integer sides) { llResetScript(); }
link_message(integer sender_num, integer num, string str, key id) { if (num=1) llWhisper(0,"DRAW!" ; else if (num=0) llWhisper(0,"SHEATH!" ; } }
The error HAS to be in the listen portion becuase I can replace the the Listen script with one that works on touch and the MessageLinked works perfectly. I'm about to shave my head and start a monastic lifestyle here people. PLEASE HELP!
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
02-17-2008 15:15
num=1
rather than
num == 1
perhaps
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
02-17-2008 15:16
Er, by the way, I'm a bit confused as to why you might want those in different scripts. Why not have it all in one script?
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Roofus Kit
Registered User
Join date: 12 Dec 2006
Posts: 10
|
02-17-2008 15:28
From: Ordinal Malaprop Er, by the way, I'm a bit confused as to why you might want those in different scripts. Why not have it all in one script? The idea is to setalpha in childprims without setting it in an entire linked set. I changed the it to trigger a whisper for testing purposes.
|
|
Roofus Kit
Registered User
Join date: 12 Dec 2006
Posts: 10
|
02-17-2008 15:30
From: Ordinal Malaprop num=1
rather than
num == 1
perhaps DEAR GOD it worked, I knew it would be that simple and now i feel retarded.
|
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
02-17-2008 16:22
Some of the cracks here recommend doing it this way:
if(1 == num){...} instead of if(num == 1){...}
because when you forget the 2nd equals-sign
if(1 = num){...} would throw an error where if(num = 1){...} doesn't.
Reason:
You can't assign a variable to 1 (as in 1 = num) but you can assign an integer to a variable (as in num = 1).
|
|
Krista Chaffe
Registered User
Join date: 16 Jun 2007
Posts: 96
|
02-18-2008 08:44
I wish I had a dollar for every time I've done the same thing.
|
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
02-18-2008 09:41
if( bank_account = number_of_times_i've_done_that ) 
|
|
British Knight
Registered User
Join date: 15 Apr 2006
Posts: 4
|
02-18-2008 10:46
From: Deanna Trollop if( bank_account = number_of_times_i've_done_that )  bank_account == 0; 
|