Why won't this Fade Filter for Specific Player in JASS work?

RadiuS.x

Active Member
Reaction score
2
I'm trying to run a Fade Filter for the owner of a unit who enters a specific region.

Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
Custom script: if ( GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) ) then
Cinematic - Fade out and back in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
Custom script: endif

I have 2 user players setup in game. (Player 1 Red, and Player 2 Blue).
If I walk to the region with a unit owned by me (Player 1 Red), the other player drops (Player 2 Blue), but I don't. How do I fix?
 

ZakkWylde-

New Member
Reaction score
14
When the player drops, that is because that player desyncs--you are in one game-state and Player 2 is in another (or he is simply disconnected). That is one of the problems of GetLocalPlayer() if used improperly. The tutorial I linked earlier (which it seems you might have read) should mention how to use it properly. I'm not entirely sure what it is about Cinematic that cannot be done for one player only, but maybe someone else will know more.
 

RadiuS.x

Active Member
Reaction score
2
Yeah, I did read that tut. Thanks by the way. As far as I know, I'm using GetLocalPlayer() properly, and I don't understand why it is causing desync.

Any help appreciated.
 

ZakkWylde-

New Member
Reaction score
14
From what I can tell, the Cinematic operations are FULL of function calls. Looking at the function in JASS (fading in and out with black mask...), it is many lines of code, most of which are other function calls that themselves are multiple lines of code. ("Red" functions, if you get to see them in JASS. They are not "natives" [purple].)

This leads me to believe that any number of things could be going wrong, as far desyncing. Maybe an effect is created for one player but not the other--and this is done improperly (as mentioned in the tutorial). Without sitting down and looking through all the functions (and then rewriting them so that they properly work with GetLocalPlayer() ), it seems downright impossible to fix the desync issue.

I could be wrong, and maybe someone else has figured this out.

Heck, if I have some time, I may try to locate the issue...but as of now, hope that someone else knows what's wrong :p.
 

inevit4ble

Well-Known Member
Reaction score
38
Cant you set GetLocalPlayer to a variable if true? and utilize the variable? wouldn't that be safer?
 

emootootoo

Top Banana
Reaction score
51
i use this in my quest system to display "QuestBox.blp" as a filter for a specific player (it's a box that i display text on)

whenever i want to show a player the filter i set "disalogDisplay[player number]" to true and call this function straight after

to hide it from the player i set "disalogDisplay[player number]" to false and call the function afterwards again

JASS:
private function UpdateQuestDialog takes nothing returns nothing
    local real trans = 100
    local integer i = 0
    loop
        exitwhen i &gt;= MAXPLAYERS
        if Player(i) == GetLocalPlayer() then
            if dialogDisplay<i> then
                set trans = 0
            endif
        endif
        set i = i + 1
    endloop
    call CinematicFilterGenericBJ(0,BLEND_MODE_BLEND,&quot;QuestBox.blp&quot;,0,0,0,100,100,100,100,trans)
endfunction</i>


sounds somewhat like what you want

tl;dr do what inevit4ble said and set transparency locally for a single fade filter
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top