Jump to content
ALPHIVE

How to make Post Effect work during 10 seconds ?

Recommended Posts

Hi everybody ;)

 

I would use this script to make visual effect through trigger :

 

PP_wetD = ppEffectCreate ["WetDistortion",300];

PP_wetD ppEffectEnable true;

PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

 

 

It works well but i want that after 10 seconds it comes back in normal view, do you have tips to make this ?

 

Thank you guys for your help again ! :D

Share this post


Link to post
Share on other sites
2 hours ago, ALPHIVE said:

Hi everybody ;)

 

I would use this script to make visual effect through trigger :

PP_wetD = ppEffectCreate ["WetDistortion",300];

PP_wetD ppEffectEnable true;

PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

 

 

It works well but i want that after 10 seconds it comes back in normal view, do you have tips to make this ?

 

Thank you guys for your help again ! :D

You can add a "while {true} do { YourCodeHere }. It would look something like this: 

while {true} do {
PP_wetD = ppEffectCreate ["WetDistortion",300];
PP_wetD ppEffectEnable true;
PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];
};

 

 

 

Share this post


Link to post
Share on other sites

Usually, you have to cancel the effect with a new adjust:

PP_wetD ppEffectAdjust [0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0];

PP_wet ppeffectCommit 10; // or other delay.

or even

ppEffectDestroy PP_wetD;

Share this post


Link to post
Share on other sites

Hi guys and thank for your help again !

 

So you mean that :

 

 in the activation of my trigger i can place that :

 

PP_wetD = ppEffectCreate ["WetDistortion",300];

PP_wetD ppEffectEnable true;

PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

 

In the unactivation of my trigger i can place that :

 

ppEffectDestroy PP_wetD;

 

And to affect only players that are entering in the trigger (not everybody on the server) can i place in conditions ?

 

Player In ThisList

 

 

---------------------------------------------------------

 

@cookies2432 About the while, i dont see where you place the timer

 

while {true} do {

PP_wetD = ppEffectCreate ["WetDistortion",300];

PP_wetD ppEffectEnable true;

PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

};

 

How do i must say "While 10 seconds the script will be effective"

 

 

@pierremgi About the while i didnt get how to do, i need to do like that ?

 

PP_wetD = ppEffectCreate ["WetDistortion",300];

PP_wetD ppEffectEnable true;

PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

PP_wetD ppEffectAdjust [0];

PP_wet ppeffectCommit 10;

 

 

Thank you for your help !! and sorry im not very very good with the script logic so :'(

Share this post


Link to post
Share on other sites
1 hour ago, ALPHIVE said:

Hi guys and thank for your help again !

 

So you mean that :

 

 in the activation of my trigger i can place that :

 

PP_wetD = ppEffectCreate ["WetDistortion",300];

PP_wetD ppEffectEnable true;

PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

 

In the unactivation of my trigger i can place that :

 

ppEffectDestroy PP_wetD;

 

And to affect only players that are entering in the trigger (not everybody on the server) can i place in conditions ?

 

Player In ThisList

 

 

---------------------------------------------------------

 

@cookies2432 About the while, i dont see where you place the timer

 


while {true} do {
PP_wetD = ppEffectCreate ["WetDistortion",300];
PP_wetD ppEffectEnable true;
PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];
sleep 10;
};

 

How do i must say "While 10 seconds the script will be effective"

 

 

@pierremgi About the while i didnt get how to do, i need to do like that ?

 

PP_wetD = ppEffectCreate ["WetDistortion",300];

PP_wetD ppEffectEnable true;

PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

PP_wetD ppEffectAdjust [0];

PP_wet ppeffectCommit 10;

 

 

Thank you for your help !! and sorry im not very very good with the script logic so :'(

I did not set a timer on 10 seconds in order for it to constantly update but if you want it to update every 10 seconds you can add a sleep command. It would look something like this:

while {true} do {
PP_wetD = ppEffectCreate ["WetDistortion",300];
PP_wetD ppEffectEnable true;
PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];
sleep 10;
};

 

Share this post


Link to post
Share on other sites

@cookies2432 thank you cookie for your help !

 

So, if i enter into a trigger and i have this in activation :

 

while {true} do {

PP_wetD = ppEffectCreate ["WetDistortion",300];

PP_wetD ppEffectEnable true;

PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

sleep 10;

};

 

 

the effect will just be for 10 seconds and after it stops and come back to the "normal view" right ?

Share this post


Link to post
Share on other sites
Just now, ALPHIVE said:

@cookies2432 thank you cookie for your help !

 

So, if i enter into a trigger and i have this in activation :

 

while {true} do {

PP_wetD = ppEffectCreate ["WetDistortion",300];

PP_wetD ppEffectEnable true;

PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

sleep 10;

};

 

 

the effect will just be for 10 seconds and after it stops and come back to the "normal view" right ?

This will repeat the effect every 10 seconds. I might've missunderstood you. If you want it to go back to normal view after 10 seconds then you can add an if statement above that will tell it how long it is allowed to repeat the function. 

 

_seconds = 0;

if (_seconds <= 10) then {

while {true} do {
PP_wetD = ppEffectCreate ["WetDistortion",300];
PP_wetD ppEffectEnable true;
PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];
_seconds = _seconds + 1;
	};

} else {
	hint format ["The effects have worn off"];
};

 

Share this post


Link to post
Share on other sites

And @cookies2432 just to confirm, the line in condition to affect ONLY people that come into the effect area (not everybody on the server) is this one ? :)

 

Player In ThisList

Share this post


Link to post
Share on other sites
1 minute ago, ALPHIVE said:

And @cookies2432 just to confirm, the line in condition to affect ONLY people that come into the effect area (not everybody on the server) is this one ? :)

 

Player In ThisList

Seeing as it is a trigger that should be the case yea however, I realise now that you most likely should use _this so that the variable does not have the same value for every player. Give me a few minutes, i'll go and test it. 

Share this post


Link to post
Share on other sites
1 hour ago, ALPHIVE said:

Ok @cookies2432 thank you ! :)

Alright seeing as this was a bit more complicated than I originally thought (primarily getting the player who activated the trigger) it took longer than I expected but I managed to solve it. I used an SQF file to make it easier as I think it's rather complicated to do it all in the trigger module in the editor. 

 

1: Place a trigger and name it trigger1

2: Set the activation to "any player" and "present".

3: In the activation field, enter this: 

plr = (thislist select 0); null = [plr] execVM "nameOfYourSqfScriptHere.sqf".

4: Create an SQF file inside of your mission folder which is located at: documents/arma3_other_profiles/yourArma3Name/missions/. Make sure you end it with .sqf so it is an sqf file.

5: Inside of the sqf place this:

_seconds = 0;
_person = _this select 0;

while {_seconds < 11} do {
PP_wetD = ppEffectCreate ["WetDistortion",300];
PP_wetD ppEffectEnable true;
PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];

  if (_person inArea trigger1) then {
    _seconds = 0;
  } else {
        _seconds = _seconds + 1;
  };

hint format ["%1", _seconds];
sleep 1;

if (_seconds > 10) then {
  ppEffectDestroy PP_wetD;
	hint format ["The effects have worn off"];
  };

};

This makes it so that the effects will not reset if you're still inside the specific area however if you exit it, it will do a countdown of 10 seconds before the effects are worn off. Let me know if any issues pop up and i'll do my best to help.

Share this post


Link to post
Share on other sites

In your trigger activation:

0 = [] spawn {
  PP_wetD = ppEffectCreate ["WetDistortion",300];
  PP_wetD ppEffectEnable true;
  PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];
  PP_wetD ppeffectCommit 10;
  sleep 10;
  ppEffectDestroy PP_wetD;
}

or, smoother:

 

0 = [] spawn {
  PP_wetD = ppEffectCreate ["WetDistortion",300];
  PP_wetD ppEffectEnable true;
  PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];
  PP_wetD ppeffectCommit 5;
  sleep 5;
  PP_wetD ppEffectAdjust [0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0];
  PP_wetD ppeffectCommit 5;
} 

 

Share this post


Link to post
Share on other sites
1 minute ago, ALPHIVE said:

Thank you again @pierremgi for your help !

You don't need any loop! you create an effect, you choose a delay to make it at full (commit), you sleep for making things work (at least the commit delay) + the time you want more, then you kill the effect or smooth back to normal.

Share this post


Link to post
Share on other sites

hey,

41 minutes ago, pierremgi said:

In your trigger activation:


0 = [] spawn {
  PP_wetD = ppEffectCreate ["WetDistortion",300];
  PP_wetD ppEffectEnable true;
  PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];
  PP_wetD ppeffectCommit 10;
  sleep 10;
  ppEffectDestroy PP_wetD;
}

or, smoother:

 


0 = [] spawn {
  PP_wetD = ppEffectCreate ["WetDistortion",300];
  PP_wetD ppEffectEnable true;
  PP_wetD ppEffectAdjust [2.77,0.2,0.2,2.51,1,1,1,0.05,0.01,0.05,0.01,0.25,0.1,0.2,0.2];
  PP_wetD ppeffectCommit 5;
  sleep 5;
  PP_wetD ppEffectAdjust [0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0];
  PP_wetD ppeffectCommit 5;
} 

 

i have also a question releated to this if u could me help out with this pls i tried ur example above on this effect so that it fade away smooth but it dident work.

 

0 = ["ColorInversion", 2500, [0.5, 0.5, 0.5]] spawn { params ["_name", "_priority", "_effect", "_handle"];
while { _handle = ppEffectCreate [_name, _priority]; _handle < 0 } do
{ _priority = _priority + 1; };
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 0.5;
waitUntil {ppEffectCommitted _handle};
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle; };

Share this post


Link to post
Share on other sites
12 minutes ago, Alert23 said:

hey,

i have also a question releated to this if u could me help out with this pls i tried ur example above on this effect so that it fade away smooth but it dident work.

 

0 = ["ColorInversion", 2500, [0.5, 0.5, 0.5]] spawn { params ["_name", "_priority", "_effect", "_handle"];
while { _handle = ppEffectCreate [_name, _priority]; _handle < 0 } do
{ _priority = _priority + 1; };
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 0.5;
waitUntil {ppEffectCommitted _handle};
uiSleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle; };


 

0 = ["ColorInversion", 2500, [0.5, 0.5, 0.5]] spawn {

  params ["_name", "_priority", "_effect", "_handle"];
  while { _handle = ppEffectCreate [_name, _priority]; _handle < 0 } do
  { _priority = _priority + 1; };
   _handle ppEffectEnable true;
  _handle ppEffectAdjust _effect;
  _handle ppEffectCommit 0.5;
  waitUntil {ppEffectCommitted _handle};
  uiSleep 3;
  _handle ppEffectAdjust [0,0,0];
  _handle ppEffectCommit 3;
};

 

Not sure to understand the priority loop.

Share this post


Link to post
Share on other sites
1 hour ago, Alert23 said:

Thanks this worked =)

i found that script on wiki

https://community.bistudio.com/wiki/Post_process_effects

 

Yep! I guess it's an increment for priority parameter in case of already busy with some previous effect (same type). Probably more useful for colorCorrection and filmgrain than your colorInversion or wetDistortion. Probably you can skip that but good to know anyway.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×