Fade Filter for ONE player

Syndrome

You can change this now in User CP.
Reaction score
126
How do you make a fade filter fade in and out for 1 player? I know i've seen this before, but i don't know where the Thread went...
Thx in Advance
 
Look at my post on this page about hiding a unit for one player. The same principle applies.
 
You would do something like player group or if/then/else just so it limits it to one player, or do something with triggering player.
 
MrApples said:
Use locals?
A little explanation half-off topic.

Local Player and locals are two differentiated things.
Local player is the player who plays on a computer. So, the function (Local Player) will return different values in every computer.
Locals are variables that only have meaning inside a trigger. Thus they're called locals in comparison with globals, that have meaning in all triggers.
Geoff.L said:
Can you give me the code? i am horrible with JASS
Code:
Custom script: if( GetLocalPlayer() == Player(0) ) then
    Fade - Filter...
Custom script: endif
This is for player 1.
For other players, change Player(0) for Player(number of player - 1).
PE. For player4 you must use Player(3).
 
xPheRe said:
A little explanation half-off topic.

Local Player and locals are two differentiated things.
Local player is the player who plays on a computer. So, the function (Local Player) will return different values in every computer.
Locals are variables that only have meaning inside a trigger. Thus they're called locals in comparison with globals, that have meaning in all triggers.
Code:
Custom script: if( GetLocalPlayer() == Player(0) ) then
    Fade - Filter...
Custom script: endif
This is for player 1.
For other players, change Player(0) for Player(number of player - 1).
PE. For player4 you must use Player(3).
Argg. It won't work, Im trying to use the Dream Fade Filter with 100% red, and the thing won't run. Can you give me ALL of the code please?
 
Check the opacity, try changing that into 0% coz I dunno if it works with anything else than 0%(never tried with more LOL). And if 100% red wont work, why dont you just create your own red picture and then make it to blp.

What do you mean by the whole code? The events and the conditions too?
 
AddE said:
Check the opacity, try changing that into 0% coz I dunno if it works with anything else than 0%(never tried with more LOL). And if 100% red wont work, why dont you just create your own red picture and then make it to blp.

What do you mean by the whole code? The events and the conditions too?
Well, I just want to get the JASS code for the fade filter. ALL OF IT please, i have no knowledge of JASS, im going to learn it some day...
 
xPheRe said:
Code:
Custom script: if( GetLocalPlayer() == Player(0) ) then
    Fade - Filter...
Custom script: endif
This is all the JASS involved in the operation.

Maybe, if you post your triggers, we can do something about your problem.
 
Not sure if this works,

Code:
Sniper Zoom In
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Sniper Zoom (On)
    Actions
Custom script: call CinematicFilterGenericForPlayer(Player(0), 10.0, BLEND_MODE_BLEND, ReplaceableTextures\CameraMasks\Crosshair_Mask.blp,  100.0, 100.0, 100.0, 100.0, 0.0, 0.0, 0.0, 0.0 )

Then add this to the custom script thing:

Code:
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

BTW, xphere how do i do the player of the casting unit instead of 0-11.
 
ahh crap i got 411 errors from that.

Ok nevermind, if you add a custom filter, use two \\'s on every one \ and use "filter".

Not to barge in on ur own topic but again Xphere, how do i do casting unit! >.<
 
Two ways.
Use a player variable, then set the variable to Owner of (Casting unit) and replace Player(0) with udg_your_variable
Code:
Set playerTemp = Owner of (Casting unit)
Custom script: if( GetLocalPlayer() == udg_playerTemp ) then
...
Custom script: endif
The other way is calling JASS code directly.
Owner of unit => GetOwningPlayer( unit )
Casting unit => GetSpellAbilityUnit( )
so
Code:
Custom script: if( GetLocalPlayer() == GetOwningPlayer( GetSpellAbilityUnit( ) ) ) then
...
Custom script: endif
I hope this helps
 
EDIT- I guess it was because you cant remove the ability that was casted from the unit until after you run the custom. atleast thats what i think? It works if i remove ability after.

k i did this, it works but the filter does nothing. so i guess it doesnt work.... well but it doesnt crash either :p

Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Ability being cast) Equal to Night Vision (On)
    Then - Actions
        Unit - Add Night Vision (Off) to (Casting unit)
        Unit - Remove (Ability being cast) from (Casting unit)
        Custom script: if( GetLocalPlayer() == GetOwningPlayer( GetSpellAbilityUnit( ) ) ) then
        Custom script: call CinematicFilterGenericForPlayer(GetOwningPlayer( GetSpellAbilityUnit( ) ), 2.0, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp",  100.0, 100.0, 100.0, 100.0, 0.0, 100.0, 0.0, 75.0 )
        Custom script: endif
    Else - Actions
        Do nothing
 
If you look carefully to your triggers, you're checking the player comparison twice.
The first one in the if( GetLocalPlayer() == ... ) and the second one inside the CinematicFilterGenericForPlayer function.
Remove the first condition check.
Code:
Events
    A unit starts the effect of ability
Conditions
    (Ability being cast) Equal to Night Vision (On)
Actions
    Unit - Add Night Vision (Off) to (Casting unit)
    Unit - Remove (Ability being cast) from (Casting unit)
    Custom script: call CinematicFilterGenericForPlayer(GetOwningPlayer( GetSpellAbilityUnit( ) ), 2.0, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp",  100.0, 100.0, 100.0, 100.0, 0.0, 100.0, 0.0, 75.0 )
Well, your code seems quite right to me...
Try playing with the color parameters of the function.
 
xPheRe said:
Two ways.
Use a player variable, then set the variable to Owner of (Casting unit) and replace Player(0) with udg_your_variable
Code:
Set playerTemp = Owner of (Casting unit)
Custom script: if( GetLocalPlayer() == udg_playerTemp ) then
...
Custom script: endif
The other way is calling JASS code directly.
Owner of unit => GetOwningPlayer( unit )
Casting unit => GetSpellAbilityUnit( )
so
Code:
Custom script: if( GetLocalPlayer() == GetOwningPlayer( GetSpellAbilityUnit( ) ) ) then
...
Custom script: endif
I hope this helps
YES!! THATS EXACTLY WWHAT I WANT!! THX GOD!!
 
:D ya i relized that, also i have to do the remove and add ability part after the script or else it wont work.

Glad u got ur question answered geoff, as well as mine. :D
 
aw crap it server splits on multiplayer
drops everyone outta game if someone uses a filter
how can i fix that?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top