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 Screen effects won't stop
Aletho Offline
Junior Member

Posts: 14
Threads: 4
Joined: Jan 2015
Reputation: 0
#1
Screen effects won't stop

Hey guys!

Here's the thing: I have 2 maps. The first one ends with the player fainting and then loading the next map. In the first map, there's a lot of screen effects as you can see in the script below.
Now, the problem is that when the second map has loaded, it keeps the blurred slow-mo-ish screen effect. I can't seem to fix it no matter what I try, so I hope you know how to solve this.

Here's the script for map 1:
Spoiler below!

void OnStart()

{
// AddEntityCollideBacks
AddEntityCollideCallback("Player", "Felldown", "Teleport1", true, 1);
AddEntityCollideCallback("Player", "Faint", "Faint", true, 1);










FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
//FadeImageTrailTo(3, 1);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(65, 100, 100); // "Tilts" the players head
FadeRadialBlurTo(0.4, 1);

SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}

void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadeSepiaColorTo(0.5f, 0.5f);
FadeRadialBlurTo(0.7f, 0.5f);
FadePlayerRollTo(0, 1.7, 50); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
SetPlayerMoveSpeedMul(0.2);
PlayMusic("29_amb_end_daniel", false, 3, 3, 10, true);
AddTimer("", 1.0f, "SkidtTekst");
}

void SkidtTekst(string &in asTimer)
{
SetMessage("Thoughts", "skidt", 5.0f);
}




void OnEnter()
{

}


void Faint(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("sound", "react_sigh1.snt", "Faint", 0.0, false);
FadePlayerRollTo(65, 100, 100); //Rotates the position of the camera on the player's body.
//afX - angle of rotation of head, positive being counter-clockwise
//afSpeedMul - speed (possibly acceleration) multiplier of the rotation (default 1, which is really slow)
//afMaxSpeed - maximum speed of rotation
SetPlayerCrouching(true);
SetPlayerActive(false);
FadeImageTrailTo(3, 1);
FadeOut(5.0f);
AddTimer("fadeout", 5.5f, "TimerChangeMap");
//Applies the image trail effect to the screen.
//afAmount - intensity (default: 0)
//afSpeed - time in seconds until full effect
FadeRadialBlurTo(0.4, 1);
//Applies radial blur effects to the screen.
//afSize - intensity (default: 0)
//afSpeed - time in seconds until full effect
}

void TimerChangeMap(string &in asTimer)
{
ChangeMap("Brobyggerne2.map", "PlayerStartArea_1", "", ""); //Changes the map
}

// Functions
void Teleport1(string &in asParent, string &in asChild, int alState)
{

}








void OnLeave()
{
}


//////////////////////
//Functions
void test_this(string &in asEntity, string &in type)
{

}


As you can see, FadeToImageTrail, FadeIn/Out, SepiaColor and RadialBlur are the screen effects in use.
The commands i've tried so far without luck are:
FadeRadialBlurTo(0, 0);
FadeImageTrailTo(0, 0);
ChangePlayerStateToNormal();

Again, I hope you know how to fix it!
Thanks in advance,
Alex
02-27-2015, 12:26 AM
Find
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#2
RE: Screen effects won't stop

Well, as far as I can see you turn effects on, turn them off and then on again, so what's the problem ? You just have to turn them off again o_O
Btw, you sure that 0.0f AREN'T the deafult settings ?

02-27-2015, 07:44 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#3
RE: Screen effects won't stop

I think you can reset the effects when leaving map instead. I did that in one of my maps and it worked just fine.

void OnLeave()
{
    FadeRadialBlurTo(0, 0);
    FadeImageTrailTo(0, 0);
    ChangePlayerStateToNormal();
}

Derp.
02-27-2015, 10:36 PM
Find
Aletho Offline
Junior Member

Posts: 14
Threads: 4
Joined: Jan 2015
Reputation: 0
#4
RE: Screen effects won't stop

(02-27-2015, 10:36 PM)Neelke Wrote: I think you can reset the effects when leaving map instead. I did that in one of my maps and it worked just fine.

void OnLeave()
{
    FadeRadialBlurTo(0, 0);
    FadeImageTrailTo(0, 0);
    ChangePlayerStateToNormal();
}

That's exactly the code I had in my "void OnStart()" in the following map, but it wouldn't turn it off. I can try again with using it in the "void OnLeave()" and post the results :-)
02-28-2015, 12:17 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Screen effects won't stop

It's very simple!

Copied from the engine scripts:
https://wiki.frictionalgames.com/doku.ph..._functions
Quote:FadeRadialBlurTo(float afSize, float afSpeed);
Applies radial blur effects to the screen.

afSize - intensity (default: 0)
afSpeed - time in seconds until full effect

Notice the second one is called speed?
If you set speed to 0, would anything every change?
You have to make speed more than 0.

Trying is the first step to success.
(This post was last modified: 03-01-2015, 01:29 PM by FlawlessHappiness.)
03-01-2015, 01:29 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Screen effects won't stop

Well, I mean, it IS "time in seconds." Using 0 should theoretically make the effect fully enable over the course of 0 seconds, EG instantly. If this is not the actual case, that should be fixed.

(This post was last modified: 03-01-2015, 03:38 PM by Mudbill.)
03-01-2015, 03:38 PM
Find
Aletho Offline
Junior Member

Posts: 14
Threads: 4
Joined: Jan 2015
Reputation: 0
#7
RE: Screen effects won't stop

(03-01-2015, 01:29 PM)FlawlessHappiness Wrote: It's very simple!

Copied from the engine scripts:
https://wiki.frictionalgames.com/doku.ph..._functions
Quote:FadeRadialBlurTo(float afSize, float afSpeed);
Applies radial blur effects to the screen.

afSize - intensity (default: 0)
afSpeed - time in seconds until full effect

Notice the second one is called speed?
If you set speed to 0, would anything every change?
You have to make speed more than 0.

Nothing seems to be working. This is what I have in the void OnStart in the second map:
FadeRadialBlurTo(0, 1);
FadeImageTrailTo(0, 0);
SetPlayerCrouching(false);
ChangePlayerStateToNormal();
StopPlayerLookAt();
SetPlayerMoveSpeedMul(1);
SetPlayerSanity(100);
03-01-2015, 04:23 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: Screen effects won't stop

Are you sure your second map's hps file is properly loaded? Do you have other scripts in there that do work?

03-01-2015, 04:51 PM
Find
Aletho Offline
Junior Member

Posts: 14
Threads: 4
Joined: Jan 2015
Reputation: 0
#9
RE: Screen effects won't stop

(03-01-2015, 04:51 PM)Mudbill Wrote: Are you sure your second map's hps file is properly loaded? Do you have other scripts in there that do work?

I have a lot of scripts in the second map's hps file, all of them work.
I've just decided to completely remove all the "FadeImageTrailTo" scripts in the first map and that worked.
03-01-2015, 05:15 PM
Find
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#10
RE: Screen effects won't stop

You shure that you executed that script ? I dunno put smth like SetEntityActive in there to make sure it is called at all

03-01-2015, 08:57 PM
Find




Users browsing this thread: 1 Guest(s)