Serious Sam 3: BFE

Serious Sam 3: BFE

Not enough ratings
How to add blinking to your player model
By NSKuber
With this guide you will be able to make your multiplayer model blink naturally at all times, just like characters in the "Life is Strange Character Pack"!
(by "your model" I mean model that you have created, not the one you play with)
I'm assuming that you know how to install and work in SED (you have at least created your own player model, haven't you?), so I won't go into details about the basics.
So how do I make it?
If you have no idea what I'm talking about talking about, see this mod.

I am aware that one can use animations to animate eyelids, and it will be smooth and good, but the problem is, you cannot force eyelids animations over other animations and make them act randomly and independently of body animation that is currently playing. This method does that.

First thing you should do is subscribe to that mod. This is important, because it contains world scripts that make it all work, and you will only need to make some additions to your model. All players that want to see this blinking should also subscribe to that mod.

Let's start! Like moving eyes, this mod works by showing and hiding attachments, so blinking is discrete. You need to decide how many frames there will be in eye closing. I chose 4.

Now open your model, save "Children holder" file to your model folder, and create (<frames>+2) attachments, where <frames> is the number of frames in your blinking. Name the first (<frames>+1) created attachments "Eyelids_0", "Eyelids_1",..., "Eyelids_<frames>" respectively. Mark them all as "Hidden".

Now what you need to do is somehow make models for eyelids, insert them into attachments and place them so that:
  • when all "Eyelids_x" attachments are hidden your player model should look ok, because this is how it will look in the player selection menu and for players that don't have script from LiS package.
  • when all "Eyelids_x" attachments are hidden except for "Eyelids_0": this is how you will look when not blinking for players that have the script;
  • when all "Eyelids_x" attachments are hidden except for "Eyelids_k": this is how you will look when playing k-th frame of blinking;
For example, Kate Marsh model with: All hidden
"Eyelids_0" shown
"Eyelids_1" shown
"Eyelids_2" shown
"Eyelids_3" shown
"Eyelids_4" shown (eyes closed)

This is the most interesting part, and the one I will not tell you how to do, because it depends on what kind of model you have and what you can do with it. But after you make it you're almost done. I was lucky and could pose LiS models in special program, including eyelids.

Now open the last attachment (empty one, don't forget to mark all others "Hidden") and name it "BlinkingParams". Don't attach it to any bone and don't add any flag or model. Open "Target offset->v"
Now fill the fields as follows:
  • into "x" coordinate put number of frames you have, divided by 10;
  • into "y" coordinate put minimum delay between normal blinks, divided by 10;
  • into "z" coordinate put maximum delay between normal blinks, divided by 10;
  • into the first "q" field put the duration (in seconds) of eye closing;
  • into the second "q" field put the duration (in seconds) of eye in closed state;
  • into the third "q" field put the duration (in seconds) of eye opening;
Let me explain. This is parameters from my models:

  • v.x=0.4 means that there are 4 frames in closing and opening;
  • v.y=0.25 means that minimum delay is 2.5 seconds;
  • v.z=0.65 means that minimum delay is 6.5 seconds;
  • q.h=0.06 means that eye will be closing during 0.06 seconds. This means that every frame of the closing (0,1,...,<frames>-1) will be shown for 0.06/4 = 0.015 seconds;
  • q.p=0.02 means that after closing eye will remain in closed state (<frames>) for 0.02 seconds;
  • q.b=0.08 means that eye will be opening during 0.08 seconds. This means that every frame of the opening (<frames-1>,...,1,0) will be shown for 0.08/4 = 0.02 seconds.

So what do we have? Every 2.5 to 6.5 seconds (delay is chosen at random) model will blink for a total of 0.06+0.02+0.08=0.16 seconds.

To check if it works, start any multiplayer map in the editor, choose your model and look at your face using "Fly" cheat. If it blinks, then congratulations, you've made it!

By the way, model will blink not only after delays, but also when you quickly turn around or receive damage.

If you have any questions or corrections, leave them in the comments.
< >
xDShot™ Jan 12, 2017 @ 6:32am 
I just heard Serious Engine 3 uses Lua scripting, so I though it can be used to affect on playermodels' bones, like in GarrysMod.
NSKuber  [author] Jan 12, 2017 @ 6:24am 
That is a good idea. Some player models even utilize it. But, the problem is, you cannot affect just some bones by scripting. Therefore can only add this "bone" rotation to some animations, which are played naturally. Even if you are crazy and add blinking to all of them (and there are a lot of animations for player!), it will always be predetermined, played on same animations in same way, not accessible by scripting. You can force animation on body by scripting, but it will affect the whole body. This method, on the other hand, is completely independent of body animations.

So yeah, this is the first idea that comes to mind, but unfortunately, nobody was able to make it work so good and random as presented method works.
Thanks for pointing out, I'll add this remark to the beginning.
xDShot™ Jan 12, 2017 @ 6:10am 
Better idea:

Why not to rig those lids onto eyelids bones and rotate them? This makes possible to interpolate those lids instead of using step-framed ones (I hope I tell it clear). I don't know much about Serious Engine, but can it affect on bones somehow by programmable scripts?