x x Header
x x Header
x x Header
Home
Templates
Props
Patterns
Palettes
Tutorials
Submissions
x
Changing Hairstyles - An Fkiss Tutorial by Omanyte-Chan Click here to e-mail contributor. Click here to visit contributor's website.



There are several different ways to change hairstyles in a KiSS doll, from menus, to click-cycles, to set-changing. First we'll start off with the easiest, a click-cycle. For each of these examples, the doll will have three different hairstyles, named hair1.cel, hair2.cel, and hair3.cel. The doll will always open up with hair1 showing.

Method 1 - Click-cycle hairstyles
A click-cycle is when you click on a doll's hair to make it change hairstyles. The first thing you need to code is in the ;@initialize() section of the KiSS doll, to make only hair1.cel appear at the start of the doll, and the other two hair styles disappear. This section is between the cel list and the object coordinates if you look in your cnf. If it's not there, then save your cnf in PlayFKiSS, and it should appear (just make sure to remove the transparencies first!)

;@EventHandler()
;
;@initialize()
;@unmap("hair2.cel")
;@unmap("hair3.cel")


Everything you write directly after the ;@initialize code will happen right after the doll is opened. The ;@unmap code makes a cel disappear from view. When a KiSS doll is first opened, all cels will appear by default, so you only need to write code for the cels you don't want to have appear. The next part of the code is to make hair1 disappear, and hair2 appear when you click on hair1.

;@press("hair1.cel")
;@unmap("hair1.cel")
;@map("hair2.cel")


The ;@press command is triggered when the mouse clicks on the specified cel, in this case hair1. When you "press" the mouse button, the events below that command are triggered. With the unmap code, hair1 disappears, and with the ;@map code, hair2 appears. ;@map is the opposite of unmap, and makes cels that have been unmapped reappear. Now, you need to repeat this step for hair2 and hair3, with the same code, but replacing the cel names:

;@press("hair2.cel")
;@unmap("hair2.cel")
;@map("hair3.cel")
;
;@press("hair3.cel")
;@unmap("hair3.cel")
;@map("hair1.cel")


With this part of the code, clicking on hair2 will make hair2 disappear and hair3 appear, and clicking on hair3 will make hair3 disappear and hair1 appear. And so, the click cycle is finished. Here is what the whole code looks like when you put it together:

;@EventHandler()
;
;@initialize()
;@unmap("hair2.cel")
;@unmap("hair3.cel")
;
;@press("hair1.cel")
;@unmap("hair1.cel")
;@map("hair2.cel")
;
;@press("hair2.cel")
;@unmap("hair2.cel")
;@map("hair3.cel")
;
;@press("hair3.cel")
;@unmap("hair3.cel")
;@map("hair1.cel")


See, very simple. In order for the codes to work separately, they need to be separated by a semi-colon (;) with nothing after it. After saving your work in PlayFKiss, this will change to having the commands grouped by tabs, which also work, but tabs often look like spaces on the internet, so I wrote it using this format. Both ways are correct and both will work. Other than hairstyles, the click-cycle can be used for lip-color, facial expression, clothing color, weather outside a window, and many other effects. Use your imagination! With the click-cycle, you can easily edit the code to work for any amount of hairstyles, but for dolls with lots of styles, or styles in many colors, it's better to use a menu for hair.

Method 2 - Using a menu to change hairstyles
This code uses the same commands as the click-cycle, but more cels and more coding. For this section, there are three menu buttons named h1.cel, h2.cel, and h3.cel, and they correspond to hair1.cel, hair2.cel, and hair3.cel, respectively. Clicking on h1.cel will make hair1.cel appear, and hair2.cel and hair3.cel disappear. The initialize section is the same as for the click-cycle, so I won't write it again. Here is the code for clicking on h1.cel:

;@press("h1.cel")
;@map("hair1.cel")
;@unmap("hair2.cel")
;@unmap("hair3.cel")


Because you don't know which hairstyle will be showing when the user clicks on this option, you must code to make all other hairstyles disappear and only the hairstyle you want showing to appear. This must be done for each option in your hairstyle menu, so for hair2 and hair3:

;@press("h2.cel")
;@map("hair2.cel")
;@unmap("hair1.cel")
;@unmap("hair3.cel")
;
;@press("h3.cel")
;@map("hair3.cel")
;@unmap("hair2.cel")
;@unmap("hair1.cel")


Voila! Now you have a hairstyle menu. This is what the code looks like when you put it all together (I put the initialize part in this too):

;@EventHandler()
;
;@initialize()
;@unmap("hair2.cel")
;@unmap("hair3.cel")
;
;@press("h1.cel")
;@map("hair1.cel")
;@unmap("hair2.cel")
;@unmap("hair3.cel")
;
;@press("h2.cel")
;@map("hair2.cel")
;@unmap("hair1.cel")
;@unmap("hair3.cel")
;
;@press("h3.cel")
;@map("hair3.cel")
;@unmap("hair2.cel")
;@unmap("hair1.cel")


See, not much different than the click-cycle, just the same codes being used in different ways. Other than hairstyles, this kind of code can be used for make-up, backgrounds, scars appearing, and lots of other things. You can also use these codes to create other effects, like a ghost appearing when you click on a candle, or a closet appearing and disappearing. Use your imagination!

Sometimes, you may dress a doll up in a certain outfit in a certain set, and think "Wow, this would look great with hair2" and in another set "Hair3 would be awesome with this!" So, you go for the changing hairstyles when the set is changed code, which is usually used in conjunction with the menu or click-cycle code.

Method 3 - Changing hairstyles when the set is changed
In this section, the stuff right after ;@initialize part is only necessary if set 0 doesn't have this code for it. However, if set 0 does, then you don't need it because the effect will take place right when the doll opens. However, to run any FKiSS, the EventHandler and initialize codes themselves need to be there.

Let's say that you want the doll to have hair3 for set 0, hair1 for set 1 and hair2 for set 2. This code can be written for sets 0-9, but I'm too lazy to bother doing it for just 3 hairstyles since the code is the same. This first part will tell the KiSS viewer to make hair3 appear and hair1 and hair2 disappear when the user goes to set 0.

;@set(0)
;@map("hair3.cel")
;@unmap("hair2.cel")
;@unmap("hair3.cel")


The code for the rest of the sets is just the same, except you substitute the correct set number and names of the cels you want mapped/unmapped. Here's how the code looks when it's all put together, with the sections for set 1 and 2 added in:

;@set(0)
;@map("hair3.cel")
;@unmap("hair2.cel")
;@unmap("hair1.cel")
;
;@set(1)
;@map("hair1.cel")
;@unmap("hair2.cel")
;@unmap("hair3.cel")
;
;@set(2)
;@map("hair2.cel")
;@unmap("hair1.cel")
;@unmap("hair3.cel")


And that's all there is to it! If you do decide to use this option for hair, always include a click-cycle or menu in addition to this, because if hair only changes when the set does, you can just put the certain hair cels in those sets and not bother writing FKiSS. However, this can be used for more than just hair. You can change skin color, skin markings, facial expression, or even use it to stop/start timers and such. Be creative!

This tutorial was written by Omanyte-Chan.
x x x
x x All images are copyright their respective owners.    -    Back to Top