Create A Flying Pet: Transcript 2b
PDA 0.6 whispers: Avatar authenticated
PDA 0.6 whispers: Welcome, Catfart Grayson
Popper: Your object 'Popper' has been returned to you from parcel '' at Fujin 227, 103.
Pony: Your object 'Pony' has been returned to you from parcel 'Protected Land' at Uba 1, 120.
Pony: Your object 'Pony' has been returned to you from parcel 'Protected Land' at Uba 48, 163.
Planet Mars is online
Bernardo Rockwell is online
Vindi Vindaloo is online
Green Jacques is online
Sophos Casanova is online
LadyMacbrat Loveless is online
RacerX Gullwing is online
Courtney Boffin is online
Snapdragon Dayton is online
Jen Virgo is online
Jake Fairplay is online
Aleksandr Martov is online
Gwyneth Llewelyn is online
Pony: Your object 'Pony' has been returned to you from parcel 'Protected Land' at Uba 68, 179.
PDA 0.6 whispers: Avatar authenticated
PDA 0.6 whispers: Welcome, Catfart Grayson
You: :) your very early ladies
Elle Pollack: Yep
Azazel Czukor: over eager, at least I am :)
Elle Pollack: I just had nothing else to do :)
You: hehe
Candide LeMay: hello
You: If any one made soemthing they want to show off, Ive pout a stand in the middle of the woden chairs behind you
You: evening
You: Fire Lizard from the draginrider books?
Elle Pollack: Yeah...I wanted a small dragonlike creature and I had the books handy :)
You: verty nice, is the axis correct?
Elle Pollack: Root prim is the ridge in it's head...z pointing up, x pointing foward :)
You: cunning
You: did anyone else have a go at making something?
Candide LeMay: i only made a joker card (a box with 2 textures)
Candide LeMay can't build
You: hehe, flats are fun, and have a long tradition
Azazel Czukor: I made a little raven guy
You: same here, cant draw either, but there are plenty of sprites on the internet
You: hes good
Candide LeMay: brb relog
You: only nine prims!
Azazel Czukor: :D
Azazel Czukor: ooh I love your dragon Elle
Elle Pollack: Dankee :)
D1M2: I'm here
D1M2: Ouch
D1M2 whispers: order play
D1M2 whispers: order come
D1M2 whispers: order sit
You: this is something Ive been working on
You: D1M2 come
D1M2 whispers: selected line 0
D1M2: OK
D1M2: Ouch
You: D1M2 play
D1M2 whispers: selected line 1
D1M2: I'm on it
D1M2: Ouch
Azazel Czukor: awwww he's cute
You: not sure about its personality yet
Claire Engel is online
Blueman Steele: hi is this the dragon class
Candide LeMay: yup
You: Blueman it is
Blueman Steele: I missed part one.. but may I try to keep up?
You: oh, and I taught a new trick to Tink
You: Blueman sure, let me dig you out a copy of last weeks documentation
Alan Steed: i missed it as well if u wouldnt mind fillin me in with the notes plz
Blueman Steele accepted your inventory offer.
onionpencil Musashi: hey blue lol sos u came hahaah
Alan Steed: ty
Alan Steed accepted your inventory offer.
Blueman Steele: yup
TxKatie Curie is online
Blueman Steele: hi Ariel
You: Tjere is another part of the transcript, but that is in this weeks slides so you will get it at the end of this session
Blueman Steele: oops AFK she is
Brianna Lioncourt: hullo everybody
You: Hello Brianna, how did you get on with the notes?
D1M2: Script run-time error
D1M2: Stack-Heap Collision
onionpencil Musashi: bah so used to music the quiet is unearthly lol
Brianna Lioncourt: oh, you want to see what I've done?
You: whoops, looks like I have a bug in my droid
onionpencil Musashi: drug in yer boid
Brianna Lioncourt: can you please stop that light changing for this class
Blueman Steele: drung in yoru void
onionpencil Musashi: go to debug
You: Brianna, debug>rendering>type.clouds
Brianna Lioncourt: excuse me?
You: do you have your debug menu showing?
Elle Pollack: How long will the test go on?
You: gooney bird, cool
onionpencil Musashi: test?
You: Elle, the event will last about an hour
Elle Pollack: Ooops, wrong chat window...but thanks :)
Blueman Steele: WB ariel
Elle Pollack: I was asking someone about the game they're beta-testing
You: OK, Ill give it another minute or so then Ill get started
Brianna Lioncourt: Sorry
Brianna Lioncourt: I hit the wrong button by accident
You: Briana you sorted out the clouds yet?
Brianna Lioncourt: and had to come back in
Brianna Lioncourt: nope
Brianna Lioncourt: Where do I findit?
You: ok, do you have your debug menu showing at the top of the screen?
Candide LeMay: next to help
Alan Steed: cntrl shift - fixes it i think
Brianna Lioncourt: nope
You: if not press ALT-CTRL and D
Brianna Lioncourt: ok, have it
Brianna Lioncourt: now what?
Basic Chair: Right click me and choose 'Sit Here' to sit down
You: deebug>rendering>types>clouds
You: under debug,mis rendering,s elect that, then select types then unselct clouds
Brianna Lioncourt: where do I type it in?
onionpencil Musashi: no typing
You: hehe, use the mouse select the debug menu
You: then select the rendering option
You: under that, select types
You: you will see a list of different thigns with xs by them
You: select clouds to trn them off
Brianna Lioncourt: Thx!!!
You: good stuff, ok I can see one more coming in from the teleport
Brianna Lioncourt: Sorry to have been troubvle
onionpencil Musashi: everyone has stuff learn stuff somehow at some point
You: everyone finished loading in the textures, I know there are a lot of them here
Brianna Lioncourt: Are you the one who made a little green dragon
onionpencil Musashi: often winds up being when we already need it lol
Brianna Lioncourt: was givein it months ago
You: OK so to recap last week
You: I talked about how we are going to have three scripts in the pet
You: one for each specific function
You: a movement script, a brain script and an actions script
You: I talked about the limitations on the models
You: no larger than 90kg
You: No more than 30 prims
You: x axis must point in the direction it is going to move in
Brianna Lioncourt: is mine ok?
You: then we talked about the link messages that the scripta are going to use to talk to each other
You have exchanged calling cards with Brianna Lioncourt.
Brianna Lioncourt is online
You: I discussed how we are going to use LINK_NUM
You: and num
You: and we left it were I said that on the Wiki, was the solution to the problem
You: of putting lots of data items into a string
You: So lets see how that works
Brianna Lioncourt: you've already lost me
You: just a sec, I need to get a note card out
Aleksandr Martov is offline
You: hehe, dont worry I go pretty slowly
You: OK, so here is the code that is going to put all our data int one string
You: first we create a list and put all outr data items into that list
You: Here Ive put a string "MOVE" which is going to be outr message type
You: after that Im going to put the speed, and then the target location
You: and then some flag
You: :)
Elle Pollack: Where in the Wiki was this again?
You: the point is each of these items are different formats, vectors, integers and floats
You: Elle, you can reach it from the support section of the SL website
Elle Pollack: I know where the wiki is, I just forgot which part :)
You: All the work is done by the function llDumpList2String(), which does what its says
You: ele, the examples I think it was in
Candide LeMay: elle http://secondlife.com/badgeo/wakka.php?wakka=ExampleArgumentMultiplexing
onionpencil Musashi: elle if nothing else i can look it uo in my notes later
onionpencil Musashi: or never mind lol
Elle Pollack: Got it
Brianna Lioncourt: will you be handing out copies of your notes to us?
You: you give llDump... a list, and a string and it converts the list into a string
You: Briana yes
You: so after the secodn line here
You: the string data contains the string of information
You: you can see at the bottom of the slide
You: llDump... converts each data item
You: into a string and puts the string -=- inbetween everyone
Jake Fairplay is offline
You: now we can send that string out in the link message
You: if everyone is happy with that, we can look at how we get it out the other end
RacerX Gullwing: ok
You: can I just check, these slides should be rezzinfg really fast for ppl now?
Azazel Czukor: its all good
onionpencil Musashi: i'm fine
Elle Pollack: No problem here
You: oh, and you will get a copy of the slies at the end
Brianna Lioncourt: yes, but I still dont understand
neand Fleming: yes, fine
RacerX Gullwing: yup
You: OK, so llMessageLink sends a link message out
onionpencil Musashi: brianna were you here last class?
Brianna Lioncourt: and didnt really see the previous slides when you had them
Brianna Lioncourt: nope
onionpencil Musashi: then perhaps that is why you are lost
You: and link_mesage is the event
Brianna Lioncourt: and I am just startling to learn scripting
You: that is triggered when a link message is received
You: as you can see here, four variables are set when it is called
You: sender_num is the link number of the prim
You: that the script that sent the link message was in
You: lol, that came out right but horrible
onionpencil Musashi: lol
You: however, for this project, we dont need it :)
You: next is the integer num and this will be the same value as in the link message we sent
Brianna Lioncourt: Thanks Racer--Cat gave me the transxript already
Brianna Lioncourt: or so I thought
Brianna Lioncourt: it diendt get this far in the notes
You: then a str which contains all our data and finally the key that was also int he mesage
You: you remember that we are not using the key either
onionpencil Musashi: brianna i have a transcript of whole thing if you need later..
Brianna Lioncourt: ok, thx everybody
You: And this is how we decode our link message and extract the data
You: remember that we are going to use num as the channel or comapny id? In my case it is always 150
You: so the first thing we do is check to see if num is 150, if it is
You: I know its one of my messages
You: now we now to extract the data
You: and llParseStringKeepNulls() does the opposite
You: of llDumpList2String
Green Jacques is offline
You: shove the string and the separator string in one end
You: and out of the other comes a list containing each data item
You: But, we have lost the data format
You: they are all string
You: strings
You: once we have our list called Cmd here
You: we can look at the first data item, item 0
You: if it is equal to MOVE, we know we have a movment order
You: and now we can actually get our data
Blueman Steele: what does teh command it looks for look like
Blueman Steele: in chat
You: put the first data item ina integer called speed, the second in a vactor
Snapdragon Dayton is offline
You: Blueman whch bit?
Ariel Monde: I understand the move part, but i am not sure why we need llParseStringKeepNulls... what s the purpose of it for this project ?
Blueman Steele: like. what do I say to the object
Blueman Steele: MOVE ??
You: Blueman these are not listens
You: these are link messages traveliing between scripts in the same object
Blueman Steele: so this is parsing from the orignal grab
onionpencil Musashi: blue these are things pet 'decides' for itself
Brianna Lioncourt: is it possilbe to find a script already done we could use?
Blueman Steele: OH!
You: Ariel, what we are doing here is showing how to get all the informationw e need from a link message
You: it will be usd to tell the movement script where to move to
Brianna Lioncourt: So far, this is reaaly beyond me I'm afriad
You: LOL, sorry its not going to be that easy
You: did I mention this weeks homework?
Ariel Monde: so this script share string data between prims in a same object ?
Elle Pollack: Ariel: Because we had to send all the commants from the brain script to the movement script in one string, we need llParseString to break it back up into its parts
You: Brianna, stick with it for the moment, we can talk afterwards
You: Ariel yes
Ariel Monde: ah thank you Elle :)
onionpencil Musashi: it's a little over my head too but i'm really interested so i'm trying to learn
You: OK, so the last three commands here are taking the information from the list Cmd and putting it into individual
You: data itmes
You: but, because the list contains strings
You: each one has to be typecast into the correct foramt
You: that sthe (integer) and (vector)
You: everyone happy with those commands?
RacerX Gullwing: ok
neand Fleming: yes
You: npow this isnt the actual code we are going to use its just an example
You: time to look at the actual structure of the brain script
You: At its simplest level we only need 2 events
You: state_entry and link_message
You: astate_entry si going to pick somewhere to move to and then tell the movement script to go there
You: and link message is going to wait for the movement script to asay that its reached the target
You: theen its going to pick somewhere to go to and tell the
You: movement script to go there
You: and so on and so on
You: there are also two user defined functions that we need
You: OK so state_entry
You: as you can see it does two things, it calls a function called get_new_pos
You: get_new_pos is going to return a vector which
You: we are goign to keep for a sec
You: and then we are going to put that vector into a function called move_to_position
You: and move to postion is going to set up and send the link message
Candide LeMay: you mean select_new_position
You: select_new_position picks a new target to move to
You: move_to_position sends a link message out with that target in
You: you coudl do those two lines in one
You: move_to_position(select_new_position());
Candide LeMay: no i just mean you said get_new_pos
You: ah yes sorry
You: hehe got to watch my terms :)
You: looking at the link message event
You: first thing we do is check the channel number
Blueman Steele: uhm teacher.. Onion is passing notes! I demand you read it in from of the class
You: if its correct
You: pfft extra work for you
onionpencil Musashi: shhh
You: if its correct we are going to check the first item in the list
You: if it says ATPOS, we know its from the movement script
You: (Which we hanvt written yet)
You: so since we have reached the target we select a new target and send the pet on its way again
You: and it just keeps doing that
Popper: Your object 'Popper' has been returned to you from parcel 'Protected Land' at Uba 34, 151.
You: pick a traget wait for a mesage pick a target wait...
You: later on we will add other events
You: ok lets take a look at theose two user functions
You: This function does a lot of work, its job is to pick the next target to move to
You: changin how this function works will make a big impact on the behaviour of your pet
Louie Robertson: hi!
Planet Mars is offline
You: now in the class we are just going to pick a random position, but it doesnt have to be
Jen Virgo is offline
You: you could change this for instance to read the next
You: landmark in the inventory
Louie Robertson: hi guys!
You: OK, first thing Ive declared a global variable at the top
Jen Virgo is online
onionpencil Musashi: hi louie shh we're busy filling our brains
You: now that should be right at the top of your code, and being global it will be availalbe
You: to all bits of this script
You have exchanged calling cards with Louie Robertson.
Louie Robertson is online
Louie Robertson shouts: sky dancer is pregnant!!!!!!!!!!!!
You: the move range is the maximum distance your pet will move away from its current position
onionpencil Musashi: shoo!
Blueman Steele: this is s aclass sit or get out
You: so here Ive set it to three
You: that means the pet will move no further than 3 meters in each direction
Louie Robertson: fine there i sat
You: its nother variable you are going to want to fiddle with to get
You: something that looks good for you
onionpencil Musashi: just as a silly question is there a max practical range?
You: yes, the lenght of a sim
You: objects like people have trouble moving acoss sim bounaries
Jen Virgo is offline
You: OK so how are we going to get the new target, we are going to calculate an offset vector
You: fourth line down I declare the vector then each of its three components is set using llFrand
You: Ill go through the offeset.y line in details
You: offeset is a vector
Green Jacques is online
You: offset.y is the y component of the vector
You: so if the vector is <1,2,3>
You: then offset.y equals 2
Candide LeMay: err aren't you missing some parens there, or the one at the end should not be there
You: you can read each component ofa vector or set them using this method
Louie Robertson: bye guys!
You: hehe maybe, these slides were a bit rushed in places
You: err.... I meant congratulations on
You: spotting the deliberate error
onionpencil Musashi: lol he was ....testing you.. that's it
TxKatie Curie: lol
You: Ok so the line offset.y is setting the y component of offset
You: lLFrand is set here to give a number between 0 and 6
You: (Twince move_range)
You: and then we deduct move_range
You: so offset.y becomes a value between -3 and +3
You: smae with offset.x
onionpencil Musashi: cool!
You: Now Ive treated z slightly differently
You: z is the up down
Basic Chair: Right click me and choose 'Sit Here' to sit down
You: think about how birds and things fly
You: airplanes insencts
You: they all move further in the x y palne
onionpencil Musashi: mostly across
You: compared with up and down
You: so Im only going to have half the values for the z axis
You: the upshot is we end up with a box twice the move range long
You: and the same wdth and omove range high
You: with the pet in the center of that
You: it will move somewhere in the box
Vindi Vindaloo is offline
You: the last thing to do is to convert our offset into sim coordinates
You: adding the offeset to the gets current position will do that
You: so if the pet is at 20,20
You: we choose a random move of 2,-1
You: we actually want to move to 22,19
You: so the last thing this fucntion does is return the new target vector
Vindi Vindaloo is online
Elle Pollack: what does "return" mean?
Jen Virgo is online
You: we are going to come back to this function
You: ele return means that the function returns that value to the scrip
onionpencil Musashi: the answer it comes up with
You: see the line vector next_pos = select_new_position()
You: select_new_position is the function we have just been lookig at
You: it returns a new target vector and we put it into
You: the vecotr next_pos
You: didthat make sence?
Ariel Monde: yes
Gino Medici: yep
neand Fleming: it did
You: Ok, we now have a new target and the next thing we do is send it to the function move_to_position
You: hopefuly you will recognise some of this from previous sides
You: Setting up a few global variables again
You: speed is fairy obvious
You: target_range is how near the pet is going to get to the target
You: before it decides its reached it
You: I'll go into that more in the movement script
You: both of these are things
You: you are going to want to change and experiment with
You: then the move_to_positon functio nitself
You: which take a paameter of a vector
Bernardo Rockwell is offline
You: and which is going to be our next target
You: put all the data items into a list
Pony: Your object 'Pony' has been returned to you from parcel 'Protected Land' at Uba 38, 155.
You: and then send them in a link message via llDumpList22String as we did before
You: job done
You: everyone happy with that?
Ariel Monde: yes
You: your homework
You: write a brain script
You: lets take a look at the layout again
You: three global variables at the top
Gino Medici: Cat, are you going to give us the slides at the end of the class?
You: a function that is going to take a vector and spit out a link message
You: a funtion that is going to return a random position
You: then the states
You: state entry pick a target and then send a move message
You: link mesage, wait for a ATPOS mesage then move somewhere else
You: now Ive added another event
You: on_rez
You: which should be the same as your state_entry event
You: you need that to stop problems when you take your pet into your inventory
You: imagine that your in the top left corner of the sim
onionpencil Musashi: ah.
Blueman Steele: so state_entry only runs once then?
You: the pet moves a little way, you take it into your inventory and move
You: to the bottom right
You: Blueman, yes state_entry runs the first time
You: a script enters that state
Blueman Steele: but doesn't reset each rezzing?
You: Blueman no!
You: if you take a script into your inventory
You: when you take it out
You: it starts running in exactly the same
Blueman Steele: I see... so a memory of sorts
You: state
You: the 'prgrmme ointeer' is sotored as well
You: Im going to give you a script caled test harness
You: a test harness is used to help test scripts where you h
You: have things missing, we dont have a movement script yet
You: so the test harness is going to pretend to be the movement script
onionpencil Musashi: cool
You: it will listen for the correct link message and if it hears it it will telll you what it "hears
You: it will then wait a few second and then send an ATPOS message back to your brain script
You: So thats your task, you will have a copy of the slides in a second
onionpencil Musashi: groovy
You: so you will hve pictures of allt he code, plus my deliberate errors
neand Fleming: lol
You: Thats the end of this session, in a moment I will sort out the trnascript then you can take the slides
TxKatie Curie is offline
TxKatie Curie is online
You: next week will will start looking at the movement script itself
Rhiannon Chatnoir: thank you
You: thankyou all for attending
Ariel Monde: will we have the transcript from last week class when we discuss some of session 2 ?
Brianna Lioncourt: Yes, thanks!
You: yes
TxKatie Curie: grr xrashed
TxKatie Curie: crashed
Blueman Steele: thanks Grayson
Bernardo Rockwell is online
Brianna Lioncourt: what store?
neand Fleming: very nice cat
TxKatie Curie: can someone please give me a note card with the chat history please
Ariel Monde: Catfart is doing it now, Tx
neand Fleming: still comung katie
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.