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
 

Jazradel

Helping people do more by doing less.
Reaction score
102
Look at my post on this page about hiding a unit for one player. The same principle applies.
 
S

soulbad

Guest
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.
 

xPheRe

New Member
Reaction score
43
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).
 

Syndrome

You can change this now in User CP.
Reaction score
126
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?
 
A

AddE

Guest
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?
 

Syndrome

You can change this now in User CP.
Reaction score
126
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

New Member
Reaction score
43
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.
 

TPOX

New Member
Reaction score
10
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.
 

TPOX

New Member
Reaction score
10
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! >.<
 

xPheRe

New Member
Reaction score
43
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
 

TPOX

New Member
Reaction score
10
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
 

xPheRe

New Member
Reaction score
43
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.
 

Syndrome

You can change this now in User CP.
Reaction score
126
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!!
 

TPOX

New Member
Reaction score
10
: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
 

TPOX

New Member
Reaction score
10
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 Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top