• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Script for a fade filter that affects only one player

Status
Not open for further replies.
Level 4
Joined
Mar 15, 2008
Messages
80
i'm not sure whether this should go in requests or not but anyway...
I need a Jass script (because, as far as i'm aware this can't be done in the GUI editor...) that gives only one player a poison (green) mist effect across the screen but for only the player affected by the poison spell (a ranged target ability)
can someone plz help me on this one?
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Creating special effects for just one player will crash the game, ive heard. If this is what you meant? (the poison is a special effect that you want only visible and damaging for one player?)

Hm please forgive me, but could you explain again =)?
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
There is not much to be done with special effects.
But some other stuff like lightning effects it is a different story.
Yes, creating stuff for local prayer causes desynchronization ending up in a game split.
To avoid this, stuff is first created, then hidden for all players, and then showed only for local player.
There was a tutorial somewhere.
Search this forum for a topic with it ;)
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
Here:
JASS:
function FilterForPlayer takes player whichPlayer, real duration, string tex, real red, real green, real blue, real trans, real red2, real green2, real blue2, real trans2 returns nothing
    if GetLocalPlayer() == whichPlayer then
        call SetCineFilterTexture(tex)
        call SetCineFilterBlendMode(BLEND_MODE_BLEND)
        call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
        call SetCineFilterStartUV(0, 0, 1, 1)
        call SetCineFilterEndUV(0, 0, 1, 1)
        call SetCineFilterStartColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-trans))
        call SetCineFilterEndColor(PercentTo255(red2), PercentTo255(green2), PercentTo255(blue2), PercentTo255(100-trans2))
        call SetCineFilterDuration(duration)
        call DisplayCineFilter(true)
    endif
endfunction

duration = time to fade to the specific filter
tex = texture for the filter
red = amount of red at the start ---------- 0-100
green = amount of green at the start ---------- 0-100
blue = amount of blue at the start ---------- 0-100
trans = transparency at the start ---------- 0-100
red2 = amount of red at the end ---------- 0-100
green2 = amount of green at the end ---------- 0-100
blue2 = amount of blue at the end ---------- 0-100
trans2 = transparency at the end ---------- 0-100

ex: call FilterForPlayer(Player(0), 2.0, ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.0, 100.0, 100.0, 0.0, 100.0, 100.0, 100.0, 0.0 )
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
You can use GetLocalPlayer with GUI too.
Just put a custom script holding your condition (if GetLocalPlayer() == player_variable_or_value), put all your actions, and then put another custom script with endif.

(Do not do this with creating units, effects, or stuff like that).
 
Level 4
Joined
Mar 15, 2008
Messages
80
Thanks v much Devil but i can't get a couple of lines to work... it says that it 'expected a name':eekani:

help anyone cos i dont know what it wants from me...
 
Status
Not open for further replies.
Top