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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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