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

Scope Filter

Status
Not open for further replies.
Level 4
Joined
Jul 15, 2009
Messages
29
I'm working on a third person shooter, and when you zoom in it becomes first person. I can do this, but I don't know how to get the scope filter on for the camera. My trigger looks like this:

Every 0.10 seconds of game time

Player Group - Pick all Players and do Action:
If(All conditions are true) then do (then actions) else do (else actions)
If- ScopeFilter (Playernumber of picked player) = true
Then- (apply the scope filter)
Else- (take away the scope filter)

I know next to nothing of Jass Scripting so please be as detailed as possible.
Thanks.
 
Level 11
Joined
May 31, 2008
Messages
698
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


Try looking into Sniper Arena V.2.8
 
Level 4
Joined
Jul 15, 2009
Messages
29
wait. It doesn't like my trigger. I'll give the important parts:

Events-
A unit begins casting an ability
Conditions-
Ability being cast equal to scope
Actions-
custom script: call CinematicFilterGenericForPlayer( GetEnumPlayer(), 1.0, BLEND_MODE_BLEND, "ReplaceableTextures\CameraMasks\Scope.blp", 100.0, 100.0, 100.0, 0.0, 100.0, 100.0, 100.0, 0.0 )
custom script: if GetLocalPlayer() == GetEnumPlayer() then
custom script: call SetUnitVertexColor(udg_Players_Hero[GetConvertedPlayerId(GetEnumPlayer())], 255, 255, 255, 0)
custom script: endif

It gives me the error, "Expected a function name."
 
Level 11
Joined
May 31, 2008
Messages
698
That one is the one from sniper arena right? I cant find where the function is, i didnt even see any jass, I would try using the thing that i posted. CinematicFilterGenericForPlayer is the function that it cant find btw. The person who made sniper arena created a custom function with that name but they must have hidden it or something so you cant copy it :/
 
Level 8
Joined
Jun 20, 2004
Messages
229
simply copy and paste this in the custom script code located in the trigger window when you click on the name of your map. xxmaynamexx.w3x

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

to use in a trigger, use this custom script line to bring up a scope filter for the player of the triggering spell cast.

JASS:
Custom script:   call CinematicFilterGenericForPlayer(GetOwningPlayer(GetTriggerUnit()), 1.0, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\scope.blp", 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0 )

be sure you have a scope.blp or whatever you want to name it already in your map or it will give you an error upon casting and crash your game.



here is a filter you may use that I have made as a scope.
 

Attachments

  • allianceScope.blp
    59 KB · Views: 60
  • rebellionScope.blp
    61.1 KB · Views: 52
Status
Not open for further replies.
Top