Create A Flying Pet: Transcript 2a
You: Now, I wasnt sure how long that lot was going to take
You: So I have session 2 ready as well, we will not finish it tonight, but should get at least a third of the way through
Gino Medici: the direction thing - is that because we are use vehicle functions to move?
onionpencil Musashi: yay
You: Gino, no but it is related
Serious Grommet is offline
You: we are not going to be using the vehicle functions, its actually to do
You: with the sensor cone
You: remind me in alater session and Ill show yousome tricks for simulating real creatures
onionpencil Musashi: cool
Gino Medici: ok :)
You: one second, Im going to make a copy of the chat so far and drop it in a notecard
onionpencil Musashi: excellent plan!
You: Ive put the transcript onto a card inside
You: how we doing?
Rhiannon Chatnoir: good
onionpencil Musashi: ok
RacerX Gullwing: fine proceed
You: right, anyone need a comfort break before I start again?
Hokuto Gorham: no
onionpencil Musashi: ok here
Morlee Moreau: luckily, my sl butt doesnt get sore
Xander Moe: mine does
You: Ok, so how are ppl with Link messages?
Rhiannon Chatnoir: ok
Dr Tapioca: okay
Hokuto Gorham: un linked
Carrina Hathor: ok
Iamnot Prefect: ok
Xcaliber Zadoq: don't know
Ariel Monde: a quick review on it please? it was a while ago
neand Fleming: no clue
Azazel Czukor: sketchy but I'll figure it out
Xander Moe: uhh heh
Elle Pollack: Haven't tried to figure them out yet
Alan Kiesler: I understand the basics.
Xander Moe: no idea
You: sorry lagged here a sec
RacerX Gullwing: i find one that works and copy paste it
You: SO link mesage are used to allow different scripts in the same object pass information
Dr Tapioca: lsl wiki
You: they can be in different prims if you want
You: for our pet, we are going to use a link message from the brain to the movement script
You: telling it where to move to
You: and one from the movement script to the brain, when it reaches the target
You: As usual in LSL, there is a function to send a link message
You: it takes four parameters
You: num, str and id can contain whatever you want, as loing as its a integer, string and id whichis a bit limited
You: and linkset determines where the link message will be sent
You: linknum can have several different values
You: do you want me to go through these?
Xcaliber Zadoq: yes, pls
You: OK, the asumptio here is that we have an object comprising several linked prims
You: if we set linknum to LINK_ROOT, then the message will only be sebnt to
You: scripts that are actuall in the root prim of the object
You: if its in a child prim, it wont get the message
You: LINK_SET sends the lin mesage everywhere
You: LINK_ALL_OTHERS sends the link message to all prims except the prim the script is in
You: and LINK_ALL_CHILDREN sends the message to all prims except the root prim
You: or, you can actually set it to the actual link number of the prim if you know it
LadyMacbrat Loveless is offline
You: Happly, we will only ever be using one of these values, no need to remember them all
Hokuto Gorham: :)
You: so jus to recap that
You: we are going to use this function to send out a link message
You: Linknum says where to send the data to
LadyMacbrat Loveless is online
You: and the data can be an integer in num, a string in str, and a key in ID
You: Just a few thoughts here on what we want out of our link messages
You: we want to be able to send several different items at the same time
You: we want several different messages we want to send other data types besides string integers and keys
You: sometimes we just want to send a simple stop message
You: so our system must cater for quie a lot
You: This is an example of one way we could design it
You: If we put each script in a prim, and use Linknum
You: we can send each message straight to the script that needs it and only that script
You: but, sometimes we may want to send a message to two scripts, and what if we dot have a prim for every script?
You: so not too good
You: this way is better
You: If we set Linknum to LINK_SET, every message goes to every script
You: doesnt matter which prim the script is in
You: we can then use the num variable to tell which message is which
You: so num = 1 could be a move message
Iamnot Prefect: is there a performence impact using this vs direct messaging?
You: num = 2 could be the stop mesage etc
You: Iamnot, not that Ive noticed, but Im only firing off my scripts evey 0.5 seconds or so
You: in theory more scripts are having to check
You: each message to decide if it is a message for it or not
Gino Medici: is there a SL equivalent of enums for the numbers?
You: but I dont think its a norticiable drop
Iamnot Prefect: ok i would think with low script count(less then say 10) prob not much diference
You: enums?
Gino Medici: Labels for the numbers, rather than 1,2,3 etc.
You: ah, no Im afraid not
Gino Medici: ok :(
Alan Kiesler: You can set those yourself, imnot, if worried about that.
You: OK Im going to try and finish this bit of design and then leave it there for today
Xcaliber Zadoq: examples R helpful
You: now this design is good, and probalby the usual way you will see link messages used
You: but does suffer from one diadvantage
You: if you try and combine scripts from different creators, you can have clashes
You: If you have a movement system that uses 1 to represent a move
You: and someone else has a combat system that uses 1 to represent a hit
onionpencil Musashi: oops
You: if you try and combine them together you could have problems
You: not very likly I'll admit, but I like to think ahead
You: this is the system I use
You: I set num to 150 everytime
Ariel Monde: and we will use this system for the rest of this class ?
You: now I can filter out MY mesages from anyothers that are running
You: Ariel yes
You: if I mix my messages with someone lese, the chances of a clash are very reduced
Gino Medici: ah ok - thats more like enums :D
You: plus, I can make my scripts open source, if someone elses scipt wants to
You: send a message to one of my scripts, they know to use channel 150
You: ight, so we are using linknum as LINLK_SET all the time
You: num is going to 150, or what ever number you choose for your scripts
You: which means we are going to have to put all the data
You: and the message type into the remaining data filed, which is a string
You: Im ignoring the key field at the moment
You: everyone happy?
Gino Medici: yep
You: so thats what we need, and a quick browse trough the WIki
You: brought this up
You: a nice method of comapcting all our data into a string and
You: decoding the other end
You: Now Im going to leave it here
You: Next time we will start going into the actual code
You: we are going to use in our link messages
Rhiannon Chatnoir: will you be giving us the slides and notes for this second part as well
You: and take a look at the design of the brain script
onionpencil Musashi: would be helpful if doable
You: Rhiannon, Id prefer to leave that till the end
Rhiannon Chatnoir: and, when is the second session happening
Rhiannon Chatnoir: ok
You: Next Sunday, same time same place
onionpencil Musashi: same bat time and channel i think ;)
Candide LeMay: don't forget your homework folks ;-)
Back To The Create A Flying Pet Home Page
Back To The Script Library
Comments (0)
You don't have permission to comment on this page.