• 🏆 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 Generic for Player

Status
Not open for further replies.
Level 4
Joined
Jul 15, 2009
Messages
29
I'm using a system of Jass camera filter scripting so that it will function must faster than GUI. Before, I was doing this:

if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit())
Apply a camera filter, blah blah
endif

However, this proved to have a slow frame rate and looked horrible in game. So, I moved onto this Jass system:

JASS:
function CamFilter 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

However, I can't seem to apply this in game.

I do:

call CamFilter( GetEnumPlayer(), 1.0, BLEND_MODE_BLEND, "Sniper Rifle.blp", 100.0, 100.0, 100.0, 0.0, 100.0, 100.0, 100.0, 0.0 )

This does not work for me.

My knowledge of Jass is very limited, and I do not understand the "( Get Enum Player()" part of this custom script. I would like to apply the camera filter for an owner of a triggering unit, somewhat like this:

Unit begins casting an ability
Ability = Shoot
Apply camera filter for owner shoot 1
wait 0.05 seconds
Apply camera filter for owner shoot 2

(hurt units)

wait 0.05 seconds
Apply camera filter for owner normal gun

The problem with the
"if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit())
Apply a camera filter, blah blah
endif"
is that the camera filter doesn't change within 0.05 seconds. It waits until somewhere along 0.5 seconds.

Can someone help me?

Thanks, satient.
 
Level 4
Joined
Jul 15, 2009
Messages
29
wait... I figured something out. NVM, guys.

What I do is that when I shoot, I set a shoot animation integer to something greater than zero. Then every 0.2 seconds of game time, I say

If Shoot_Anim > 0, then
Run Shoot Anim
Make Shoot_Anim = Shoot_Anim -1


And then the trigger Shoot Anim has no events or conditions,

just

If Shoot_Anim > 0, then
Apply filter for ENumPlayer
else
apply normal filter
 
Status
Not open for further replies.
Top