Cinematic Fade in/out for only 1 player.

Status
Not open for further replies.
Level 8
Joined
Apr 8, 2009
Messages
499
Well, Recently i've made this cinematic in my map which shows only to 1 player.
the problem is, that during that cinematic i use the "Cinematic - Fade out" Trigger:
  • Cinematic - Fade out over 1.00 seconds using texture Black Mask and colour, bla bla bla etc.
And that makes the screen fade out for ALL players and not just the Player whom is whatching the Cinematic.

Can anyone help me on this one? or link me to a possible solution?


+rep for helpfull comments ofcourse.
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
As always, you have to use the magical GetLocalPlayer() function. Assuming you don't know JASS, I'll post the finished trigger for you. I helped another guy with this problem, recently. Unfortunately, he never got back to me to tell me whether this trigger worked or not. I'd appreciate if you could.

NOTE: Only the custom scripts actually matter. The comments are just there for the sake of information.
  • Actions
    • Custom script: local player p=Player( player number here ) //This must be the FIRST ACTION of your trigger.
    • -------- NOTE: The player numbers in JASS are slightly different. Player 1 (Red) is Player(0). Player 2 (Blue) is Player(1), and so on. --------
    • Custom script: if GetLocalPlayer()==p then
    • Custom script: call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\Black_mask.blp")
    • -------- WARNING: The absence of this function results in a fatal error --------
    • -------- The above function sets the texture you'll be using. Remember that it must come between the " things. Here are a few other masks, in the order by which they can be found in the list: --------
    • -------- "ReplaceableTextures\\CameraMasks\\White_mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\HazeFilter_mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\GroundFog_mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\HazeAndFogFilter_Mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\DiagonalSlash_mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\DreamFilter_Mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\Scope_Mask.blp" --------
    • -------- NOTE: Things in JASS are case-sensitive. For example, having «mask» is not the same thing as having «Mask» (notice the little 'm' and the big 'M'). --------
    • -------- =============================================================================== --------
    • Custom script: call SetCineFilterStartColor( red , green , blue , visible ) //If you are fading IN, the visible is 255 here and 0 on the next script.
    • Custom script: call SetCineFilterEndColor( red , green , blue , visible ) //If you are fading OUT, the visible is 255 here and 0 on the previous script.
    • -------- «red», «green», «blue» are 0 by default. But you can play around with them to see what happens. They are numbers between 0 and 255. --------
    • -------- =============================================================================== --------
    • Custom script: call SetCineFilterDuration(duration)
    • -------- Remember the part that says «fade with Black mask over 2 seconds» Well, the «X seconds» is the duration. If you want 1.5 seconds, replace «duration» with 1.5 (IT'S A DOT, NOT A COMMA!) --------
    • -------- =============================================================================== --------
    • Custom script: call DisplayCineFilter(true)
    • -------- Nothing to change here. This function is constant (never changes regardless of the fade). --------
    • Custom script: endif
    • Custom script: set p=null //This script should come after endif.
 
Level 8
Joined
Apr 8, 2009
Messages
499
As always, you have to use the magical GetLocalPlayer() function. Assuming you don't know JASS, I'll post the finished trigger for you. I helped another guy with this problem, recently. Unfortunately, he never got back to me to tell me whether this trigger worked or not. I'd appreciate if you could.
  • Actions
    • Custom script: local player p=Player( player number here ) //This must be the FIRST ACTION
    • -------- NOTE: The player numbers in JASS are slightly different. Player 1 (Red) is Player(0). Player 2 (Blue) is Player(1), and so on. --------
    • Custom script: if GetLocalPlayer()==p then
    • Custom script: call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\Black_mask.blp")
    • -------- WARNING: The absence of this function results in a fatal error --------
    • -------- The above function sets the texture you'll be using. Remember that it must come between the " things. Here are a few other masks, in the order by which they can be found in the list: --------
    • -------- "ReplaceableTextures\\CameraMasks\\White_mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\HazeFilter_mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\GroundFog_mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\HazeAndFogFilter_Mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\DiagonalSlash_mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\DreamFilter_Mask.blp" --------
    • -------- "ReplaceableTextures\\CameraMasks\\Scope_Mask.blp" --------
    • -------- NOTE: Things in JASS are case-sensitive. For example, having «mask» is not the same thing as having «Mask» (notice the little 'm' and the big 'M'). --------
    • -------- =============================================================================== --------
    • Custom script: call SetCineFilterStartColor( red , green , blue , visible ) //If you are fading in, the visible is 255* here.
    • Custom script: call SetCineFilterEndColor( red , green , blue , visible ) //If you are fading out, the visible is 255* here.
    • -------- Replace «red», «green», «blue» and «visible» for numbers ranging from 0 to 255*. --------
    • -------- «visible» decides the transparency. If you want a filter with 75% transparency, set visible to 64*. By default, it's 0 on the one that is not 255*. --------
    • -------- =============================================================================== --------
    • Custom script: call SetCineFilterDuration(duration)
    • -------- Remember the part that says «fade with Black mask over 2 seconds» Well, the «X seconds» is the duration. If you want 1.5 seconds, replace «duration» with 1.5 (IT'S A DOT, NOT A COMMA!) --------
    • -------- =============================================================================== --------
    • Custom script: call DisplayCineFilter(true)
    • -------- Nothing to change here. This function is constant (never changes regardless of the fade). --------
    • Custom script: endif
    • Custom script: set p=null //This script should come after endif.

you were indeed right to think i know nothing of jass o.o....

I'll try these gui triggers and post the results of them here, and just a question,
this part :
  • Custom script: local player p=Player( player number here ) //This must be the FIRST ACTION
I, in my triggering used this to select the player:
  • (Display to Players matching condition: (Owner of (Hero Manipulating item) is Equal to (Matching player))
How Should i put that in this custom Script?
  • Custom script: local player p=Player( player number here )
Because this Cinematic should be useable for all players, so i can't put a player number in it for only one person o_O....

yeah i suck at custom scripts >_> i Appreciate your help though and if you'd help me with these last bits im sure i could test this out and give a little review about it ^^ :infl_thumbs_up:
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Just in case you didn't notice, I edited my post several times. Sorry about that.

Anyway, what are you trying to accomplish with «(Display to Players matching condition: (Owner of (Hero Manipulating item) is Equal to (Matching player))»? Are you doing this only for a player whose hero has/uses a certain item?
 
Level 8
Joined
Apr 8, 2009
Messages
499
Just in case you didn't notice, I edited my post several times. Sorry about that.

Anyway, what are you trying to accomplish with «(Display to Players matching condition: (Owner of (Hero Manipulating item) is Equal to (Matching player))»? Are you doing this only for a player whose units have a certain item?
wow, fast reply is fast :eek:

hmm, i guess i'll just explain what i'm trying to do ^^
lets see:


in the Harbour, you can buy a item called "Board the boat"
if you buy it, it will turn on cinematic mode for the owner of the hero manipulating item and will play a little cinematic of the boat departing and arriving at its destination.
during that cinematic i use those fade in/out triggers, but idk how i should get them to work for ONLY the owner of the hero manipulating the item o_O

i could post a screenshot of my triggers if needed?
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
In that case, your trigger should be something like this:
  • Harbor trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Board the boat
    • Actions
      • -------- Let's fade out. --------
      • Custom script: local player p=GetOwningPlayer(GetManipulatingUnit())
      • Custom script: if GetLocalPlayer()==p then
      • Custom script: call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\Black_mask.blp")
      • Custom script: call SetCineFilterStartColor(0,0,0,0)
      • Custom script: call SetCineFilterEndColor(0,0,0,255)
      • Custom script: call SetCineFilterDuration(2) // fades within 2 seconds
      • Custom script: call DisplayCineFilter(true)
      • Custom script: endif
      • -------- Let's wait until the screen fades out (2 seconds). --------
      • Wait 2.00 seconds
      • -------- Your cinematic preparations here, like setting the camera, moving the units to a certain location, etc. After all that, let's fade in: --------
      • Custom script: if GetLocalPlayer()==p then
      • Custom script: call SetCineFilterStartColor(0,0,0,255)
      • Custom script: call SetCineFilterEndColor(0,0,0,0)
      • Custom script: call SetCineFilterDuration(2) // fades in within 2 seconds
      • Custom script: call DisplayCineFilter(true)
      • Custom script: endif
      • Custom script: set p=null
      • -------- Your cinematic actions here. --------
I don't think you actually need to set the cinematic texture again (notice I didn't use the SetCineFilterTexture function for fading in). But if this gives you a fatal error, report back to me.
 
Level 8
Joined
Apr 8, 2009
Messages
499
In that case, your trigger should be something like this:
  • Harbor trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Board the boat
    • Actions
      • -------- Let's fade out. --------
      • Custom script: local player p=GetOwningPlayer(GetManipulatingUnit())
      • Custom script: if GetLocalPlayer()==p then
      • Custom script: call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\Black_mask.blp")
      • Custom script: call SetCineFilterStartColor(0,0,0,0)
      • Custom script: call SetCineFilterEndColor(0,0,0,255)
      • Custom script: call SetCineFilterDuration(2) // fades within 2 seconds
      • Custom script: call DisplayCineFilter(true)
      • Custom script: endif
      • -------- Let's wait until the screen fades out (2 seconds). --------
      • Wait 2.00 seconds
      • -------- Your cinematic preparations here, like setting the camera, moving the units to a certain location, etc. After all that, let's fade in: --------
      • Custom script: if GetLocalPlayer()==p then
      • Custom script: call SetCineFilterStartColor(0,0,0,255)
      • Custom script: call SetCineFilterEndColor(0,0,0,0)
      • Custom script: call SetCineFilterDuration(2) // fades in within 2 seconds
      • Custom script: call DisplayCineFilter(true)
      • Custom script: endif
      • Custom script: set p=null
      • -------- Your cinematic actions here. --------
I don't think you actually need to set the cinematic texture again (notice I didn't use the SetCineFilterTexture function for fading in). But if this gives you a fatal error, report back to me.

thank you VERY much :D i'll try it out the moment i get home. (im at the library right now.):infl_thumbs_up:

I'll report about it in aproximately 2-3 hour ^^
 
Level 8
Joined
Apr 8, 2009
Messages
499
-sigh-
i think im doing something wrong, i don't know what yet... but it gives me a error: -Removed Screenshot in PasteBin-

please help?
 
Last edited:

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Notice I didn't type «local player p» again. «set p=null» only after you're done with fading in and out. Your trigger does appear to use it more than twice, though. Locals can only be enunciated at the top of the trigger, that is why I wrote that it had to be the first action.
I recommend looking at my last trigger more than the previous. «Local» comes in the beginning and «set p=null» comes in the end. Everything from «if» to «endif» is what you must repeat. But notice that fading in and out is not exactly the same. These functions differ:
  • Custom script: call SetCineFilterStartColor(0,0,0,X)
  • Custom script: call SetCineFilterEndColor(0,0,0,Y)
  • -------- If you're fading OUT, X=0 and Y=255. If you're fading IN, X=255 and Y=0 --------
 
Level 8
Joined
Apr 8, 2009
Messages
499
Notice I didn't type «local player p» again. «set p=null» only after you're done with fading in and out. Your trigger does appear to use it more than twice, though. Locals can only be enunciated at the top of the trigger, that is why I wrote that it had to be the first action.
I recommend looking at my last trigger more than the previous. «Local» comes in the beginning and «set p=null» comes in the end. Everything from «if» to «endif» is what you must repeat. But notice that fading in and out is not exactly the same. These functions differ:
  • Custom script: call SetCineFilterStartColor(0,0,0,X)
  • Custom script: call SetCineFilterEndColor(0,0,0,Y)
  • -------- If you're fading OUT, X=0 and Y=255. If you're fading IN, X=255 and Y=0 --------

soooo, "p=null" should only be in there once and only at the very end of all fading, and

  • Custom script: local player p=GetOwningPlayer(GetManipulatingUnit())
  • Custom script: if GetLocalPlayer()==p then
should also only be in there once, but then at the start?


EDIT:
------------
nvm i got it, gonna test it o_O




EDIT_2:
-------------
Works perfectly, thnx alot Rui +rep for yah ofcourse ^^
 
Last edited:
Status
Not open for further replies.
Top