# Renderclonk Examples

Renderclonk Examples
Those who do not know about modeling with Blender should first do a generic blender tutorial.
To do so please follow one of the beginner's tutorials on http://www.blender.org/education-help/tutorials/.
There are also Blender tutorials on the Clonk Center, e.g. a flint, a construction kit oder a sword. They are in German language however.
Farmer Humpe wants to become a clonk.
The goal of this tutorial is to create a Farmer clonk. So let's start up Blender and open the script. Since the farmer is supposed to be based on the normal Clonk the first thing we do is to load the Clonk model. In the scripting window click on LoadClonk or and select Clonk.mesh (or Clonk, respectively). Now the Clonk is loaded and we find ourselves in the main menu. Next, we rename the Clonk to Farmer so that we don't overwrite the original Clonk. To do so we click on Save/Load and change Clonk to Farmer in the Clonk Name field. Now the Farmer can be saved by another click to Save Clonk.
Great, so we have already created a new Clonk. The Farmer!
Farmer Seeks Hat
To be able to see a difference between Farmer and Clonk the Farmer should look different of course. So let's give him a hat.
First an appropriate hat needs to be modeled. This should not be a problem when making use of one of the Blender tutorials mentioned above.
Initially the hat is an individual mesh. To be able to be stored together with the Clonk it needs to be connected to the Clonk mesh. To do so first switch to ObjectMode (maybe switching from the EditMode using Tab) and right-click the hat mesh, then right-click the Clonk mesh while pressing the Shift key. Now the hat has a dark border and the Clonk has a bright one. Pressing Ctrl+J connects the two meshes.
To move the hat together with the Clonk's head it needs to obtain an appropriate VertexGroup. Click on , then on the left click on the symbol next to the text entry. From the drop-down menu choose 'Head' (referring to the head bone, i.e. the bone which controls the head). Afterwards switch to Edit mode using Tab, select all vertices of the hat (it doesn't matter if a few head vertices are selected as well) and assign them to the Vertex group by clicking on Assign.
In the scripting window the Farmer can be saved including its head by choosing Clonk, then Save Farmer.
Humpe wants to have pants
As a next step Farmer Humpe wants to have his own pants since the unit jumpsuit of the Clonks can not be used for agricultural purposes. So we need brown leather pants.
The first thing we need is a new material group. So, at in the area to the right hand side of the vertex groups, click 'New'. Then click on and assign a name for the new material, such as 'Leather'. Choose a brownish shade using the color selector. Now the material needs to be assigned to the corresponding parts of the Clonk. In EditMode select the vertices which shall make up the pants, then in click on Assign.
Now that Humpe wears his pants it's time to save the mesh again.
A pitchfork for Mr. Humpp
A farmer without a pitchfork is not a real farmer!
First the pitchfork needs to be modeled. The mesh as well as the object should be assigned the name 'Pitchfork'. Afterwards the mesh should be aligned so that the point at which the Clonk touches the pitchfork is exactly on the Tool1 bone of the armature object (see picture). Then save the pitchfork using the 'Save Tool' button in the 'Save/Load' menu. In the popup menu choose the 'Pitchfork' entry.
Now of course Humpe should carry the pitchfork when walking. We are going to use the 'WalkStaff' action as a basis for this. To load it go to 'Save/Load' and choose the 'Load Action' entry, then choose 'WalkStaff'. In the 'Actions' submenu choose the 'WalkStaff' action, then click on 'New' to create a new action. Call it 'WalkPitchfork' and answer yes when asked whether to copy the keyframes. This results in a new action called Pitchfork using the keyframes from the WalkStaff action. The last thing to do is to choose the pitchfork as Tool1 so that it uses the pitchfork instead of the staff. Click on 'Save WalkPitchfork' to save the new action.
To make the rendering use the new action instead of the old Walk animation we need to switch it in the action list of the clonk. Go to 'Clonk' and enlarge the window by clicking on . Then change 'Walk' to 'WalkPitchfork'.
Now we can do the same for the Jump action. We load 'JumpStaff' and use it to create the new JumpPitchfork action, then assign Pitchfork as Tool1. Don't forget to set the length of the jump animation to 8 instead of 16 frames. Eventually replace Jump by JumpPitchfork in the action list.
Now Humpe happily walks and jumps around carrying his pitchfork! Time to save.
Finally farmer Humpe can be rendered and enjoy being a Clonk:
Farmer uprising! Humpe fights
But this is not enough! Humpe also wants to use his pitchfork for fighting.
So fighting animations need to be created. However since one cannot use the pitchfork to strike the same way as with a sword we cannot simple replace the sword by a pitchfork in the sword fighting animation. This means we need to create a new animation from scratch.
To do so we switch to the Action submenu, click New and choose 'PitchforkStrike' as the new name. When asked whether to copy the keyframes we say 'No' this time. The animation length is set to 8 and the width to 24. The height we leave at 20. Now select the armature object and switch to 'Pose Mode'.
First switch to Frame 1. The frame number is shown in the bottom-left corner of the 3D window, or as a green line in the animation window respectively (see picture). So either click at the position of Frame 1 in the animation window or navigate to Frame 1 using the arrow keys. Having arrived at the first frame we can bend the Clonk's bones to how he is supposed to look like at the beginning of the strike animation. The camera should look at the clonk somewhat displaced from the front since this is the case for most animations.
Bones at their final positions need to be taken over to the keyframe list by pressing the 'i' key and choosing 'LocRot'. When the pose is finished and all bone positions are saved as keyframes we can continue. In frame 5 the Clonk should be at the backmost position when striking out (intermediate frames are computed automatically by Blender). Then in frame 7 the Clonk should be stabbing directly towards his enemy. The 9. frame should be the same as the first so that the Clonk returns into his initial position. So we press 'b' to select all keyframes of the first frame by drawing a selection rectangle in the action window. Using Shift+D they are duplicated and moved to frame 9. Why frame 9 when we only have 8 frames, you might ask. We don't need the first frame twice in the animation, the additional frame is just so that the eighth frame is computed as a transition from the seventh to the first frame by Blender.
A click on 'Save StrikePitchfork' makes sure the new action is saved.
Now we need another animation in which Humpe is in fighting position with his pitchfork (when two clonks stand opposed to each other when fighting). In this case a copy of SwordFight is good. So let's load SwordFight via 'Save/Load' and 'Load Action'. In the 'Action' submenu create a copy of the action with 'New'. The length needs to be set to 4 and the width to 24. Tool1 is again chosen to be our pitchfork.
However now we can see that the Clonk is holding the pitchfork too high up. So in 'Pose Mode' lower the Tool1 bone a bit and insert a keyframe with 'i' and 'LocRot'. Do the same for frames 1, 3 and 5, then save with 'Save PitchforkFight'.
Eventually the two actions need to be added to the action list of the Clonk. To do so click on the empty field below Drink and choose 'PitchforkFight'. Then click again in the next empty field which gets created below 'PitchforkFight' and choose 'PitchforkStrike'.
Clicking on 'Save Farmer' saves what we have done.
Finally our little Farmer is finished. Both Graphics.png and Overlay.png are created in the Graphics/Farmer subfolder when clicking on 'Render', then 'All', then 'Both'. They can be used to add the graphics into the game.
Randrian
2008-05