Fade Filter

Oreo_clan

New Member
Reaction score
4
I've seen this done before so it has to be possible. But it's probably in JASS only. So...

How do you make it so that a fade filter only affects specific players? So when you try to blind a player, it doesn't affect all players, which is really annoying.

So Unit A isn't supposed to be affected and Unit B is supposed to be affected. How do you make a fade filter only for the owner of Unit B?
 

zylack

New Member
Reaction score
15
I believe there is a black marble tileset or something, add that to your map and make a small part on your map with those tiles, making it comepletely black, then using camera setting apply a camera looking down at that black area. Best i can do hope that helps-used something like that for one of my maps once. but save the settings of the previous camera of the player before doing this if he is to resume play.
 

Oreo_clan

New Member
Reaction score
4
Well... I don't know how it really works...

It picks every unit in an area, then makes the owner of that unit go blind with white...

is the blendmode jsut white? and the player... Can i set it to the variable SpawningPlayer by just typing SpawningPlayer?

And whats with the string tex?
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
Post the fade filter you whould using if you where to display it for all players, and also say what players to display it to, ie Triggering Player or a variable.
Post the GUI code for it when it displays to all players. Then I can show you the right custom script line to use.

Anyway, the function at wc3 jass uses the Cinematic fade to simulate a normal fade. A normal fade desyncs is you do it for one player only, the cinamatic one does not.
 

Oreo_clan

New Member
Reaction score
4
Code:
function CinematicFadeWithUI takes real red, real green, real blue, real duration, string tex, real startTrans, real endTrans returns nothing
    if (duration == 0) then
        set startTrans = endTrans
    endif
    call SetCineFilterTexture(tex)
    call SetCineFilterBlendMode(BLEND_MODE_BLEND)
    call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
    call SetCineFilterStartUV(0, 0, 1, 1)
    call SetCineFilterEndUV(0, 0, 1, 1)
    call SetCineFilterStartColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-startTrans))
    call SetCineFilterEndColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-endTrans))
    call SetCineFilterDuration(duration)
    call DisplayCineFilter(true)
endfunction

That's his new function that doesn't remove UI control.

Code:
FB Explode
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Dying unit)) Equal to Flashbang Grenade
    Actions
        Set locShootingPlayer = (Owner of (Dying unit))
        Set locPoint = (Position of (Dying unit))
        Sound - Stop FireSound[7] Immediately
        Sound - Play c4_explode1 <gen>
        Set FireSound[7] = (Last played sound)
        Unit - Create 1 Flashbang Effect for (Owner of (Dying unit)) at locPoint facing Default building facing degrees
        Set TempUnitGroup = (Units within 360.00 of locPoint matching (((Matching unit) is A Hero) Equal to True))
        Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            Loop - Actions
                Set locReal = ((360.00 - (Distance between locPoint and (Position of (Picked unit)))) / 20.00)
                Set SpawningPlayer = (Owner of (Picked unit))
                Cinematic - Apply a filter over locReal seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 0.00% transparency
                -------- This makes it so that it stays completely white for up to based on distance from the blast 6 seconds... Right? --------
        Custom script:   call RemoveLocation( udg_locPoint )
        Custom script:   set udg_locPoint = null
        Custom script:   call DestroyGroup( udg_TempUnitGroup )
        Custom script:   set udg_TempUnitGroup = null

I need it to turn completely white for most of the time (At least 75%) and then slowly return to normal... If that's is possible... Otherwise it should stay white for the entire duration.

The locReal is there to keep track of the duration after applying the distance and changing it so it is no more than 6 seconds.

I changed the locReal amount a few times because the complete blindness doesn't last remotely long enough.

Oh by the way, does anybody know how to hide a filter for a specific player too? That would help SO MUCH. Because then I can just make the duration long then remove it with the fade filter, so you get a major dose of the complete blindness.
 

Oreo_clan

New Member
Reaction score
4
Well I only know how to do stuff in GUI... Still learning custom script...

Yours is good... But I need it to trigger for the player... And I need someone to tell me what to do with that JASS function or else I can't do it...
 
D

Dino.pl

Guest
Oreo_clan said:
Well I only know how to do stuff in GUI... Still learning custom script...
If you don't need JASS help, don't post in "The JASS Zone"...
Oreo_clan said:
Yours is good... But I need it to trigger for the player...
Trigger for the player?
What do you mean?
Oreo_clan said:
And I need someone to tell me what to do with that JASS function or else I can't do it...
1.
Dino.pl said:
You need:
-a global array unit variable "unit" (array dimensions 0-11 -> player 1 - player 12)
-an ability with point target
-a unit assigned to the "unit" array (with the Flashbang ability of course)
2. Copy the getAngle function to the map's custom script (click on map name in the Trigger Editor)
3. Create a trigger named Flashbang and convert it into JASS (edit => convert to custom text or something like that)
4. Replace created trigger's code with the posted one
 

Oreo_clan

New Member
Reaction score
4
1, If you didn't notice... This was MOVED.
2, I need it to do something like
Code:
FB Explode
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Dying unit)) Equal to Flashbang Grenade
    Actions
        Set locShootingPlayer = (Owner of (Dying unit))
        Set locPoint = (Position of (Dying unit))
        Sound - Stop FireSound[7] Immediately
        Sound - Play c4_explode1 <gen>
        Set FireSound[7] = (Last played sound)
        Unit - Create 1 Flashbang Effect for (Owner of (Dying unit)) at locPoint facing Default building facing degrees
        Set TempUnitGroup = (Units within 360.00 of locPoint matching (((Matching unit) is A Hero) Equal to True))
        Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            Loop - Actions
                Set locReal = ((360.00 - (Distance between locPoint and (Position of (Picked unit)))) / 60.00)
                Set SpawningPlayer = (Owner of (Picked unit))
                Cinematic - Apply a filter over locReal seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 0.00% transparency
                Trigger - Run Blindness Duration <gen> (checking conditions)
        Custom script:   call RemoveLocation( udg_locPoint )
        Custom script:   set udg_locPoint = null
        Custom script:   call DestroyGroup( udg_TempUnitGroup )
        Custom script:   set udg_TempUnitGroup = null

Replacing the apply a filter with the Specific Player Filter, which is just the filter. Nothing else. I plan to remove it with a different system.

The idea is this, Apply the filter through the Run Trigger Action... Then a unit is created for the "SpawningPlayer" which is called Flashbang Duration. It basically counts the time for you using it's hp. When it dies, a trigger will set "SpawningPlayer"=owner of dying unit and apply a fade filter for that player which will negate the previous filter, and return the vision from complete white to a fading white to a normal screen.

Here's the triggers for it. Replace the GUI Filters with JASS Filters somehow and it should work rather nicely. (For a GUI user of course.)

Code:
FB Explode
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Dying unit)) Equal to Flashbang Grenade
    Actions
        Set locShootingPlayer = (Owner of (Dying unit))
        Set locPoint = (Position of (Dying unit))
        Sound - Stop FireSound[7] Immediately
        Sound - Play c4_explode1 <gen>
        Set FireSound[7] = (Last played sound)
        Unit - Create 1 Flashbang Effect for (Owner of (Dying unit)) at locPoint facing Default building facing degrees
        Set TempUnitGroup = (Units within 360.00 of locPoint matching (((Matching unit) is A Hero) Equal to True))
        Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            Loop - Actions
                Set locReal = ((360.00 - (Distance between locPoint and (Position of (Picked unit)))) / 60.00)
                Set SpawningPlayer = (Owner of (Picked unit))
                Cinematic - Apply a filter over locReal seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 0.00% transparency
        -------- ^I need this filter effect to only affect Spawning Player. And it should basically last a long time until I remove it with the 3rd trigger.^ --------
                Trigger - Run Blindness Duration <gen> (checking conditions)
        Custom script:   call RemoveLocation( udg_locPoint )
        Custom script:   set udg_locPoint = null
        Custom script:   call DestroyGroup( udg_TempUnitGroup )
        Custom script:   set udg_TempUnitGroup = null

Code:
Blindness Duration
    Events
    Conditions
    Actions
        Set locPoint3 = (Position of Units[(Player number of SpawningPlayer)])
        Unit - Create 1 Flashbang Duration for SpawningPlayer at locPoint3 facing Default building facing degrees
        Unit - Set life of (Last created unit) to locReal
        Custom script:   call RemoveLocation( udg_locPoint3 )
        Custom script:   set udg_locPoint3 = null
That trigger creates a Dummy Unit to act as a timer... There's probably better ways to do it... But it was the first idea that popped into my head and it works. And it was easy to do.


Code:
Remove Blindness
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Dying unit)) Equal to Flashbang Duration
    Actions
        Set SpawningPlayer = (Owner of (Dying unit))
        Cinematic - Apply a filter over 2.00 seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 100.00% transparency
        -------- ^I need this filter effect to only affect Spawning Player.^ --------

The idea is Create, Wait for Duration to End, and Replace with a filter that actually fades before the game ends lol.

Get the idea?
 
D

Dino.pl

Guest
Replacing
Code:
Cinematic - Apply a filter over locReal seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 0.00% transparency
with
Code:
custom script: if (GetLocalPlayer() == whatever_you_want) then
Cinematic - Apply a filter over locReal seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 0.00% transparency
custom script: endif
would cause desyncs, so you need to do it other way.


Convert it to JASS (better backup first), put
Code:
    if (bj_cineFadeContinueTimer != null) then
        call DestroyTimer(bj_cineFadeContinueTimer)
    endif
    if (bj_cineFadeFinishTimer != null) then
        call DestroyTimer(bj_cineFadeFinishTimer)
    endif
at the beggining of your Trig_whatever_Actions
And replace
Code:
Cinematic - Apply a filter over locReal seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 0.00% transparency
//I mean, replace it's JASS equivalent
with
Code:
if (GetLocalPlayer() == Player(my_loopIndex)) then
            call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\White_mask.blp")
            call SetCineFilterBlendMode(BLEND_MODE_BLEND)
            call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
            call SetCineFilterStartUV(0, 0, 1, 1)
            call SetCineFilterEndUV(0, 0, 1, 1)
            call SetCineFilterStartColor(255, 255, 255, 255)
            call SetCineFilterEndColor(255, 255, 255, 255)
            call SetCineFilterDuration(whatever_you_want)
            call DisplayCineFilter(true)
        endif


You have to do something similar to your remove blindness trigger.
 

Oreo_clan

New Member
Reaction score
4
Dino.pl said:
Replacing
Code:
Cinematic - Apply a filter over locReal seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 0.00% transparency
with
Code:
custom script: if (GetLocalPlayer() == whatever_you_want) then
Cinematic - Apply a filter over locReal seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 0.00% transparency
custom script: endif
would cause desyncs, so you need to do it other way.


Convert it to JASS (better backup first), put
Code:
    if (bj_cineFadeContinueTimer != null) then
        call DestroyTimer(bj_cineFadeContinueTimer)
    endif
    if (bj_cineFadeFinishTimer != null) then
        call DestroyTimer(bj_cineFadeFinishTimer)
    endif
at the beggining of your Trig_whatever_Actions
And replace
Code:
Cinematic - Apply a filter over locReal seconds using Normal blending on texture White Mask, starting with color (100.00%, 100.00%, 100.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 0.00% transparency
//I mean, replace it's JASS equivalent
with
Code:
if (GetLocalPlayer() == Player(my_loopIndex)) then
            call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\White_mask.blp")
            call SetCineFilterBlendMode(BLEND_MODE_BLEND)
            call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
            call SetCineFilterStartUV(0, 0, 1, 1)
            call SetCineFilterEndUV(0, 0, 1, 1)
            call SetCineFilterStartColor(255, 255, 255, 255)
            call SetCineFilterEndColor(255, 255, 255, 255)
            call SetCineFilterDuration(whatever_you_want)
            call DisplayCineFilter(true)
        endif


You have to do something similar to your remove blindness trigger.

No, no you're not getting it...

Okay... I will make a Fade Filter trigger, putting the JASS equivalent there. Then I remove the old GUI one and use a run trigger to use the JASS equivalent... Or whatever it is... Maybe it's script... Whatever...

Anyway, I WILL be using
Code:
            call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\White_mask.blp")
            call SetCineFilterBlendMode(BLEND_MODE_BLEND)
            call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
            call SetCineFilterStartUV(0, 0, 1, 1)
            call SetCineFilterEndUV(0, 0, 1, 1)
            call SetCineFilterStartColor(255, 255, 255, 255)
            call SetCineFilterEndColor(255, 255, 255, 255)
            call SetCineFilterDuration(locReal)
            call DisplayCineFilter(true)
        endif

But what I'm trying to figure out is HOW to do that, and what to change...
 

Oreo_clan

New Member
Reaction score
4
Nvm... After some research I got it. It works perfectly now. It looks great. Completely blind for a few seconds(Max:6) then vision returns to normal over 6 seconds. Looks awesome! :shades:
 
D

Dino.pl

Guest
Hmm... it wasn't supposed to be Player(my_forLoopIndex)...
My fault...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top