• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Fade Filters

Status
Not open for further replies.
Level 11
Joined
Oct 9, 2015
Messages
721
So I've learned how to apply the fade filter to specific players, my question is how can I aplly multiple filters at the same time, AND my second doubt is about why when I apply a fade filter for a player, the fade filter of the other player "blinks" in the screen ?
 
Level 11
Joined
Oct 9, 2015
Messages
721
The problem I'm having right now is that when I apply a (Advanced) Filter to a player, the other player's Filter blinks or even vanish completly.

Here's the triggers I'm using:

This trigger applies a filter when the hero acquires an item
  • Applying Filter
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to Helmo de Bronze
        • Then - Actions
          • Set AlphaReal = 0.00
          • Set TempForce = (Owner of (Triggering unit))
          • Custom script: if GetLocalPlayer() != udg_TempForce then
          • Set AlphaReal = 100.00
          • Custom script: endif
          • Cinematic - Apply a filter over 2.00 seconds using Key alpha blending on texture war3mapImported\DefaultFilter.blp, 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: call EnableUserUI(true)
        • Else - Actions
This trigger applies another filter to the hero when it's damaged (i'm using Bribe's DDS)
  • Blood Filter
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set AlphaReal = 0.00
      • Set TempForce = (Owner of DamageEventTarget)
      • Custom script: if GetLocalPlayer() != udg_TempForce then
      • Set AlphaReal = 100.00
      • Custom script: endif
      • Cinematic - Apply a filter over 2.00 seconds using Key alpha blending on texture war3mapImported\BloodFilter.blp, starting with color (100.00%, 100.00%, 100.00%) and AlphaReal% transparency and ending with color (100.00%, 100.00%, 100.00%) and AlphaReal% transparency
      • Custom script: call EnableUserUI(true)
      • Set Loc1 = (Position of DamageEventTarget)
  • -------- THIS ACTION REMOVES THE DUMMY UNIT BEFORE CREATING ANOTHER --------
    • Unit Group - Pick every unit in (Units owned by TempForce of type Cavalo Leve (dummy)) and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
  • -------- I CREATE A DUMMY UNIT TO COUNT THE TIME THE FILTER SHOULD STAY ON, AFTER IT DIES, THE FILTER MUST BE SET TO THE DEFAULT FILTER --------
    • Unit - Create 1 (dummy) for TempForce at Loc1 facing Default building facing degrees
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation(udg_Loc1)
This trigger checks when the unit dies and applies the default filter to the player:
  • Untitled Trigger 026 Copy
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to (dummy)
        • Then - Actions
          • Set AlphaReal = 0.00
          • Set TempForce = (Owner of (Triggering unit))
          • Custom script: if GetLocalPlayer() != udg_TempForce then
          • Set AlphaReal = 100.00
          • Custom script: endif
          • Cinematic - Apply a filter over 2.00 seconds using Key alpha blending on texture war3mapImported\DefaultFilter.blp, 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: call EnableUserUI(true)
        • Else - Actions
 
Last edited:
@streetpunk The alpha technique that sets the alpha real to 0 then 100 doesn't work for simultaneous fade filters, as I mentioned in the note. The filters are still applied globally, just with different alpha values, so that's why it ends up bugging out/vanishing since the 0 alpha filter replaces the old one. You have to use WaterKnight's function. There isn't really an easy way to do it in GUI.
 
Level 11
Joined
Oct 9, 2015
Messages
721
So I can't show a custom filter for one player, and a different custom filter to other player at the same time? about WaterKnight's solution, I don't understand JASS, but I just need the directions pointed out to me so I can addapt it to my needs, can you please help me with that ? With his solution is it possible to do one different filter for each player at the same time?
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
So I can't show a custom filter for one player, and a different custom filter to other player at the same time? about WaterKnight's solution, I don't understand JASS, but I just need the directions pointed out to me so I can addapt it to my needs, can you please help me with that ? With his solution is it possible to do one different filter for each player at the same time?
sure, DisplayFadeFilter(localplayer==myplayer)
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
JASS:
call SetCineFilterTexture("DamageMask.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(128, 226, 255, 200)
    call SetCineFilterEndColor(128, 226, 255, 0)
    call SetCineFilterDuration(1.)
    call DisplayCineFilter(p==LocalPlayer)
guess you'll get how to adapt it
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
nope, he only have to make local condition for the string setup
if player==1 then s="effect1.blp"

Not really, as calling the filter functions with local-different parameters would still force an update.

call DisplayCineFilter(p==GetLocalPlayer()) would show whatever filter is currently set for p to p AND hide whatever individual filter is currently set for other players from them. You could save the local state and use that instead but cine filters also feature some transition that would restart/you would be required to monitor that. Just put all of the filter calls in the local block. The GUI action Video - Advanced Filter is fine to be local-wrapped in case you relinquish Video - Fade Filter respectively CinematicFadeCommonBJ and the jass functions setting up the tranisition timers because other than calling the cine filter natives, Video - Advanced Filter only kills those timers (if they exist).
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
I copied the code into a text trigger but when I start the map it returns errors, what must I do for it to work? I'm sorry for bothering so much, but I have very little (to none) knowledge about jass coding
you have to state correct BLP mask path. if its incorrect, fatal will happen. im not gonna tell you exact pathes, but you can search for them.
Creating a Custom Fade Filter
Fade Filter - Wc3C.net
etc etc, use google
I am fairly certain string table desyncs are a thing. At least that is what previous feedback and issues leads one to believe.
nope. tell me how different state of the memory on my pc may affect anyone else, if we only translate actions while playing
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
The very definition of a desync is that your game state is different from other players.
strings are being cached like literally any dev would do using C++. its must have tech to save memory. it have nothing to do with syncing - it doesnt affect anyone's state, instead it lookups for proper hash, if there are none found - creates a new one. not a single byte has been transfered with that
 
Level 11
Joined
Oct 9, 2015
Messages
721
The text trigger contains only this:
Code:
call SetCineFilterTexture("bronzeblood.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(128, 226, 255, 200)
    call SetCineFilterEndColor(128, 226, 255, 0)
    call SetCineFilterDuration(1.)
    call DisplayCineFilter(p==LocalPlayer)

This is the "custom script" gui I've also made, this one only returns an error on:
  • Custom script: call DisplayCineFilter(p==LocalPlayer)
  • Untitled Trigger 032
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Custom script: call SetCineFilterTexture("bronzeblood.blp")
      • Custom script: call SetCineFilterBlendMode(BLEND_MODE_BLEND)
      • Custom script: call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
      • Custom script: call SetCineFilterStartUV(0, 0, 1, 1)
      • Custom script: call SetCineFilterStartColor(128, 226, 255, 200)
      • Custom script: call SetCineFilterEndColor(128, 226, 255, 0)
      • Custom script: call SetCineFilterDuration(1.)
      • Custom script: call DisplayCineFilter(p==GetLocalPlayer())
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
strings are being cached like literally any dev would do using C++. its must have tech to save memory. it have nothing to do with syncing - it doesnt affect anyone's state, instead it lookups for proper hash, if there are none found - creates a new one. not a single byte has been transfered with that
Except it also assigns strings a unique identifier. Also nothing stops the game being programmed to do something stupid like check for string table integrity as part of sync.
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
The text trigger contains only this:
Code:
call SetCineFilterTexture("bronzeblood.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(128, 226, 255, 200)
    call SetCineFilterEndColor(128, 226, 255, 0)
    call SetCineFilterDuration(1.)
    call DisplayCineFilter(p==LocalPlayer)
did you actually defined LocalPlayer var? its alias for GetLocalPlayer() in my code
Code:
call SetCineFilterTexture("bronzeblood.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(128, 226, 255, 200)
    call SetCineFilterEndColor(128, 226, 255, 0)
    call SetCineFilterDuration(1.)
    call DisplayCineFilter(p==GetLocalPlayer())
 
Level 11
Joined
Oct 9, 2015
Messages
721
  • Untitled Trigger 032
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Set TempPlayer = (Owner of (Triggering unit))
      • Custom script: if GetLocalPlayer() != udg_TempForce then
      • Custom script: endif
      • Custom script: call SetCineFilterTexture("bronzeblood.blp")
      • Custom script: call SetCineFilterBlendMode(BLEND_MODE_BLEND)
      • Custom script: call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
      • Custom script: call SetCineFilterStartUV(0, 0, 1, 1)
      • Custom script: call SetCineFilterStartColor(128, 226, 255, 200)
      • Custom script: call SetCineFilterEndColor(128, 226, 255, 0)
      • Custom script: call SetCineFilterDuration(1.)
      • Custom script: call DisplayCineFilter(p==GetTempPlayer())
It's still returning error on the last line
 
Level 11
Joined
Oct 9, 2015
Messages
721
  • Untitled Trigger 032
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Set LocalPlayer = (Owner of (Triggering unit))
      • Custom script: if GetLocalPlayer() != udg_LocalPlayer then
      • Custom script: endif
      • Custom script: call SetCineFilterTexture("bronzeblood.blp")
      • Custom script: call SetCineFilterBlendMode(BLEND_MODE_BLEND)
      • Custom script: call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
      • Custom script: call SetCineFilterStartUV(0, 0, 1, 1)
      • Custom script: call SetCineFilterStartColor(128, 226, 255, 200)
      • Custom script: call SetCineFilterEndColor(128, 226, 255, 0)
      • Custom script: call SetCineFilterDuration(1.)
      • Custom script: call DisplayCineFilter(p==GetLocalPlayer())
Didn't work either :(
 
Level 11
Joined
Oct 9, 2015
Messages
721
So I just have to put "TempPlayer" instead of "Player(1)" to set it to my desired variable ?

PS: I've changed Player(1) to (0), the map is starting, but the game crashes as soon as the event of the trigger is fired
 
Last edited:
Level 19
Joined
Dec 12, 2010
Messages
2,069
'because I assumed you only need it for one player at time. so you have to turn filters on/off locally
Not really, as calling the filter functions with local-different parameters would still force an update.

call DisplayCineFilter(p==GetLocalPlayer()) would show whatever filter is currently set for p to p AND hide whatever individual filter is currently set for other players from them. You could save the local state and use that instead but cine filters also feature some transition that would restart/you would be required to monitor that. Just put all of the filter calls in the local block. The GUI action Video - Advanced Filter is fine to be local-wrapped in case you relinquish Video - Fade Filter respectively CinematicFadeCommonBJ and the jass functions setting up the tranisition timers because other than calling the cine filter natives, Video - Advanced Filter only kills those timers (if they exist).
just what he said
JASS:
if GetLocalPlayer()==Player(1) then
call DisplayCineFilter(true)
endif
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
JASS Player(1) is the same as GUI Player - 2 Blue.

PS: I've changed Player(1) to (0), the map is starting, but the game crashes as soon as the event of the trigger is fired
Post the current triggers for investigation.

crash normally happens if specified BLP incorrect or not found. im using 64x64 blp with alpha-channel
Must it be mipmapped or non-mipmapped?
 
Level 11
Joined
Oct 9, 2015
Messages
721
It was indeed the .blp file, Dr Super Good, it had war3mapimported/ before it's name, I think for JASS purposes you can't use that, you must remove the "war3mapimported", I even changed the file name on the string to include the "war3mapimported" but it only worked when I removed that from both string and imported file. Dr, any tips you could give for what each function does? If I put a 1 sec on the duration function it doesn't vanish normaly, instead it fades moving to the side in a weird way
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
and then you have
Code:
call SetCineFilterStartColor(128, 226, 255, 200)
    call SetCineFilterEndColor(128, 226, 255, 0)
lines, which you prolly wanna use as
Code:
call SetCineFilterStartColor(128, 226, 255, 200)
    call SetCineFilterEndColor(128, 226, 255, 200)
which means "dont fade it, keep it as is"
 
Status
Not open for further replies.
Top