• 🏆 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!

Cinematic filter

Status
Not open for further replies.
Level 11
Joined
May 31, 2008
Messages
698
Im making a map and the camera will be first person rather than third. Im planning on making a sniper rifle which is able to zoom in and out. And like any other gun that has a scope, i want it to show the crosshairs when you are using the scope. So i know you can use this action:
Cinematic - Apply a filter over 2.00 seconds using Normal blending on texture ScopeFilter.blp, starting with color (100.00%, 100.00%, 100.00%) and 100.00% transparency and ending with color (0.00%, 0.00%, 0.00%) and 25.00% transparency
But the only problem with this is that it applies it to all players, you cant specify which player to give the filter to. I was wondering if there was a way to make a scope for only one player. JASS is fine as im pretty sure it isnt possible to do in GUI. I looked at all of the cinematic functions, but i couldnt find it >.< so if anybody knows how to do this i would really appreciate it if you shared your knowledge with me :smile:

If this cant be done then i guess i can just create floating text in front of the unit and just make an 'X' for the crosshairs, but i would really like to use the .blp texture i found here on the hive because it would look awesome :D
 
Level 9
Joined
Dec 21, 2006
Messages
490
function FadeFilter takes real red, real green, real blue, real duration, string tex, real startTrans, real endTrans returns nothing
if (duration == 0) then
// If the fade is instant, use the same starting and ending values,
// so that we effectively do a set rather than a fade.
set startTrans = endTrans

endif
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-startTrans))
call SetCineFilterEndColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-endTrans))
call SetCineFilterDuration(duration)
call DisplayCineFilter(true)
endfunction
-------------------------------------------------------------------------------This starts the filter. To apply it for only one player do this:
-----
Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then

Custom script: call FadeFilter(255, 0, 0, 0, "FadeFilterName.blp", 100, 10)

Custom script: endif
-----

you have to replace triggering unit with anything you wish
 
Status
Not open for further replies.
Top