Scripting Tutorial 01

From Osgrid Wiki
Jump to: navigation, search
 [12:04]  Fu Barr: we'll give it a few more minutes and we'll start.
 [12:04]  Fu Barr: we'll use text so people can coopy the log
 [12:05]  Fu Barr: i'll try and keep the spelling issues to a minimum :)
 [12:05]  Fu Barr: feel free to rez a single chair, but a field of chairs created a 'classroom' state that i dont really need.
 [12:06]  Fu Barr: also you'll all need to rez a cube to work with and that's hard to do from a few rows back in class :)
 [12:07]  Fu Barr: okay - lets get started other will just have to join in later
 [12:07]  Fu Barr: so first off, i'm going to do a series of chats.
 [12:07]  Fu Barr: this will be the first
 [12:08]  Fu Barr: we're going to start at the very berginnink. for two reasons
 [12:08]  Fu Barr: yes, many of you may have mucked around with some code and I know that at least one of you is a master
 [12:08]  Fu Barr winks at total
 [12:09]  Fu Barr: but, in order to make sure I know what you all _should_ know because I told you The One True Way
 [12:09]  Fu Barr: i'm starting at the beginning for my own sanity.
 [12:10]  Fu Barr: and 2. some people might need to start at the beginning coz they not masters, yet.
 [12:10]  Fu Barr: so that's my first housekeeeping announcement
 [12:10]  Fu Barr: the second is:
 [12:10]  Fu Barr: we're going to try and teach 3 different things.
 [12:11]  Fu Barr: 1. basic programming stuff that's valid for many different languages.
 [12:11]  Fu Barr: 2. programming stuff that is specific to SL/OpenSim
 [12:11]  Fu Barr: 3. some programming best practices
 [12:12]  Fu Barr: and example of thing 1. is 'how do i add two numbers together'
 [12:12]  Fu Barr: an example of 2. would be 'how do i react to a click on a cube in opensim'
 [12:13]  Fu Barr: an example of 3. might be 'try and give sensible names to your variables, that way you'll need less comments'
 [12:13]  Fu Barr: so there you have it.
 [12:13]  Fu Barr: we're starting from the beginning to keep me sane. we're going to do basic programming, basic opensim related stuff and hopefully pick up some good habits.
 [12:14]  Fu Barr: anyh questions so far?
 [12:15]  Fu Barr: please do intertupt me with 'stupid questions' - if they are really stupid i'll make fun of you in front of everybody, if they are relevant I'll answer to the best of my ability. sont be shy :)
[12:15]  Fu Barr: *dont
[12:15]  Snakedance Moonwing: im full of stupid questions :D
[12:15]  Snakedance Moonwing: no worries
[12:15]  Fu Barr: okay so let's get going
[12:15]  Fu Barr: if you havent done so please rez a cube
[12:16]  Fu Barr: so i've coloured mine garish pink - so everybody can see it's mine etc.
[12:16]  Fu Barr: now, the first thing to understand about scripting in opensim is the answer to 'where does my code live'
[12:17]  Nick.Envoy is Online
[12:17]  Foxx Prim: Script running
[12:17]  Fu Barr: so i'm assuming that most of us have added a script of some sort to a prim.... and that would be in the prims 'content' tab.
[12:17]  Ni Lemon: yay!
[12:17]  KU - cube: Script running
[12:17]  Fu Barr: if you havent done so before, please switch to your prims 'content' tab and use the 'new script' button to add a script
[12:17]  Object: Script running
[12:18]  Romulun Rockett: yes :)
[12:18]  Object: Script running
[12:18]  Object: Script running
[12:18]  Foxx Prim: Script running
[12:18]  Foxx Prim: Edited by Foxx
[12:18]  Object: Script running
[12:18]  Hans: Script running
[12:18]  Fu Barr: you'll see the prim add a script and 'tell us all that it's running
[12:18]  Object: Script running
[12:18]  Fu Barr: so far so good?
[12:18]  Object: Script running
[12:18]  Fu Barr: if you've given your prim a name.. it'll echo on the chat
[12:18]  KU - cube: Script running
[12:19]  Mirror Amorasi is Offline
[12:19]  Object: Script running
[12:19]  Ni's prim: Script running
[12:19]  Object: Script running
[12:19]  Boogie Box: Script running
[12:19]  Object: Script running
[12:19]  Fu Barr: now, before we move on... we need to maybe note that the script isn;t running in the prim
[12:19]  Object: Hello World, Hello dan, Hello all
[12:19]  Fu Barr: yes it sort of 'lives' in the prim
[12:19]  SillyAv: Hello World, Hello dan, Hello all
[12:19]  Fu Barr: but it's running on the opensim server
[12:19]  i  Like Hans: Script running
[12:19]  i  Like Hans: Script running
[12:19]  Sausage: functional
[12:19]  Script Class: Script running
[12:19]  Fu Barr: there's a subtle difference.
[12:20]  Fu Barr: anybody want to try and tell us what that might be?
[12:20]  Fu Barr: script running in prim vs script running on server
[12:20]  Fu Barr: anybody?
[12:20]  Romulun Rockett: when you say the open sim server, do you meen the server for the sim were in or the main OSG server that all the sims link to????
[12:21]  Fu Barr: server for the local region, the romete ones are asset servers...
[12:21]  Fu Barr: *remote
[12:21]  Ni Lemon: both servers I think
[12:21]  Ni Lemon: our own and osg one
[12:21]  Fu Barr: though there's the local assets too
[12:21]  Fu Barr: the running script is in the LOCAL server
[12:21]  Romulun Rockett: ok thanks :)
[12:21]  Jeff Hall: i thought it was loca server only
[12:21]  Jeff Hall: yay i got it
[12:21]  Fu Barr: the script might be stored on the asset server
[12:22]  Fu Barr: anyhow the idea i want to convey - even though it's v premature is that scripts compete for local server CPU and RAM
[12:22]  Fu Barr: they dont run in your viewer
[12:22]  Fu Barr: except certain functions.... but more about that later
[12:22]  Kelso.Uxlay the server allocates resources and time slices
[12:23]  Fu Barr: so when you script you have to keep in mind that your script might work well on your own region where there's nothing going on but lag like   hell someplace fine
[12:23]  Fu Barr: *else
[12:23]  Fu Barr: so - our small scripts wont be affected but bigger complex ones will be.
[12:24]  Fu Barr: ayhow - just wante to mention it before we got started.
[12:24]  Fu Barr: now.
[12:24]  Romulun Rockett: ok :)
[12:24]  Kelso.Uxlay noted
[12:24]  Fu Barr: first thing we're going to learn is how to be nice.
[12:24]  Ni Lemon: question
[12:24]  Fu Barr: polite even
[12:24]  Fu Barr: our scripts are chatting inpublic
[12:24]  Fu Barr: loudly
[12:25]  Repudiator quann is Online
[12:25]  Fu Barr: we're going to open the scripts we added and change one 'function' so the prim only talks to its owner
[12:25]  Fu Barr: open the script
[12:25]  Fu Barr: in the contents tab
[12:26]  Fu Barr: and change the llSay() function to llOwnerSay()
[12:26]  Fu Barr: just add the word 'Owner' to the existing llSay
[12:26]  SillyAv: Hello World, Hello dan, Hello all
[12:26]  Fu Barr: save your script - and you'll see the prim respond - but everybody else wont
[12:27]  Foxx Prim: Edited by Foxx
[12:27]  SillyAv: Hello World, Hello dan, Hello all
[12:27]  Fu Barr: lol - well, if you added the Owner in the right place it will :)
[12:27]  Total Sorbet: you will need to delete the 0,
[12:27]  Fu Barr: so llSay, becomes llOwnerSay
[12:27]  George Equus: Mine say ERROR
[12:27]  Fu Barr: i know
[12:27]  Jeff Hall: yes have to remove the 0
[12:27]  Fu Barr: i want there to be an error
[12:27]  SillyAv: Hello World, Hello dan, Hello all
[12:27]  SillyAv: Hello World, Hello dan, Hello all
[12:27]  Fu Barr: that way i can teach you the next thing :)
[12:28]  George Equus: Ahh
[12:28]  Fu Barr: there's an error
[12:28]  Fu Barr: it's broken
[12:28]  SillyAv: Hello World, Hello dan, Hello all
[12:28]  Fu Barr: the world will end.
[12:28]  Fu Barr: soon.
[12:28]  SillyAv: Hello World, Hello dan, Hello all
12:28]  ripper Portal is Offline
[12:28]  Fu Barr: the wuestion is why and what is breaking?
[12:28]  Hans Nerido: delete the 0, all is fine
[12:28]  Ken Savage is Online
[12:28]  Fu Barr: why and what of breaking is 80% of writing code.
[12:28]  Jeff Hall: no channel for talking to owner only
[12:28]  Romulun Rockett: Hello :)
[12:29]  Fu Barr: yes, you're all giving the correct solution
[12:29]  Fu Barr: but the solution isn;t that interesting for the moment.
[12:29]  Ken Savage is Offline
[12:29]  Fu Barr: what we want to understand is something called 'function signatures'
[12:29]  Fu Barr: it stands to reason that llSay() will say something
[12:29]  ripper Portal is Online
[12:30]  Fu Barr: it also stands to reason that llOwnerSay() will only say stuff to the owner
[12:30]  ScriptClassCube: Script running
[12:30]  Fu Barr: but both functions need extra informatino to work properly.
[12:30]  Avia Bonne is Offline
[12:30]  Fu Barr: if you use llSay() you need to tell the function what to say, and into which CHALLEN
[12:30]  Fu Barr: *CHANNEL
[12:31]  Fu Barr: so here we need to know something about how opensim works
[12:31]  Fu Barr: opensim has many chat channels
[ 12:31]  Fu Barr: but only channel 0 is 'public'
[12:31]  Fu Barr: channel 0 is what we use for our chat now. the one we can hear
[12:31]  Avia Bonne is Online
[12:32]  Fu Barr: if i write the follwing code: llSay(789, "cant hear this");
[12:32]  Fu Barr: the code is correct. but you wont see it.
[12:32]  Fu Barr: but couse the viewer isn;t showing you what gets said in channel 789
[12:32]  Fu Barr: so here's a lot to learn
[12:32]  Fu Barr: 1. it doesn;t do what i want it to do
[12:33]  Fu Barr: this doesnt automatically meanyour code is WRONG
[12:33]  Fu Barr: it might just be that your code if correct, but it's just not the RIGHT code
[12:33]  Fu Barr: to get done what you need to do
[12:33]  ScriptClassCube: George's Script running
[12:33]  Jeff Hall: u need to read and understant the object model for function u use
[12:33]  Fu Barr: now, if i was listening to channel 789
[12:34]  Fu Barr: i would hear the message just fine
[12:34]  Nick.Envoy is Offline
[12:34]  Fu Barr: unfortunately - in normal situations as an avatar you can really hear or listen to these other channels
[12:35]  Fu Barr: which is why the millions of channels other than 0 are used to make prims and others objects in opensim talk to each other
[12:35]  Nick.Envoy is Online
[12:35]  Fu Barr: if you want 2 prims to communicate, then you pick a channel - any channel 283294586245 for example
[12:35]  Fu Barr: and make sure the prims know which channel touse and hey presto your prims can communicate without any avatar hearing tham
[12:35]  Areys Damar: wow
[12:36]  Fu Barr: which is great and we'll see how this helps us do all sorts of stuff
[12:36]  Fu Barr: so, a recap.
[12:36]  Romulun Rockett: "two prims communicate" when would prims communicate with each other, if they were linked???
[12:36]  Fu Barr: 1. opensim has channels
[12:36]  Fu Barr: we'll see how two can communicate after my recap :)
[12:36]  Fu Barr: so recap:
[12:37]  Fu Barr: 1. opensim has channels
[12:37]  Fu Barr: 2. the default 'public chat' channel is challe 0
[12:37]  Fu Barr: *channel
[12:37]  Fu Barr: 3. spamming channel 0 with text frmo your prims and linksets is very bad manners
[12:37]  Fu Barr: 4. you need to make the be quieter.
[12:37]  Snakedance Moonwing plays with her massive floats!
[12:38]  Fu Barr: 5. you do this by replacing llSay() with llOwnerSay()
[12:38]  Jeff Hall: mmm but Fu...sometimes u need to talk to user, not owner only
[12:38]  Fu Barr: 6. but then we get erros - because we know know that different functions need differnet informatino to work correctly.
[12:38]  Fu Barr: hang on - getting there
[12:38]  ScriptClassCube: George's Script running, strangely enough
[12:39]  Fu Barr: 7. the info llSay needs is the channel and the message
[12:39]  Fu Barr: but llOwnerSay - it doesn;t need the channel - because it just talks straight to the user!
[12:39]  Fu Barr: or to the owner rather
[12:39]  Fu Barr: so like some said before
[12:40]  Fu Barr: in order for llOwnerSay to work properly, you drop the 0 from the function signature and voile.
[12:40]  Fu Barr: *voila
[12:40]  Fu Barr: so who's going to ask the obvious questino?
[12:40]  Ni Lemon: we all see the messages without 0
[12:40]  Fu Barr: the one abbout function signatures
[12:40]  dan banner: drop the , too
[12:41]  Fu Barr: oh yes, function signature informatin is sperated with a comma
[12:41]  Fu Barr: good point
[12:41]  Fu Barr: the questino has to be - bugger, where to i find out about all the various functions and their signatures?
[12:41]  Fu Barr: *do
[12:41]  dan banner: google is helpul
[12:42]  Jeff Hall: wiki
[12:42]  Fu Barr: well, the best place to learn and look up is the SecondLife wiki
[12:42]  Fu Barr: we'll see how that all works as we get further into the classes
[12:43]  Fu Barr: but the secondlife LSL wiki is an essential resource
[12:43]  Fu Barr: good. now let's wrap up this class with two cubes talking to eachother
[12:43]  Fu Barr: along the way we'll learn another very important thing about how opensim works
[12:43]  Romulun Rockett: so is the scripting languege in here, all the same as SL??? hasn't it changed atall???
[12:44]  Fu Barr: nope
[12:44]  Romulun Rockett: :) :)
[12:44]  Fu Barr: opensim has 99% of the SL LSL
[12:44]  Fu Barr: but it also has it's own fuctions
[12:44]  Fu Barr: OSSL
[12:44]  Fu Barr: they are fabulous
[12:44]  Romulun Rockett: ok:)
[12:45]  Fu Barr: the data for those is on the opensim wiki
[12:45]  Fu Barr: but there are complications and issues etc. so we're going to deal for the most part with the regular LSL functions - pleanty to learn there :)
[12:45]  Fu Barr: so if we all have a second prim rezzed...
[12:46]  Fu Barr: let's try and understand how we're going to try and get these two prims to talk to each other
[12:46]  Fu Barr: then we'll write the code for it
[12:46]  Fu Barr: so it's clear we'll need to decide on a channel number to use for our chatty prims.
[12:47]  Arielle.Delamerlibre is Offline
[12:47]  Fu Barr: if the prims dont have a common channel.... it's not going to work
[12:47]  Fu Barr: so for my example i;m picking channel -1234
[12:47]  Arielle.Delamerlibre is Online
[12:47]  Fu Barr: that's minus 1234
[12:47]  Fu Barr: -1243
[12:47]  Fu Barr: oops
[12:47]  Fu Barr: -1234
[12:47]  George Equus: :)
[12:47]  Fu Barr: you guys will have to pick some other number or we'll be having cross chat
[12:47]  Fu Barr: that should be clear i hope :)
[12:48]  Fu Barr: then we need to have on prim llSay() to the channel
[12:48]  Fu Barr: *one
[12:48]  Fu Barr: and the otehr prim has to LISTEN to the talking prim
[12:48]  Fu Barr: one SPEAKS, the other one LISTENS
[12:49]  Fu Barr: so, here we come to a new idea
[12:49]  Fu Barr: the notion of 'listening' is evident to us humans etc.
[12:49]  Fu Barr: even a rabbit or a dawg might listen
[12:49]  Fu Barr: but prims don't listen 'of themselves'
[12:49]  Fu Barr: we have to tell a prim to start listening
[12:50]  Fu Barr: otherwise it just sits about. literally without 'ears'
[12:50]  Object: Script running
[12:50]  Fu Barr: the function we canuse to give a prim 'ears' is llListen()
[12:50]  Fu Barr: a bit abvious. i know.
[12:50]  Fu Barr: *obvious
[12:50]  ScriptClassCube: Script running
[12:51]  Fu Barr: so anybody what to have a guess at what sort of informatino llListen might need to work properly?
[12:51]  dan banner: channel
[12:51]  Fu Barr: what might the function signature be for llListen?
[12:51]  Fu Barr: correct channel is an obvious one
[12:51]  Fu Barr: anything else?
[12:51]  Jeff Hall: message
[12:52]  Fu Barr: that's true too is less obvious
[12:52]  Kelso.Uxlay llListen( integer channel, string name, key id, string msg );
[12:52]  Fu Barr: *if
[12:52]  Fu Barr: tere you go
[12:52]  Romulun Rockett: might it be listening for a spesific text string??
[12:52]  Fu Barr: i was waiting for the smart alec in the group :)
[12:52]  Fu Barr: well done kelso :)
[12:52]  Kelso.Uxlay Sl wiki
[12:53]  Fu Barr: excellent!
[12:53]  Fu Barr: so the llListen function signature has 4 parameters
[12:53]  Fu Barr: post the again kelso
[12:53]  Fu Barr: *them
[12:53]  Kelso.Uxlay llListen( integer channel, string name, key id, string msg );
[12:53]  Fu Barr: thanks
[12:53]  Fu Barr: like dan said - first is channel
[12:53]  Fu Barr: 2nd is the name of the talking prim
[12:54]  Fu Barr: that's the thing you called it on the general tab
[12:54]  Fu Barr: something like fu's magic talkingp rim
[12:54]  Fu Barr: the 3rd parameter is the UUID of the talking prim
[12:54]  Fu Barr: everybody know what an UUID is
[12:54]  Fu Barr: +?
[12:54]  Kelso.Uxlay Unique identifier
[12:55]  Fu Barr: basically it's the unique number each and every item in opensim gets
[12:55]  Drang.Po ea82195b-47cb-4dbe-b33a-b092f0b3f8ea
[12:55]  Fu Barr: all our prims have one, and it's guaranteed to be different
[12:55]  Fu Barr: always unique
[12:55]  Fu Barr: and the last parameter like some have already said is the message 
[12:56]  Fu Barr: now most of you who have done some scripting probably know this already etc. but i ask you to bare with me on this. like i said it'll keep me  sane later on as i can say - oops we spokeaout his already you're asling me a stupid questino :)
[12:57]  Fu Barr: so if we look at the fuction signature, we can see something interesting
[12:57]  Fu Barr: and it's called 'filtering'
[12:57]  Fu Barr: we can tell llListen() to only listen to certain prims, or to all prims
[12:57]  Fu Barr: for example
[12:58]  Fu Barr: if we would write the following...
[12:58]  Fu Barr: llListen(789, "", NULL_KEY, "")'
[12:58]  Fu Barr: what/who will the listening prim actually listen to?
[12:58]  dan banner: anyone
[12:58]  Fu Barr: half-correct
[12:59]  Kelso.Uxlay anything
[12:59]  Fu Barr: still half -correct
[12:59]  Fu Barr: yes, anything, but ONLY only on channel 789
[12:59]  Romulun Rockett: any other prim?
[12:59]  Fu Barr: how about this:
[13:00]  Fu Barr: llListen(789, "Fus Idiot Prim", NULL_KEY, "");
[13:00]  Thirza Ember is Offline
[13:00]  Scooby Scorfield is Offline
[13:00]  Romulun Rockett: any other prim using that channel???
[13:00]  Fu Barr: nope
[13:00]  Kelso.Uxlay would accept message only from prim Fus Idiot Prim
[13:00]  Fu Barr: exactly
[13:01]  Fu Barr: but still only on that channel 789
[13:01]  Romulun Rockett: ok :):)
[13:01]  Fu Barr: the 2nd parameter in the function signature is the source of the the talking
[13:01]  Fu Barr: i refer you all to the SL wiki for the rest but the idea of 'filtering' the listen should be clear
[13:02]  Fu Barr: now the question is: why bother
[13:02]  Fu Barr: just listen on channel 789 and be done with ot
[13:02]  Fu Barr: *it
[13:02]  Fu Barr: the answer lies for the most part in the opoesnim server load thing
[13:03]  Fu Barr: liek we said lsitens etc. are scheduled and handled by the opensim local server
[13:03]  Fu Barr: and if say you're asking your prims to listen to channell 0 - then all the chat has to go to all the prims.
[13:03]  Fu Barr: it pays to try and limit the scope of your talking
[13:03]  Fu Barr: also helps with limiting cross talk etc.
[13:04]  Fu Barr: right. so now we know how to llSay, llOwnerSay and how to llListen()
[13:04]  Fu Barr: now we need to actuall piece it all together
[13:04]  Fu Barr: for which we need one more opensim concept
[13:04]  Fu Barr: the Event
[13:05]  Fu Barr: opensim code is 'event driven'
[13:05]  Jeff Hall: u dont talk about listen handle FU?
[13:05]  Fu Barr: lol - that IS what I;m talking about :)
[13:05]  Fu Barr: so...
[13:06]  Fu Barr: here we go
[13:06]  Jeff Hall: sorry i didnt see the handing
[13:06]  Fu Barr: when we setup the llListen()
[13:06]  Fu Barr: we also prepare the listening prim to 'react' when it hears something
[13:07]  Fu Barr: 'hearing something' is an 'event'
[13:07]  Fu Barr: there are other events
[13:07]  Fu Barr: many of them
[13:07]  Fu Barr: like:
[13:07]  Fu Barr: touching
[13:07]  Fu Barr: colliding
[13:07]  Fu Barr: moving
[13:07]  Fu Barr: all sorts of things that can happen in opensim
[13:07]  Fu Barr: or SL for that matter
[13:08]  Fu Barr: the llListen sets up the 'event' for listening and then when that event actually happens, we need to 'handle' it
[13:08]  Fu Barr: the notion of 'Events' and handling them ins v important to get straight in your mind.
[13:08]  Fu Barr: if you're a novice scripter
[13:09]  Fu Barr: this will be your first major headache
[13:09]  Fu Barr: the 2nd will be understanding 'states'
[13:09]  Fu Barr: the 3rd will be 'debugging'
[13:09]  Fu Barr: those headaches we'll leave for the next classes
[13:09]  Fu Barr: :)
[13:09]  Fu Barr: so back to events
[13:10]  Fu Barr: the event handler for llListen is 'listen'
[13:10]  Fu Barr: no imagination these LindenLabs types...
[13:11]  Fu Barr: anyhow i;m not going to go through the whole dance but i should be clear that listen has v similar parameters to llListen()
[13:11]  Fu Barr: in fact:
[13:11]  Fu Barr: listen(integer channel, string name, key uuid, string msg)
[13:11]  Fu Barr: would do the trick
[13:12]  Fu Barr: the pait have the IDENTICAL singnature - one sets up the event, one handles the event
[13:12]  Fu Barr: *pair
[13:12]  Fu Barr: they work in tanden
[13:12]  Fu Barr: *tandem
[13:12]  Fu Barr: llListen() means there's going to ba a listen someplace in your code
[13:12]  Fu Barr: listen() means there needs to be a llListen() to make it relevant
[13:13]  Fu Barr: now lets see how this works in code.
[13:13]  Fu Barr: and in your prims
[13:13]  Fu Barr: oh, any questions so far?
[13:13]  Jeff Hall: no but sorry if i was too fast Fu
[13:13]  Jeff Hall: :)
[13:13]  Fu Barr: none. excellent i must be the BEST teacher EVVAH!
[13:13]  michaelboyd dresler is Online
[13:14]  Fu Barr: :)
[13:14]  Fu Barr: okay - lets setup one cube as a talker first
[13:14]  Jeff Hall: was searching for the hnadle
[13:14]  Jeff Hall: handle
[13:14]  Fu Barr: pick one of your cubes
[13:14]  Mirror Amorasi is Online
[13:14]  Drang.Po will the uuids work on different grids? even thou they were assigned by the database on the 'home' grid?
[13:15]  Jeff Hall: hahha
[13:15]  Fu Barr: correct. uuids are grid specific
[13:15]  Fu Barr: now in my case my llSay might be like this: llSay(-1234, "speak");
[13:15]  Drang.Po so you would have to redo the prims and code for each grid in order to work
[13:15]  Jeff Hall:
[13:16]  Fu Barr: yes and no :)
[13:16]  Fu Barr: we'll see that when we get to the listener prim :)
[13:16]  Fu Barr: now i;m going to move to my listener prim and add my llListen like so:
[13:16]  Fu Barr: llListen(-1234, "", NULL_KEY, "");
[13:16]  Mirror Amorasi is Offline
[13:17]  Fu Barr: which means the prim is going tolisten to everything on that channel
[13:17]  Azi Az is Online
[13:17]  Nik Yer is Offline
[13:17]  Fu Barr: whihc is fine as there's only one thing so chat traffic is going to be minimal
[13:17]  Koni Lanzius is Online
[13:17]  Fu Barr: then i;m going to setup my listen like so:
[13:18]  Fu Barr: listen(integer channel, string name, key uuid, string msg)
[13:18]  Fu Barr: and now it all breaks and i go home disenchanted
[13:18]  Fu Barr: :(
[13:18]  Fu Barr: the problem is that i havent yet told you how the handler really needs to be written
[13:19]  Fu Barr: we just looked at the function signature
[13:19]  Fu Barr: this is that the listen relly lookslike:
[13:19]  Fu Barr: listen(integer channel, string name, key uuid, string msg) { llOwnerSay("I heard something):}
[13:19]  Fu Barr: oops : is a ;
[13:20]  Fu Barr: the listen is its onw code block and you can/have to callfunctions insode that code block to make the handler _do_ something
[13:20]  Fu Barr: *own
[13:20]  Fu Barr: so the flow is:
[13:21]  Fu Barr: 1. setup llListen() in target prim
[13:21]  Fu Barr: 2. user llSay() to say something into channel
[13:21]  Fu Barr: 3. handle the listen even in the target prim, in its own code block.
[13:22]  Fu Barr: it really is a conversation
[13:22]  snowbody Cortes is Online
[13:22]  Fu Barr: i guess i've lost all of you but, if not, i'll post the code for each prim source and target and you can copy paste it into your prims and see how  it works.
[13:23]  Fu Barr: here we go: (give me a sec to type it out)
[13:23]  Object: Script running
[13:24]  Fu Barr: this is my source script:
 default {
 state_entry() {
 llSay(-1234, "Hello");
 [13:24]  Romulun Rockett: that sounds helpfull :)
 [13:25]  Fu Barr: default {
 state_entry() {
 llListen(-1234, "", NULL_KEY, "");
 listen(integer channel, string name, key uuid, string msg) {
 llOwnerSay("Heard something"); 
[13:25]  Fu Barr: copy paste that in your cubes.... first the target one with the listens, then the source one with the llasy
[13:25]  Fu Barr: llSay
[13:25]  Nik Yer is Online
[13:26]  Fu Barr: if you did it the other way around,
[13:26]  Fu Barr: just 'reset' or resave your llSay cube
[13:26]  Mirror Amorasi is Online
[13:26]  Fu Barr: who's got it working?
[13:26]  Object: Script running
[13:26]  Jeff Hall: i made it working  with touch start instead
[13:26]  Fu Barr: obviously you need to change the channel number to your won
[13:26]  Object: Script running
[13:27]  Object: Script running
[13:27]  Fu Barr: fair enough jeff, but we hadn't looked at that event yet :)
[13:27]  Ni says  she loves Hans: Script running
[13:27]  Fu Barr: but i may have jumped the gun alittle
[13:27]  Hans isnt worth loving: Script running
[13:27]  SillyAv: Hello World, Hello dan, Hello all
[13:27]  Fu Barr: perhaps i should have started with touch_end first... oh well, you live and learn
[13:28]  Hans Nerido: i like you too Lou !!!
[13:28]  Total Sorbet: hehe
[13:28]  Hans says he loves Ni: Heard something
[13:28]  Nox.Darkness is Offline
[13:28]  Fu Barr: well hans's prim seems to be working
[13:28]  Fu Barr: :)
[13:28]  Hans Nerido: :-))
[13:28]  Jeff Hall: haha
[13:28]  Nox.Darkness is Online
[13:29]  Jeff Hall: love is nice he?:)
[13:29]  Fu Barr: well - all the code is right there - well if you're isent - all i can say welcome to your first taste of headache number 3 - debugging :)
[13:29]  Fu Barr: *your's isnt working
[13:30]  Fu Barr: anyhow - this is about as much time as i have for this session - pleasemuck aounrd with the little bits of code if you're a novice, see if you can   make it work.
[13:30]  Total Sorbet: good lesson fu
[13:30]  Total Sorbet: ty
[13:30]  Stewie Allen is Online
[13:30]  Kelso.Uxlay thanks
[13:30]  Fu Barr: feel free to IM/message me if im in world i;m happy to answer questins
[13:30]  Hans Nerido: 1 question Fu
[13:30]  Jeff Hall: nice and ty Fu
[13:30]  Ni Lemon: Great lesson Fu, thank you so much
[13:30]  Kelso.Uxlay When is the next lesson?
[13:30]  Hans Nerido: is there a max range for this scripts
[13:30]  Azi Az: Hi all.....seems i came late
[13:30]  Fu Barr: we'll do some more evetns etc. in the next lesson make it all a bit more 'useful' and less beginner-y
[13:31]  Nik Yer is Offline
[13:31]  Hans Nerido: most scripts has an max range from 96 meters
[13:31]  Fu Barr: okay - i need to head back to my RL - thanks for joining in, i guess we'll schedule and publicise the n