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

[Trigger] Filter problem ...

Status
Not open for further replies.
Level 9
Joined
Jan 23, 2008
Messages
384
Ok ... this trigger is supposed to add a fade filter to a player if one of the matching player's unit enters within range of a unit ... it all works fine ! but when the unit gets rid of the buff, in the last part of the trigger, the player owning the unit is kicked out of the game ... can someone help me out with this one ?

  • Bankai Szu Act
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EnmaBankai and do (Actions)
        • Loop - Actions
          • Set EnmaBankaiPickedDummy = (Picked unit)
          • Set EnmaIntLvl = (Load (Key Level) of (Key (Picked unit)) from Hst)
          • Unit Group - Pick every unit in (Units within 650.00 of (Position of (Load (Key Dome) of (Key (Picked unit)) in Hst)) matching ((((Matching unit) belongs to an enemy of (Owner of (Load (Key Dome) of (Key (Picked unit)) in Hst))) Equal to True) and (((Matching unit) is alive) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit Group - Add (Picked unit) to EnmaBankaiTargets
              • Unit - Create 1 Dummy for (Owner of EnmaBankaiPickedDummy) at (Position of EnmaBankaiPickedDummy) facing Default building facing degrees
              • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
              • Unit - Add (Suzumushi) to (Last created unit)
              • Unit - Set level of (Suzumushi) for (Last created unit) to EnmaIntLvl
              • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Picked unit)
      • Unit Group - Pick every unit in EnmaBankaiTargets and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Enma Korogi ) Equal to True
              • ((Picked unit) is in EnmaBankaiTargetsAfterEffect) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from EnmaBankaiTargets
              • Unit Group - Add (Picked unit) to EnmaBankaiTargetsAfterEffect
              • Custom script: if (GetLocalPlayer()==GetOwningPlayer(GetEnumUnit())) then
              • Custom script: call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.05, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
              • Custom script: endif
            • Else - Actions
              • Unit Group - Remove (Picked unit) from EnmaBankaiTargets
      • Unit Group - Pick every unit in EnmaBankaiTargetsAfterEffect and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Enma Korogi ) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from EnmaBankaiTargetsAfterEffect
              • Custom script: if (GetLocalPlayer()==GetOwningPlayer(GetEnumUnit())) then
              • Custom script: call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.10, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
              • Custom script: endif
            • Else - Actions

TY !

~MA
 
Level 9
Joined
Jan 23, 2008
Messages
384
No the problem is not that it runs endlessly the trigger works fine but the fade filter kills it ... i changed it like this works perfectly again but still kicks out the player ... no BJ in it this time ... some help ?
  • Bankai Szu Act
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EnmaBankai and do (Actions)
        • Loop - Actions
          • Set EnmaBankaiPickedDummy = (Picked unit)
          • Set EnmaIntLvl = (Load (Key Level) of (Key (Picked unit)) from Hst)
          • Unit Group - Pick every unit in (Units within 650.00 of (Position of (Load (Key Dome) of (Key (Picked unit)) in Hst)) matching ((((Matching unit) belongs to an enemy of (Owner of (Load (Key Dome) of (Key (Picked unit)) in Hst))) Equal to True) and (((Matching unit) is alive) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit Group - Add (Picked unit) to EnmaBankaiTargets
              • Unit - Create 1 Dummy for (Owner of EnmaBankaiPickedDummy) at (Position of EnmaBankaiPickedDummy) facing Default building facing degrees
              • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
              • Unit - Add (Suzumushi) to (Last created unit)
              • Unit - Set level of (Suzumushi) for (Last created unit) to EnmaIntLvl
              • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Picked unit)
      • Unit Group - Pick every unit in EnmaBankaiTargets and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Enma Korogi ) Equal to True
              • ((Picked unit) is in EnmaBankaiTargetsAfterEffect) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from EnmaBankaiTargets
              • Unit Group - Add (Picked unit) to EnmaBankaiTargetsAfterEffect
              • Custom script: if (GetLocalPlayer()==GetOwningPlayer(GetEnumUnit())) then
              • Cinematic - Fade out over 0.05 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Custom script: endif
            • Else - Actions
              • Unit Group - Remove (Picked unit) from EnmaBankaiTargets
      • Unit Group - Pick every unit in EnmaBankaiTargetsAfterEffect and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Enma Korogi ) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from EnmaBankaiTargetsAfterEffect
              • Custom script: if (GetLocalPlayer()==GetOwningPlayer(GetEnumUnit())) then
              • Cinematic - Fade in over 0.05 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
              • Custom script: endif
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (EnmaBankai is empty) Equal to True
          • (EnmaBankaiTargets is empty) Equal to True
          • (EnmaBankaiTargetsAfterEffect is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
~MA
 
Level 9
Joined
May 27, 2006
Messages
498
LocalPlayer is the reason.
*Probably* trying to get owner of enum unit causes the users to desync. I'm not an expert on that matter, but I would say that each computer picks units in a different order, which causes those computers to get ridiculous results, like sometimes getting two local players out of unit that should have returned one. But that's just theory, you would need to ask someone more experienced.

Also, you've got few leaks there.
 
Level 9
Joined
May 27, 2006
Messages
498
Nah, not in this case. The leaking here is realitvely small compared to a trigger that runs on very short periods (like 0.02 sec), so i doubt it would affect it in any way.
Besides, the leaks are not even involved in the group actions in which the local player check is.
 
Level 9
Joined
May 27, 2006
Messages
498
Allright, I've read a bit about local player and i think i've found a solution, tho I haven't tested it so i have no idea whether it'll still desync or not. But from what i've read, it shouldn't.

Just create an integer variable and store number of player in it, just like in example below. If you want a different name for your variable, just change "integer" in the custom script to its name, but dont remove the "udg_" or it will screw up. And don't touch the " - 1", it's supposed to be here.
  • Set integer = Player number of (Owner of(Picked unit))
  • Custom script: if (GetLocalPlayer()==Player(udg_integer - 1)) then
  • Cinematic - Fade out over 0.05 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
  • Custom script: endif
Edit; also, a fade in/out over 0.05 sec? Is this even noticeable?
 
Last edited:
Level 9
Joined
Jan 23, 2008
Messages
384
um ... ty i'll try that out in 2 hours when i'll get home ... and about that ... the idea of the filter fading in/out in 0.05 its because i want the black screen to show only when you are in the specific range and i want it to fade back in once you exit the area ...

Ty a lot !

~MA
 
Status
Not open for further replies.
Top