Chat Session Feb. 14th, 2011
[20:00] Antonius: Hello MiceOnABeam group members! Time for the Monday chat. If you have any questions on the MiceOnABeam tool please join in.
[20:01] Arielmo: I have a error
[20:01] Arielmo: //ERR: ^ COMMA expected
[20:01] Antonius: Hi Arielmo!
[20:01] Arielmo: Hi =)
[20:02] Antonius: Seems that MiceOnABeam is telling you that there is an LSL coding error.
[20:02] Arielmo: Yes
[20:03] Antonius: What is the code it's complaining about?
[20:03] Arielmo:
llSetColor (<0.0,1.0,0.0>);
//ERR: ^ COMMA expected
[20:03] Arielmo: i'am learning still
[20:03] Antonius: Of course, no problem
[20:03] Arielmo: i think my code is wrong
[20:04] Antonius: Well llSetColor has two parameters that you have to supply; you're only supplying one.
[20:04] Arielmo: Ohhhh yes
[20:04] Arielmo: i forgot
[20:04] Arielmo: =)
[20:05] Antonius: If you type a comma after the color vector, MOAB's code completion list will pop up and will show you the syntax of the LSL function.
[20:06] Antonius: Here is the correct call: llSetColor(<0.0,1.0,0.0>,ALL_SIDES)
[20:07] Arielmo: I want make a green light turning on and off every 1 seconds, i put the timer in transition or in state?
[20:09] Arielmo: Is a alarm light
[20:09] Arielmo: With Sound and Glow
[20:09] Antonius: To use a timer, you have to do two things: First start the timer with a call to llSetTimerEvent(1.0)
[20:09] Antonius: You can put the timer start function in a state or transition depending on your needs.
[20:10] Antonius: Secondly, to receive the timeout, you have to create a transition that is set to the timer event.
[20:11] Arielmo: Thanks
[20:11] Antonius: Have you taken a look at the tutorial https://miceonabeam.fogbugz.com/default.asp?W7
[20:11] Antonius: The tutorial creates a simple light that transitions between colors based on a timer. Pretty similar to what you're trying to do.
[20:14] Antonius: If you haven't already, try going through the tutorial. It covers a number of the basics.
[20:16] Antonius: Do you have any other questions in building your alarm light?
[20:17] Arielmo: i'am just trying learn about scripts, i think i need learn first how work a script, later i can use the MiceOnABeam
[20:20] Antonius: You can create a real simple MiceOnABeam model that has a timer- Very easy. Hold on.
[20:23] Antonius: I'm just putting a MOAB model together to show you.
[20:23] Arielmo: U know where have classes about scripts in SL?
[20:25] Antonius: There's a number of places that hold scripting classes. You can do a quick search for them. Someone recommended one to me I'll try to get for you.
[20:26] Arielmo: ok
[20:26] Antonius: It's: ishkiia studios
[20:28] Arielmo: i will start a class in real life this month, but is a long time to finish
[20:29] Antonius: Arielmo, take a look at the following: http://screencast.com/t/w5aJrKafe
[20:30] Arielmo: Loading
[20:33] Arielmo: Great, thank you very much Antonius... I think i can put sounds
[20:34] Antonius: The model has just two states, one for each of the two colors you want.
[20:34] Arielmo: i understand
[20:34] Antonius: The timer is started in the Initial Transition that goes to the Green state.
[20:35] Antonius: The two timer transitions handle the timer event and switch back and forth between the states.
[20:35] Arielmo: Now i will just input llPlaySound in Green State
[20:36] Antonius: Yes, exactly. The Entry Action code of the state will be executed whenever the state is entered.
[20:36] Antonius: If you need something to happen just when you exit the state, put the code in the Exit Action.
[20:36] Arielmo: I will see all the lines of the script to try to understand how work the timer event
[20:37] Antonius: Sure.
[20:37] Arielmo: first i need make the script in MOAB
[20:38] Arielmo: How u make a llSetTimerEvent in the transition to First State?
[20:41] Antonius: Select Edit Properties of the transition to open up it's property editor and then enter in the code in the Transition Action section.
[20:41] Arielmo: is possible make the script just with the codes?
[20:41] Arielmo: Less the //lines and other codes
[20:42] Arielmo: Only my code so i can see how work
[20:42] Antonius: In the Script top-level menu there is the Generate LSL (Optimized) menu item. Select that one to produce code without the comments.
[20:43] Arielmo: ok
[20:44] Antonius: In looking at the code, you will see that that separate functions are created for the Entry Action code of each state.
[20:45] Antonius: Events are handled at the end of the script. You can see the timer() event and how depending on which state is active, a call is made to the appropriate state function.
[20:52] Arielmo: If u will make the same script
[20:52] Arielmo: Using only the SL editor
[20:52] Arielmo: the script have less lines right?
[20:54] Antonius: Yes that's true. Because MOAB has so many features and can handle some very complex modeling scenarios, there is a basic overhead that is part of the script.
[20:54] Arielmo: Yes
[20:55] Antonius: I will be optimizing the code generation so the overhead should become less over time.
[20:55] Antonius: In fact the next release has some improvements here.
[20:55] Arielmo: but the script of MOB is working perfectly
[20:57] Antonius: I'm glad it is!! That's the benefit of MOAB in that it let's people who are not experts in scripting, do the scripting in a more visual way.
[20:58] Arielmo: Really is very good, i am trying learn about scripts a long time
[20:58] Arielmo: Just with MOAB i can learn
[20:59] Antonius: I'm focussing the next release of MOAB on new scripters. So for example instead of typing in llSetColor.... you can select this action from a menu, fill in a form, and MOAB will automatically generate the code for you.
[21:00] Arielmo: Great
[21:00] Antonius: Take a look at: http://www.screencast.com/t/U92duQYQmHO
[21:01] Antonius: This shows you how you will be able to set the color of a prim in the next release without entering in llSetColor.
[21:01] Arielmo: is better to newbies like me
[21:01] Arielmo: lol
[21:01] Arielmo: Hey Antonius, the initial point in MOAB is a code?
[21:03] Antonius: The Initial Point is part of every state in a model, and you draw a transition from the Initial Point to a state to indicate the state to start-up in.
[21:04] Arielmo: But the initial point is in outside of state
[21:05] Antonius: Each model has a top state, and the initial point when you first open a model is the one for the top state.
[21:05] Antonius: One of the features of MOAB is that you can have states WITHIN states.
[21:05] Arielmo: Ohhhh, the empty file is one state?
[21:06] Antonius: Yes, an empty model has a built-in top state.
[21:07] Antonius: If you select one of your states and right-click to get the context menu, select Open State.
[21:08] Arielmo: Fantastic
[21:08] Antonius: Then you will see inside the state, and you will see another Initial Point. If you wanted, you could add additional states inside there, and the Initial Point would indicate which state to start up in.
[21:09] Antonius: Now in the case of a Composite State (a state with states inside) you don't always have to connect to the Initial Point as you may get to a sub-state through an Entry Point, but that's a bit more advanced.
[21:10] Arielmo: i understand
[21:10] Antonius: You can read all about it here: https://miceonabeam.fogbugz.com/default.asp?W31
[21:13] Antonius: The documentation has lots of material if you want to do more advanced stuff. Take a look at it if you haven't already: https://miceonabeam.fogbugz.com/default.asp?W1
[21:14] Antonius: Anyways, time to sign off. I hope this has been helpful for you.
[21:15] Arielmo: this is very important for me, and i dont know how i thank you
[21:16] Arielmo: i'am trying learn about scripts in a lot of years... Just now i know understand a little
[21:17] Antonius: No problem at all.
[21:19] Arielmo: The Light is my first script.... In a long time i want learn with you how i make scripts more hard
[21:20] Antonius: Great! Thanks. Chat again soon! You can always IM me or send a question to support@miceonabeam.com
[21:20] Antonius: I will be happy to help you again.
[21:20] Antonius: Bye!!
[21:20] Arielmo: ok
[21:20] Arielmo: thanks
[21:20] Arielmo: bye
MiceOnABeam User Group,
Weekly Chat Comments Off 