Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Eye Blinking Script?
goodcap Offline
Member

Posts: 193
Threads: 112
Joined: Jun 2012
Reputation: 3
#1
Eye Blinking Script?

I want to add realism to my custom story, so I was wondering if there's a way to make an eye blinking effect (screen fades out every few seconds)
06-07-2015, 03:18 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Eye Blinking Script?

Add a timer, that calls itself.
Use FadeOut(float) and FadeIn(Float)
Voila.

A timer that calls itself can look like this:

void Timer(string &in asTimer)
{
AddTimer("", 1.0, "Timer");
}

Trying is the first step to success.
06-07-2015, 03:22 AM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#3
RE: Eye Blinking Script?

Just do not make it too much!
Blinking \ flickering could be disturbing!
Take it slow on that.
Might also take a RandInt for the blinking for randomised (events)
06-07-2015, 10:34 AM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#4
RE: Eye Blinking Script?

Why the hell would you add blinking eye to your story since the player blinks naturally dude?!
06-07-2015, 11:13 AM
Find
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#5
RE: Eye Blinking Script?

(06-07-2015, 11:13 AM)Lazzer Wrote: Why the hell would you add blinking eye to your story since the player blinks naturally dude?!

Someone's mad and not agreeing with someone's idea..

06-07-2015, 11:15 AM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#6
RE: Eye Blinking Script?

Laz doesnt't have a good day, seen his other post??
https://www.frictionalgames.com/forum/thread-30098.html
GoodCap, dont mind Lazzer, he is a pain in the ass sometimes.
Lets all stay On-Topic please!
(This post was last modified: 06-07-2015, 11:22 AM by DnALANGE.)
06-07-2015, 11:22 AM
Find
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#7
RE: Eye Blinking Script?

yeah. I'd personally find it to be more of an annoyance too. But since you asked.

PHP Code: (Select All)
void RandEyeBlink (string &in asTimer) {

FadeOut(0);
FadeIn(0.2f);
AddTimer("RandomRepeatBlink"RandFloat(3.0f10.0f), "RandEyeBlink");


This is probably as close as you can get. For me anyway.

If you'd want to stop it at some point, you would have to add an if statement or remove the timer.

If you don't draw first, you don't get to draw at all... -The False Shepherd
(This post was last modified: 06-07-2015, 11:26 AM by RaideX.)
06-07-2015, 11:23 AM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#8
RE: Eye Blinking Script?

So I'll answer the actual question of the thread. I made a function named Blink, where you can just use it in a regular looping timer.

void Blink(float fFadeOut, float fFadeIn)
{
    FadeOut(fFadeOut);
    AddTimer("loop", fFadeOut, "TimerBlink");
}

void TimerBlink(string asTimer) { FadeIn(fFadeIn); }

So let's say you have a looping timer ready, you place this function in it.

void LoopTimer(string asTimer)
{
      Blink(1.5f, 2.0f);
}

fFadeOut stands for how quick you want the player to close his eyes, meanwhile fFadeIn stands for how quick you want the player to open his eyes.

Derp.
06-07-2015, 12:00 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#9
RE: Eye Blinking Script?

This has been taken elsewhere. Please refrain from commenting in this matter anymore in this thread. Violators will be warned.

[Image: Tv0YgQb.gif]
Image by BandyGrass
06-07-2015, 12:02 PM
Find




Users browsing this thread: 1 Guest(s)