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



Let's say your doll has two different cels for blinking eyes, one for them to be fully closed and one for half-closed. You don't need a cel for open eyes if the eyes open are drawn right on the doll. The half-closed eyes will be blink1.cel and the fully-closed eyes will be blink2.cel.

;@EventHandler()
;@initialize()


Look in your cnf file for these two things, between the object coordinates and the cel list. If you don't find them, save your doll through your KiSS program and they should appear (but if you're using PlayFKiss be sure to get rid of transparencies first!!!). The ;@initialize code is to specify all the things that are supposed to happen right when the doll is opened, so in this spot you'll need to make blink1.cel and blink2.cel disappear and start the timer to cause your doll to blink.

;@EventHandler()
;@initialize()
;@unmap("blink1.cel")
;@unmap("blink2.cel")
;@timer(1, 2000)


The ;@unmap code makes cels disappear, and it's opposite ;@map makes them reappear(this will come up in the next step). Since all cels are mapped by default at the start of the doll, it's only necessary to code the cels you want to have disappear at the start. The ;@timer code sets a timer to trigger an event which is specified by the ;@alarm code. See, you have to set the timer on your clock and when the timer goes off you hear an alarm in the morning, so it's easy to remember that sequence for KiSS dolls. The first half of the timer command gives the timer a number, so it sets off the correct alarm. If it weren't for that, you wouldn't be able to have more than one in a doll! In the above code I named it timer 1, but you could name it timer 43 if you really wanted to. The second half sets the amount of time you want to wait until the alarm is triggered. The timer function will set off the alarm after the specified amount of 1/1000 of a second. So, half a second would be 500, and one second would be 1000. In this particular timer, I have chosen 2 seconds. Next, you need to code the first alarm.

;@alarm(1)
;@map("blink1.cel")
;@timer(2, 200)


This second part covers the first half of the blink, to make the eyes half-closed. The number in the ;@alarm code is the same number as the timer, so the player knows to set off the right alarm at the right time, just like how your alarm clock doesn't go off when the person next door to you needs to wake up (ok, maybe I should stop the alarm clock analogies). The ;@map code makes blink1.cel appear, so the eyes are half-closed. After that you need to put another timer, which I called timer 2. Like before, you can pick any number as long as it's different than the first. For the amount of time I chose 1/5 of a second. As a general rule, if you want a slower animation you need more cels to show the animation and less cels for a faster animation. So, if you want a slow, flirtatious blink then you should make more blinking cels to prevent the animation from looking jagged. But, you should always have at least one in-between blink cel for your dolls, unless their eyes are really small (for example, my Kenshin doll only has an eyes-closed blink, but his eyes are puny so it doesn't make a difference). I find 1/5 of a second to work as a good gap between animations for most things. Now, onto the second part of the animation.

;@alarm(2)
;@unmap("blink1.cel")
;@map("blink2.cel")
;@timer(3, 400)


Congratulations! Your doll's eyes are completely closed! You're halfway finished on the road to blinking! You need to unmap the first blinking cel so it doesn't cover over the 2nd blink cel when you want closed eyes. I set the timer here to 2/5 of a second because it's my personal preference to have the eyes-closed phase slightly longer than the halfway phase, but you can make it as long or short as you want (as long as the viewer can tell the doll's blinking).

;@alarm(3)
;@unmap("blink2.cel")
;@map("blink1.cel")
;@timer(4, 200)


This is pretty much the same as the second timer, but you need to unmap the blink2.cel so it doesn't stay around when the blink is finished. Now, onto the finale.

;@alarm(4)
;@unmap("blink1.cel")
;@randomtimer(1, 2000, 6000)


This unmaps the blink1.cel and finishes with the doll's eyes open again. At the end of this, I used a randomtimer code. It acts just like a timer, except instead of using a fixed amount of time to set an alarm off it chooses a random time between two numbers, in this case between 2 and 6 seconds. This randomtimer I gave the same number as the first timer, because its purpose is to start the blinking sequence all over again, in a constant loop. Randomtimer is better to be used here, since in real life people blink randomly, not exactly every three seconds. However, for between the blink you should use a timer to keep the animation smooth. With some experimentation you'll learn which kind of timer is appropriate for a certain animation.

Now, let's see what that code looks like when we put it all together:

;@EventHandler()
;@initialize()
;@unmap("blink1.cel")
;@unmap("blink2.cel")
;@timer(1, 2000)
;
;@alarm(1)
;@map("blink1.cel")
;@timer(2, 200)
;
;@alarm(2)
;@unmap("blink1.cel")
;@map("blink2.cel")
;@timer(3, 400)
;
;@alarm(3)
;@unmap("blink2.cel")
;@map("blink1.cel")
;@timer(4, 200)
;
;@alarm(4)
;@unmap("blink1.cel")
;@randomtimer(1, 2000, 6000)


When you save the doll in your KiSS viewer, the extra ; in between commands will disappear and some tabs will be added in front of the commands to sort them. Tabs are often difficult to see online, so I stuck with the ; method for this tutorial.

So, now you know how to make blinks. But, don't just limit your use of timers to blinking! There's plenty of other uses for this kind of code. Some of the ones I've used are hair blowing in the wind, stars shining, animated menus, birds flying, lights flashing, and clothes sparkling. And there's also endless possibilities other than those. So, use your imagination and get KiSSing!

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