tut-stickman-06

Mini Tutorial: How to build a walking talking stickman

By popular demand: How to build a walking talking Stickman!!

Pic by Garry Beaumont
Pic by Garry Beaumont

I had a Walking Talking Stickman walking and talking on a place in SL. I loved the guy, I LOL’d every time I saw the little guy walking around and telling how bad his life was.
I was talking to a friend who had a stickman for him self the other day, and we decided that it would be fun to have one on OSgrid.

I logged in on SL, searched through my inventory, found my stickman, rezzed the stickman, and saw how it was build. Pretty easy actually: build a prim stickman (a sphere for the head, the body and limbs are small cylinders), use scripts to animate the legs, use another script to read lines from a notecard, and to let it walk around in a circle, there is ye olde trustworthy ‘slow prim rotation’ script.
Now, I’m not a scripter, I can change scripts a bit so they work on OpenSim, I can create very basic scripts, but animating prims is a bit too much for my old brains.
I know there is a thing called ‘Puppeteer’ on the SL market, but that’s not going to work on OpenSim, because it’s not open source, but this website has a sh%t load of scripts, tutorials, sculpts and other open source things on it.
I found what I was looking for: an open source prim animator. And it works on OpenSim. Yay! \o/

So, I have the animating part covered, now I had to find a script that read lines in a note card, and put them as text above the stickman….
This was a bit harder to find, I had to change an existing example script, test it in-world, change more stuff, test in world, etc, etc.
VICTORY!!! I got a working note card settext script thingy!
/me self hug

So, you want to build your own Walking Talking Stickman?

Let’s begin with a nice cup of coffee/thee/beer/wine/industrial floorcleaner/whatever you like to drink….

Need a potty break? No? You’re sure? Really? OK!

Lets start!

All things have a beginning.

This little project starts with a few tips: Download and install Notepad++!
(Notepad++ is a free (as in “free speech” and also as in “free beer”) source code editor and Notepad replacement that supports several languages. Extremely useful for copy&pasting lsl scripts. )
Also, download and install 7Z if you haven’t got it already installed. This little program let’s you un-pack *.zip files.

Next thing to download: The Scripts!
That’s easy! (I hope the newly installed download manager works!)

Click this:

If the above worked, we are ready for step 2: creating your awesome Stickman!

Your awesome Stickman.

My stickman is 7 prims big/small. One prim for the head, one prim for the body, 2 prims for the arms, two prims for the legs, and on prim as a rotation point.

– Create a cylinder, make it X=0.100, Y=0.100, Z=0.500, and color it black.

– Hold the SHIFT key on your keyboard, hover your mouse on the BLUE arrow and drag the cylinder upwards. A new cylinder appears.

– Change the cylinder in to a sphere and make the dimensions X=0.350, Y=0.350 and Z=0.350.
tut-stickman-01

– Place the head prim on top of the body prim.

Yay! we have a beginning! Time for a break so you can grab yourself a fresh beer, coffee, whatever. I’ll wait right here..

Back? Ok, let’s make a couple of arms and legs.

– Select the cylinder prim again, hold the SHIFT key and drag the cylinder to the side.

– Make the dimensions X=0.05, Y=0.05 and Z=0.25. We have an arm!

– Tilt the arm (Hold CTRL on your keyboard and use the green circle to rotate the prim) so it looks like the pic below.

tut-stickman-02

– Move the arm a bit so it attaches to the body, just below the head.

– While holding the SHIFT key, drag the arm to the other side of the body, rotate it in a good position and voila, your stickman has two arms.

tut-stickman-03

– Hold the SHIFT key and select both the arm prims, drag them down and change the dimensions of both legs to X=0.05, Y=0.05 and Z=0.35

The stickman is ready, but we need an extra prim that we use as a rotation point.

– Select the body prim, hold the SHIFT key and drag the body prim to the side. I have dragged it about 1.5 meters to the right.

tut-stickman-04

Next thing we should do is linking everything together.

– Select the head.

– Hold down the SHIFT key on your keyboard.

– Click on the body, both arms, both legs and finally on the rotation prim. This is important! The rotation prim should be selected last.

– Click on the ‘Link’ button in the Edit window. (Or use CTRL-L).

– In the General Tab, you can name the stickman. Use Stickman for now. We’ll change this later to a cooler name.

– Right-click on the stickman, click ‘More’ in the menu that appears, then click ‘Take copy’. It’s always wise to take a copy when you are building!

The stickman is ready to be scripted now.

Do you walk the walk and talk the talk?

Let’s start with un-packing the zip file you have downloaded earlier. Un-pack the files somewhere convenient on your computer.
There should be 5 files in the zip file:

  1. Animator.lsl – This records and plays the animations.
  2. Movement.lsl – This script tells the animator.lsl script in which order the animations should be played.
  3. Notecard Reader.lsl – This script reads the lines from a note card and puts it above the head.
  4. Slow Rotation.lsl – Lets the stickman walk in circles.
  5. Store 0.lsl – A database script that stores the animations.

(credits for Animator.lsl, Movement.lsl and Store 0.lsl goes to Ferd Frederix)

You can open the *.lsl scripts with Notepad++, it’s a better alternative then the standard notepad.

But first we need to make a new note card in your inventory in-world and fill it with lines of text.

– Open your inventory and create a new Notecard.

– Name it rants (very important)

– Type a couple of lines of text, like I love Oddball, Oddball is the best, etc, etc. Don’t forget to hit ENTER after every line of text.
tut-stickman-05

– Save the notecard.

Now we’re ready to start putting some scripts in some prims.

– Select the stickman and open the Edit window.

– Tick ‘Edit Linked’ and click on the head of the stickman. This lets you edit only the head with messing with the other prims.

tut-stickman-06

– Open the ‘Content’ tab.

– Find the ‘rants’ notecard in your inventory and drag it on the content tab of the prim. The notecard should appear in the content tab.

– Open the Notecard Reader.lsl file on your computer.

– Select the whole script (CTRL-A) and copy it (CTRL-C).

– Click on the ‘New Script’ Button. This creates a new standard script in the head prim. Rename the prim to Notecard reader.

– Double-click on the new script to open it, you’ll see a standard script. Remove this script.

– Hit CTRL-V on your keyboard to paste the script.

– Save the script.

It’s aliiiive! Well, if things went ok, you should see the stickman talk:)

Now the hard part of this build: animating your stickman.

If your Edit window is still open, un-tick the ‘Edit Linked’ option. All the next scripts should go in the rotation prim. THIS IS IMPORTANT!!

If your Edit window is closed; open it :-)

Give your stickman a cool name, like walkin’ talkin’ stickman or something like that. This way you’ll know the difference between an un-scripted stickman and a scripted stickman in your inventory.

Come on baby, lets walk.

Time to put another set of scripts in the stickman. Again, make sure that ‘Edit Linked’ is UN-TICKED!

– Open the ‘Store 0.lsl’ script on your hard drive.

– Select the whole script (CTRL-A) and copy it (CTRL-C).

– Now switch back to your viewer, and create a new script in the content tab of the stickman. Name this new script Store 0

– Again, open the script, remove the standard script, and replace it with the store 0 script you copied 2 steps back. (CTRL-V remember?)

– Save the script.

– Repeat this for the Animator.lsl script. (open the script on your hard drive, select all, copy it, create a new script in the stickman, rename it to animator, remove standard script, paste animator script, save.

tut-stickman-07

There should be some action now! If everything went well, you should see a couple of messages in chat. This means that your stickman is ready to record a couple of simple animations.
I kept the animations fairly simple (hey! It’s a stickman, not a Chinese circus artist who can bend in un-human ways!!)

Click on your stickman in-world, a menu appears.
tut-stickman-08

– Click on the ‘Name’ Button.

– Depending on what kind of world you are on, you’ll see a textbox (SL, OpenSim) or a message in chat (Aurora). Follow the instructions you see in-world carefully.
In this case the textbox and/or chat message asks for a name for the first animation. I kept it simple, I named my first animation 1. You should name the first animation 1 too, the names come back in another script we are going to use later.
The scripts needs to see some kind of prim movement before you can record anything, so we are going to record a ‘base position’ first.

– Open the Edit window of the stickman if it’s not open, and tick ‘Edit Linked’ again.

– Select the head prim, and move it up a bit. I changed the Z position from 23.6084 to 23.6085. (See pic)
tut-stickman-09

– Click on ‘Record’ in the menu.

Our first animation is recorded, time to name the next step in this animation.

– Click the Name button again, name this animation 2.

– Now comes the really hard part. Placing the legs in a walking position. (Again, if your Edit window is closed open it, and tick the ‘Edit Linked’ thingy)

– Select one of the legs and position in a manner that it looks like it is taking a step forward. You’ll have to rotate and move the leg. Do the same for the other leg, but in the opposite direction.

tut-stickman-10

– If you are happy with the leg positions, hit the record button to save this part of the animation.

– Click the Name button again, and name this animation 3.

– Again, go in to Edit mode, tick the Edit Linked thingy.

– Now we need to rotate and move the legs in the opposite direction. In my case, the right leg should go backwards and the left leg forwards. It’s the same thing we did before. Go in edit mode, tick Edit Linked, move/rotate one leg, etc, etc.

– When you are happy with this part of the animation, click Record in the menu.

For a simple stickman we have all the animations we need.
(NOTE: the script should be able to record all the prim positions in one animation set, but we made three sets (named 1,2 and 3). I had some difficulties on OSgrid, the animation wouldn’t play properly, so that’s why I created 3 sets of animations.)

Time to save the animations to the database (= the Store 0 script).

– Click on the ‘Publish’ button in the menu. You’ll see a message in chat that it is saving the movements.

– Click Finish in the menu to finish the programing part.

Eerrm…my stickman isn’t moving?

That’s right! We need to add one more script to let it play the animations, and another script to walk around and finally we need to hide the rotation prim.

Let’s start with playing the animations.

– Make sure ‘Edit Linked’ is NOT ticked.

– Create a new script in the content tab (you should see the Animator and Store 0 script)

– Name this script Movement.

– Find and open the Movement.lsl script on your hard disk.

– Select the whole script (CTRL-A) and copy it (CTRL-V).

– Open the movement script that you just created in the Stickman, remove the standard script, and replace it with the movement script (CTRL-V).

– Save the movement script.

Your stickmans legs should be moving now! Depending on which world you are, this could go fast or slow. You can change the speed of the movement in the movement script.
Find (in the script) the following line:

llSetTimerEvent(0.1);

You can play with the numbers here a bit. 0.1 seems to work pretty well on OSgrid, but it too fast on Aurora. I had to set it to 0.5.
Remember to save the script after you have changed it.

Almost done folks.

Just add the Slow rotation script to the stickman (open script on hard drive, copy it, and paste it in a new script in the stickman…You know the drill :-) )

To hide the rotation prim:

– Go in Edit mode once more, tick the ‘Edit linked’ thing again.

– Open the Texture tab.

– Set ‘Transparency’ to 100%.

Et voila, a walking talking stickman!

***IMPORTANT***

IF YOU ADD NEW LINES TO THE RANTS NOTECARD, ONLY RESET THE NOTECARD READER SCRIPT. DO NOT RESET THE OTHER SCRIPTS…REALLY…DON’T…

Have fun guys!

 

One thought on “Mini Tutorial: How to build a walking talking stickman”

  1. I notice that movement script has animiation 2 and 3 as name. The name that is entered in the animation creation steps must be same
    2
    3

    ( a working copy is on 4freedom_content)
    hope it help
    gimisa

Leave a Reply