How can I make it so if an object is listening on Channel 1 and I say
"/1 Switch to Channel 2"
it then listens on Channel 2 from now on?
These forums are CLOSED. Please visit the new forums HERE
Change Channels |
|
|
Over Sleeper
I Dream in LSL
Join date: 12 Jan 2006
Posts: 141
|
05-03-2006 09:37
How can I make it so if an object is listening on Channel 1 and I say
"/1 Switch to Channel 2" it then listens on Channel 2 from now on? |
|
Androclese Antonelli
Org. B-Day: 05/11/04
Join date: 25 Apr 2006
Posts: 96
|
05-03-2006 10:01
To make it permenant for the object, regardless of whether or not it is in your inventory or newly rez'd, you would have to store the channel on a note card and then read/write to the card based on your "Switch to Channel" command.
_____________________
The Sculpted Garden
Originally Born 5/11/2004 - New AV, Old Player. If you leave the game, don't delete your account, just make it 'free'. You'll lose your inventory like I did. *sniff* |
|
Over Sleeper
I Dream in LSL
Join date: 12 Jan 2006
Posts: 141
|
05-03-2006 11:23
Any example code or links to some example code?
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
05-03-2006 11:25
But you cannot write to a notecard from a script. Instead, you could store such information in the object description, using llGetObjectDesc and llSetObjectDesc.
Baron |
|
Neb Soyer
Really good looking.
Join date: 9 Apr 2006
Posts: 45
|
05-03-2006 11:43
But you cannot write to a notecard from a script. Instead, you could store such information in the object description, using llGetObjectDesc and llSetObjectDesc. Baron Yeah, Baron's right, I'm sure you could store it in lists too, but using llGetObjectDesc & llSetObjectDesc works just as well. Compiled and tested: CODE string temp; Oh yeah, to use; Example: /channel 1 It would then only listen on channel 1, so only; /1 /channel 0 Would get it back to normal chat again, or to another channel specified. _____________________
down in the ghetto.
|
|
Over Sleeper
I Dream in LSL
Join date: 12 Jan 2006
Posts: 141
|
05-07-2006 10:56
I tested and works great, but when you have many objects it does not help when I say /1 change channel 2 and they ALL change to channel 2 LOL.
How can I put this so the channel is on a notecard? That would solve my problems. /laughs |
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
05-07-2006 11:05
Rather than adding notecard functionality (which you don't need for something this simple), just set the object description to the desired channel you want, then reset the scripts in the object (or put in a reset command that calls llResetScript).
One problem with Neb's code if you want to take configured objects into inventory and rez them later with the changed channels, it will reset them to 0. If you don't need to do that, it's not a problem, of course. ![]() |
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
05-07-2006 11:10
How can I put this so the channel is on a notecard? That would solve my problems. /laughs CODE
this shall read card with name defined in channel_card_name and react accordingly when the result is received. Useful when you want to keep the item description clear for other purposes, i guess ^^; edit: you'll probably want to remove the old listen filter if one is present, so might be nice to store handle to listen filter somewhere there. |
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
05-07-2006 11:38
I tested and works great, but when you have many objects it does not help when I say /1 change channel 2 and they ALL change to channel 2 LOL. How can I put this so the channel is on a notecard? That would solve my problems. /laughs Why not check for the object name - or place a "trigger" next to the channel in the description ? Eg Decsription reads : 1,shoe Code to read description CODE
Then in your listen CODE
That way if oyu set the trigger to be shoe you have to say /1 shoe channel 2 To change the shoe to channel 2 - if you say /1 belt channel 2 It will be ignored. |
|
Over Sleeper
I Dream in LSL
Join date: 12 Jan 2006
Posts: 141
|
05-07-2006 11:47
What if the objects are named the same thing? Which they are.
This is why I need it ina notecard. |