A little explanation half-off topic.MrApples said:Use locals?
Geoff.L said:Can you give me the code? i am horrible with JASS
Custom script: if( GetLocalPlayer() == Player(0) ) then
Fade - Filter...
Custom script: endif
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?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.This is for player 1.Code:Custom script: if( GetLocalPlayer() == Player(0) ) then Fade - Filter... Custom script: endif
For other players, change Player(0) for Player(number of player - 1).
PE. For player4 you must use Player(3).
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...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?
This is all the JASS involved in the operation.xPheRe said:Code:Custom script: if( GetLocalPlayer() == Player(0) ) then Fade - Filter... Custom script: endif
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 )
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
Set playerTemp = Owner of (Casting unit)
Custom script: if( GetLocalPlayer() == udg_playerTemp ) then
...
Custom script: endif
Custom script: if( GetLocalPlayer() == GetOwningPlayer( GetSpellAbilityUnit( ) ) ) then
...
Custom script: endif
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
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 )
YES!! THATS EXACTLY WWHAT I WANT!! THX GOD!!xPheRe said:Two ways.
Use a player variable, then set the variable to Owner of (Casting unit) and replace Player(0) with udg_your_variableThe other way is calling JASS code directly.Code:Set playerTemp = Owner of (Casting unit) Custom script: if( GetLocalPlayer() == udg_playerTemp ) then ... Custom script: endif
Owner of unit => GetOwningPlayer( unit )
Casting unit => GetSpellAbilityUnit( )
soI hope this helpsCode:Custom script: if( GetLocalPlayer() == GetOwningPlayer( GetSpellAbilityUnit( ) ) ) then ... Custom script: endif