katipo66 94 Posted October 13, 2010 ndl, hndl, hndl1? Oops, i rushed that... this is not working: hndl = ppEffectCreate ["dynamicBlur", 450]; hndl ppEffectEnable true; hndl ppEffectAdjust [5]; hndl ppEffectCommit 1; sleep 10; ppEffectDestroy _hndl; Share this post Link to post Share on other sites
celery 8 Posted October 13, 2010 _hndl -> hndl You can't suddenly change the variable and expect the game to know what you mean. Share this post Link to post Share on other sites
katipo66 94 Posted October 13, 2010 _hndl -> hndlYou can't suddenly change the variable and expect the game to know what you mean. I realized that but when i use ppEffectDestroy hndl; then the affect doesnt appear at all, but it does with _hndl; Same goes if i have this: _hndl = ppEffectCreate ["dynamicBlur", 450]; _hndl ppEffectEnable true; _hndl ppEffectAdjust [5]; _hndl ppEffectCommit 0; sleep 10; ppEffectDestroy _hndl; Here is the whole code in the init: bis_ew_fnc_screen = compile preprocessFileLineNumbers "scripts\fn_screen.sqf"; player addeventhandler ["hit",{ _hit = _this select 2; _sqf = [0.5 + _hit] spawn bis_ew_fnc_screen; hndl = ppEffectCreate ["dynamicBlur", 450]; hndl ppEffectEnable true; hndl ppEffectAdjust [5]; hndl ppEffectCommit 0; sleep 90; ppEffectDestroy hndl; }]; player addeventhandler ["killed",{ [] spawn { private ["_sqf"]; for "_i" from 0 to 5 do {_sqf = [1] spawn bis_ew_fnc_screen; sleep 0.1;}; }; }]; player addeventhandler ["animchanged",{ _anim = _this select 1; if (_anim in [ "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldl", "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr" ]) then { sqf = [1,true] spawn bis_ew_fnc_screen; }; }]; Share this post Link to post Share on other sites
CarlGustaffa 4 Posted October 13, 2010 Uhm, the effect doesn't work with hndl or destroying it doesn't work with hndl? Is the effect temporary, and that's why you need to destroy it? I've never destroyed it (similar stuff), but let it run through the entire mission. Another problem within your eventhandler is the use of sleep. The { ...code... } part is a call, which may not like those commands. It might work if you [_hndl] spawn {sleep 90; ppEffectDestroy (_this select 0)}; but I haven't tested. Share this post Link to post Share on other sites
katipo66 94 Posted October 13, 2010 (edited) Hi The effect works with this: hndl = ppEffectCreate ["dynamicBlur", 450]; hndl ppEffectEnable true; hndl ppEffectAdjust [5]; hndl ppEffectCommit 0; sleep 10; ppEffectDestroy _hndl; But is not destroyed, yes i just need it temporarily, thanks for that other option ill try it out later and see if it works EDIT* This works "dynamicblur" ppeffectenable true; "dynamicblur" ppeffectadjust [10]; "dynamicblur" ppeffectcommit 0; "dynamicblur" ppeffectadjust [0]; "dynamicblur" ppeffectcommit (6 + random 1); Edited October 14, 2010 by Katipo66 Share this post Link to post Share on other sites
HateDread 13 Posted November 27, 2010 Hey guys, Just wondering how I could convert this, including the priority settings, to run independently, such as from a single .sqf file in a trigger. setaperture 24;ppColor = ppEffectCreate ["ColorCorrections", 1999]; ppColor ppEffectEnable false; ppColor ppEffectAdjust [1, 1, 0, [1, 1, 1, 0], [1, 1, 1, 0.0], [1, 1, 1, 1.0]]; ppColor ppEffectCommit 0; ppBlur = ppEffectCreate ["dynamicBlur", 505]; ppBlur ppEffectEnable false; ppBlur ppEffectAdjust [.5]; ppBlur ppEffectCommit 0; ppInversion = ppEffectCreate ['colorInversion', 2555]; ppInversion ppEffectEnable false; ppInversion ppEffectAdjust [1,1,1]; ppInversion ppEffectCommit 0; ppGrain = ppEffectCreate ["filmGrain", 2005]; ppGrain ppEffectEnable false; ppGrain ppEffectAdjust [0.02, 1, 1, 0, 1]; ppGrain ppEffectCommit 0; Share this post Link to post Share on other sites
imutep 0 Posted November 27, 2010 Maybe you searching this one? :) blood screen effect Share this post Link to post Share on other sites
CarlGustaffa 4 Posted November 27, 2010 @HateDread: Not really sure what you're asking, but I would set everything during init phase, and just vary the ppEffectAdjust throughout the mission (or via the triggers). But setAperture? Hmm, scary :p Share this post Link to post Share on other sites
HateDread 13 Posted November 28, 2010 Well, as you can see, the actual commands are different in my example, as opposed to some of the others posted. I am wondering how to convert it to that 'normal' format, as the one I posted doesn't work when simply executed straight from an .sqf. It's basically a good FLIR vision mode. No idea what setAperture does :p Share this post Link to post Share on other sites
CarlGustaffa 4 Posted November 28, 2010 Well, I'm using Create, Enable, Adjust, and Commit for "ColorCorrections", "filmGrain", and "chromAberration", and that seems to work ok for me. You're using ' instead of " in colorInversion, but other than that I can't see any reasons why it shouldn't work. Provided it is executed on client of course. setAperture in effect turns of HDR's automatic aperture adjustment (auto exposure in a camera), and lets you set aperture/exposure (how much light enters the camera) manually. Without access to how bright a scene is, it's near impossible to get this right over all circumstances (inside, outside, sun angle, weather, shadows etc). FLIR? Why not use proper FLIR now that we've got it? :p Share this post Link to post Share on other sites
HateDread 13 Posted November 28, 2010 Well, it's a long story :p Trying to attach an FLIR-like effect to a certain player who has a few issues with vision. I don't think I can permanently activate 'proper' FLIR for them, so I'm trying a ppeffects route. This is the script in full (his name would take the place of mine, of course): If (alive player and name player == "(AEF)HateDread") then{ setaperture 24; ppColor = ppEffectCreate ["ColorCorrections", 1999]; ppColor ppEffectEnable false; ppColor ppEffectAdjust [1, 1, 0, [1, 1, 1, 0], [1, 1, 1, 0.0], [1, 1, 1, 1.0]]; ppColor ppEffectCommit 0; ppBlur = ppEffectCreate ["dynamicBlur", 505]; ppBlur ppEffectEnable false; ppBlur ppEffectAdjust [.5]; ppBlur ppEffectCommit 0; ppInversion = ppEffectCreate ["colorInversion", 2555]; ppInversion ppEffectEnable false; ppInversion ppEffectAdjust [1,1,1]; ppInversion ppEffectCommit 0; ppGrain = ppEffectCreate ["filmGrain", 2005]; ppGrain ppEffectEnable false; ppGrain ppEffectAdjust [0.02, 1, 1, 0, 1]; ppGrain ppEffectCommit 0; } else { player sidechat "My FLIR did not activate."; }; Problem is, it looks nothing like shown here: http://forums.bistudio.com/showthread.php?t=79500&page=2. All it does is slightly light up the screen. Thoughts? Share this post Link to post Share on other sites
HateDread 13 Posted December 11, 2010 Howdy all, completely unrelated to previous posts... Does anyone have a suggestion for an effect one would see if dehydrated/dazed, in the desert? I'm talking like, for example, you're dumped in the desert by the enemy, and your vision fades in for a moment to see them walking away, only for it to fade back out again (then fade to black). So; - How do I get this effect? And; - How would would modify is on the fly, so that it smoothly shifts as dictated throughout a mission/scene? Thanks in advance :) Share this post Link to post Share on other sites
CarlGustaffa 4 Posted December 11, 2010 I'm using this in a mission where your night vision (non NVG mission) is temporarily blinded by a scripted lightning flash: private ["_ret","_amount","_bgtcontrast","_color"]; bFlashInProgress = true; _amount = call fn_SunElev; _amount = [_amount, -14, -1] call fn_Normalize; _amount = _amount min 1; _amount = _amount max 0; _amount = 1 - _amount; //Max effect when sun is -10° below horizon (or lower), no effect when sun is -1° below horizon (or higher). _bgtcontrast = 1.0 - 0.25 * _amount; _color = -0.06 * _amount; //Start _ret = [_bgtcontrast, _bgtcontrast, 0, [0, 0, _color, _color],[0, 0, 0, 1],[0, 0, 0, 0]]; ppBlueNight ppEffectAdjust _ret; ppBlueNight ppEffectCommit 0.0; waitUntil {ppEffectCommitted ppBlueNight}; //Flash _ret = [1, 1, 0.35, [0, 0, _color, _color],[0, 0, 0, 1],[0, 0, 0, 0]]; ppBlueNight ppEffectAdjust _ret; ppBlueNight ppEffectCommit 0.12; waitUntil {ppEffectCommitted ppBlueNight}; //Fade fast _ret = [_bgtcontrast, _bgtcontrast, 0.15, [0, 0, _color, _color],[0, 0, 0, 1],[0, 0, 0, 0]]; ppBlueNight ppEffectAdjust _ret; ppBlueNight ppEffectCommit 3.0; waitUntil {ppEffectCommitted ppBlueNight}; //Fade medium _ret = [_bgtcontrast, _bgtcontrast, 0.03, [0, 0, _color, _color],[0, 0, 0, 1],[0, 0, 0, 0]]; ppBlueNight ppEffectAdjust _ret; ppBlueNight ppEffectCommit 6.0; waitUntil {ppEffectCommitted ppBlueNight}; //Fade slow _ret = [_bgtcontrast, _bgtcontrast, 0, [0, 0, _color, _color],[0, 0, 0, 1],[0, 0, 0, 0]]; ppBlueNight ppEffectAdjust _ret; ppBlueNight ppEffectCommit 12.0; waitUntil {ppEffectCommitted ppBlueNight}; bFlashInProgress = false; bFlashInProgress is only to prevent another ppBlueNight effect from updating while the flash is doing it's thing. Never mind the normalize thing, find some constant value to work with. I just posted to show one method to approach the problem, but it's probably not the solution. Note that I'm getting away with a few speeds of changes since my mission allows me to. You might have to do some kind of logarithmic or exponential function instead, I don't know. Hell even a constant speed might work for you :) For the effect you're looking for, I'd probably combine it with something else, like radial blur and wavy effects. Share this post Link to post Share on other sites
dnk 13 Posted January 8, 2011 (edited) nevermind, i am a stupid :) (the init.sqf was stuck in a while-do loop prior to executing the post script) Anyway, new question: ppEffectCommit. When you commit a new effect, does it fade out the old effect over the same duration, or does it add the new effect on top of the old? For example, I want to do (in init.sqf: "hour = daytime;"): sleep 0.1;postDay = ppEffectCreate ["colorCorrection",1501]; postRise = ppEffectCreate ["colorCorrection",1501]; postSet = ppEffectCreate ["colorCorrection",1501]; postNight = ppEffectCreate ["colorCorrection",1501]; postDay ppEffectEnable true; postRise ppEffectEnable true; postSet ppEffectEnable true; postNight ppEffectEnable true; postDay ppEffectAdjust [blahbl]; postRise ppEffectAdjust [blahbl]; postSet ppEffectAdjust [blahbl]; postNight ppEffectAdjust [blahbl]; #postchecks _postCheckRise = if (hour >= 5) && (hour < 8) && (ppEffectCommitted != postRise) then {postRise ppEffectCommit 1800}; _postCheckDay = if (hour >= 8) && (hour < 16.5) && (ppEffectCommitted != postDay) then {postDay ppEffectCommit 1800}; _postCheckSet = if (hour >= 16.5) && (hour < 18.5) && (ppEffectCommitted != postSet) then {postSet ppEffectCommit 1800}; _postCheckNight = if (hour >=18.5) && (hour < 5) && (ppEffectCommitted != postNight) then {postNight ppEffectCommit 1800}; sleep 300; goto "postchecks"; Edited January 9, 2011 by DNK Share this post Link to post Share on other sites
dnk 13 Posted January 9, 2011 Well, that was a mess of a code and didn't work too well, but I fixed it (sort of). My new question: Is there no way to gently fade OUT a ppEffect? It seems I can only gently fade them in, then each successive one just paints on top of the last. The only way to take out the last is to 'snap' it off, which looks like crap. ---------- Post added at 07:57 AM ---------- Previous post was at 07:51 AM ---------- Hah! Solved: sleep 0.1;postRise = ppEffectCreate ["colorCorrections",1500001]; postRise ppEffectAdjust [ 1, 0.62, 0, [0, 0, 0, 0],[3.12, 0.25, 0.87, 1.26],[-1.11, 0.03, 0.02, 0]]; postRise ppEffectEnable true; postRise ppEffectCommit 5; sleep 10; postDay = ppEffectCreate ["colorCorrections",1500002]; postDay ppEffectAdjust[ 1, 0.63, 0, [0, 0, 0, 0],[2.64, -1.76, -0.26, 1.45],[0.58, -0.25, 0.02, 0]]; postDay ppEffectEnable true; postDay ppEffectCommit 10; sleep 10; postDay ppEffectAdjust [ 1, 1, 0, [0, 0, 0, 0],[2.64, -1.76, -0.26, 1],[0, 0, 0, 0]]; postDay ppEffectCommit 10; Just readjust the disposed value and recommit it and then turn it off. Share this post Link to post Share on other sites
HateDread 13 Posted January 10, 2011 Howdy all, Is there a way to keep ppEffects visible after the player has hit 'esc' and is viewing the menu? Whenever a player returns from the menu, the effects are lost, ruining the ideas I was implementing in the mission. Cheers. Share this post Link to post Share on other sites
dnk 13 Posted January 10, 2011 ^^ this doesn't happen for any of my scripts. What is your code, how are you executing it? Share this post Link to post Share on other sites
HateDread 13 Posted January 10, 2011 This sort of thing: "WetDistortion" ppeffectenable true; "WetDistortion" ppEffectAdjust[0, 0.16, 0.32, 0.56, 0.8, 0.64, 0.64, 0, 0, 0.08, 0.08, 0, 0, 0, 0.77]; "WetDistortion" ppEffectCommit 0; "dynamicBlur" ppEffectEnable true; "dynamicBlur" ppEffectAdjust [5]; "dynamicBlur" ppEffectCommit 0; Share this post Link to post Share on other sites
dnk 13 Posted January 10, 2011 hm, maybe try creating a special effect like this: wetdist1 = ppEffectCreate ["wetDistortion", 2006]; wetdist1 ppEffectAdjust [0, 0.16, 0.32, 0.56, 0.8, 0.64, 0.64, 0, 0, 0.08, 0.08, 0, 0, 0, 0.77]; wetdist1 ppEffectEnable true; wetdist1 ppEffectCommit 0; and so on. That works for me. Share this post Link to post Share on other sites
dragon zen 16 Posted April 11, 2011 THANKS, I'll try the FLIR effect. :D ---------- Post added at 09:14 PM ---------- Previous post was at 09:12 PM ---------- I have question: I know how to destroy ppEffect, but how to get back the "setaperture"?? Share this post Link to post Share on other sites
SD_BOB 10 Posted May 3, 2011 Sorry for this semingly noob question :p But i'm just having trouble grasping everything. Could someone give me an example on how to execute a ppEffect for all players (COOP) at the start of a mission? Possibly using the init.sqf? Thankyou in advance for any help. Here is what i have in my init.sqf at the moment. "ColorCorrections" ppEffectAdjust [1, 1, 0.0, [0.0, 0.0, 0.0, 0.0], [1, 1, 1, 0.628942], [0.791589, 0.638219, 1, 0.0]]; "ColorCorrections" ppEffectCommit 0; "ColorCorrections" ppEffectEnable true; Share this post Link to post Share on other sites
celery 8 Posted May 3, 2011 Is that not working then? All players execute the init script at start so they should be getting that by default. Share this post Link to post Share on other sites
SD_BOB 10 Posted May 3, 2011 (edited) Not as far as i can tell. I have taken the above from a mission included with the INV44 mod. They have used it to make the night missions playable as without it it is totally black. I have tried the mission i have with the init included on the editor and in mp but it doesnt seem to be working. EDIT: Sorted my issue it wasnt the above at all, i missed a setAperture command for the brighter night. Edited May 3, 2011 by Shadow.D. ^BOB^ Share this post Link to post Share on other sites
abdecken 1 Posted May 7, 2011 does someone have a good tropical sunrise effect? Share this post Link to post Share on other sites
2nd ranger 282 Posted May 7, 2011 Depends what you mean by tropical sunrise. A little more specific? Share this post Link to post Share on other sites