Player Only Fade Filters

warden13

New Member
Reaction score
32
I want to show a Fade Filter to only one player. GUI actions didn't let me do it. I know a little jass but still not enough. How can I do it?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Trigger:
  • Local Fade
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Cinematic - Fade out and back in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Hide filter
      • Custom script: if GetLocalPlayer() == Player(0) then
      • Cinematic - Show filter
      • Custom script: endif


Not sure if this will cause desync though :S
Maybe try these too:

Trigger:
  • Local Fade
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == Player(0) then
      • Cinematic - Fade out and back in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Custom script: endif


Trigger:
  • Local Fade
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Cinematic - Fade out and back in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Show filter
      • Custom script: if GetLocalPlayer() != Player(0) then
      • Cinematic - Hide filter
      • Custom script: endif
 

warden13

New Member
Reaction score
32
May I use theese triggers inside a loop?

Like:if GetLocalPlayer() != Player(GetForLoopIndexA())
 

warden13

New Member
Reaction score
32
Trigger:
  • Show
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
    • Conditions
    • Actions
      • Cinematic - Clear the screen of text messages for (Player group((Triggering player)))
      • Cinematic - Fade out over 0.00 seconds using texture warden.blp and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Cinematic - Hide filter
      • For each (Integer A) from 0 to 11, do (Actions)
        • Loop - Actions
          • Custom script: if GetLocalPlayer() == Player(GetForLoopIndexA()) then
          • Cinematic - Show filter
          • Custom script: endif
      • Camera - Apply Camera 001 <gen> for (Triggering player) over 0.00 seconds
      • Camera - Lock camera target for (Triggering player) to Peasant 0007 <gen>, offset by (0.00, 0.00) using Default rotation
      • Selection - Clear selection for (Triggering player)
      • Visibility - Create an initially Enabled visibility modifier for (Triggering player) emitting Visibility across Region 000 <gen>


I was player 2. My friend was player 1. He pressed ESC but I see the filter. Why?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Because now your just hiding it altogether, then showing it to each player again!

What are you trying to do ? Showing it to triggering player ?
Then do this:
Trigger:
  • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
    • Cinematic - Show filter
    • Custom script: endif
 

warden13

New Member
Reaction score
32
I will try it with that together:

Trigger:
  • Hero Select Copy
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero[(Integer A)] Equal to (Triggering unit)
            • Then - Actions
              • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
              • Cinematic - Fade in over 0.00 seconds using texture warden.blp and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Game - Enable pre-selection functionality (Enable pre-selection circles, life bars, and object info)
              • Game - Enable drag-selection functionality (Enable drag-selection box)
              • Custom script: endif
            • Else - Actions


And this?

Triggering unit refers to selected unit right?
 

warden13

New Member
Reaction score
32
Ok here is the results:

After we select heroes we get desync.
If someone presses esc while someone still seeing filter. first one's filter dissapears.

Trigger:
  • Show Copy
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
    • Conditions
    • Actions
      • Cinematic - Fade out over 0.00 seconds using texture warden.blp and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Cinematic - Hide filter
      • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
      • Cinematic - Show filter
      • Custom script: endif


Trigger:
  • Hero Select Copy
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero[(Integer A)] Equal to (Triggering unit)
            • Then - Actions
              • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
              • Cinematic - Fade in over 0.00 seconds using texture warden.blp and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Custom script: endif
            • Else - Actions
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Trigger:
  • Local Fade
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Cinematic - Fade out and back in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Show filter
      • Custom script: if GetLocalPlayer() != Player(0) and IsPlayerInForce(GetTriggerPlayer(),udg_Fading_Players) == false then
      • Cinematic - Hide filter
      • Player Group - Add (Triggering player) to Fading_Players
      • Custom script: endif


Try that then :D

And then make sure that you remove the player from the player group when it fades out ;)

And use that same principle in the second trigger too :D

(I mean with the hide and show stuff ;))
 

warden13

New Member
Reaction score
32
Trigger:
  • Show Copy
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
    • Conditions
    • Actions
      • Cinematic - Fade out over 0.00 seconds using texture warden.blp and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Cinematic - Show filter
      • Custom script: if GetLocalPlayer() != GetTriggerPlayer() and IsPlayerInForce(GetTriggerPlayer(),udg_Fading_Players) == false then
      • Cinematic - Hide filter
      • Player Group - Add (Triggering player) to Fading_Players
      • Custom script: endif


Trigger:
  • Hero Select Copy
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
    • Conditions
      • PlayerSelected[(Player number of (Triggering player))] Equal to False
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Hero[(Integer A)] Equal to (Triggering unit)
            • Then - Actions
              • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
              • Cinematic - Fade in over 0.00 seconds using texture warden.blp and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Custom script: endif
            • Else - Actions


Player 1 pressed ESC. But didn't selected a hero. Player 2 pressed ESC. Player 1's filter dissapeard. Player 2 selected a hero and then disconnected.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
You didn't use this:
Trigger:
  • Custom script: if GetLocalPlayer() != Player(0) and IsPlayerInForce(GetTriggerPlayer(),udg_Fading_Players)
 

warden13

New Member
Reaction score
32
Should I use it on second trigger?

Is Player(0) ok? I want it to be MUI? I thought player 0 is false and replaced it with GetTriggerPlayer.
 

xxxtrickyxxx

(o Y o)
Reaction score
64
This is what you need.

This is the function that goes in the scripting window under MAPNAME.w3x. Do not edit this code as it does not need it.
JASS:

function CinematicFilterGenericForPlayer takes player whichPlayer, real duration, blendmode bmode, string tex, real red0, real green0, real blue0, real trans0, real red1, real green1, real blue1, real trans1 returns nothing
    if ( GetLocalPlayer() == whichPlayer ) then
        call SetCineFilterTexture(tex)
        call SetCineFilterBlendMode(bmode)
        call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
        call SetCineFilterStartUV(0, 0, 1, 1)
        call SetCineFilterEndUV(0, 0, 1, 1)
        call SetCineFilterStartColor(PercentTo255(red0), PercentTo255(green0), PercentTo255(blue0), PercentTo255(100-trans0))
        call SetCineFilterEndColor(PercentTo255(red1), PercentTo255(green1), PercentTo255(blue1), PercentTo255(100-trans1))
        call SetCineFilterDuration(duration)
        call DisplayCineFilter(true)
    endif
endfunction


To use this in a GUI custom script here is an example of how to do so.
Trigger:
  • Custom script: call CinematicFilterGenericForPlayer(GetTriggerPlayer(), 1.0, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\warden.blp", 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0 )


Using the custom script will do all the local player stuff instantly for you. All you have to do is set the parameters of the filter and the GetTriggerPlayer() to whatever kind of player you need it to be.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top