• 🏆 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] Visibility Bug

Status
Not open for further replies.
Level 14
Joined
Nov 30, 2013
Messages
926
Let me explain this. First of all, when the game starts, the visibility runs smooth.
The bug is that when several minutes passed, it starts to black out and after a seconds passed, it return back to normal

I don't want this bug as I'm struggling what cause of this.
It would be appreciate if someone please help me on this one.


  • Visibility
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Visibility - Disable CamViewFog
      • Visibility - Destroy CamViewFog
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerViewType Equal to 0
          • Or - Any (Conditions) are true
            • Conditions
              • PlayerView Equal to 0
              • PlayerView Equal to 1
              • PlayerView Equal to 2
              • PlayerView Equal to 3
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across PlayerVisibilityNonCam <gen>
          • Set CamViewFog = (Last created visibility modifier)
        • Else - Actions
      • -------- Camera --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerViewType Equal to 1
        • Then - Actions
          • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across SCamRegion[PlayerView]
          • Set CamViewFog = (Last created visibility modifier)
        • Else - Actions
  • Black Mask
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempRegion = (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Black mask across TempRegion
      • Custom script: call RemoveRect(udg_TempRegion)
 
Level 14
Joined
Nov 30, 2013
Messages
926
ehm... :D
explain what you want to do exactly
for me, it seems pretty counterproductive to create vision and destroy it 0.01 seconds later, what shouldnt be noteicable at all

At the starting of the map, enabled black mask is automatically created to remove any fog of war.
Visibility on the other hand, is actually more like a checking trigger to check if what PlayerView and PlayerViewType's value will be now then create the visibility.
If none of the conditions were true, it just remove the visibility until it statement becomes true.

PlayerView changes its value when clicking any arrows. (Left & Right Arrows only) while PlayerViewType changes its value when accessing to an another view like you're about to check the screen of a monitor.

The only problem is a several minutes passed, black mask kicking in, blocking the visibility but later fixed after that happens. (This can sometimes happen again and again.)

Forgot to tell you that even you didn't do anything, it still happens.
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
well, i would suggest you to only create and destroy the visibility if needed. only destroy visibility if both conditions are false and dont create visibility if its already there. you can do this easily with a boolean variable
 
Level 14
Joined
Nov 30, 2013
Messages
926
I changed the script of my Black Mask trigger. Can someone please tell me if this trigger can still cause a bug and can cause leaks?


  • Black Mask
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Visibility - Destroy BlackMaskModifier
      • Wait 0.25 seconds
      • Set TempRegion = (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Black mask across TempRegion
      • Set BlackMaskModifier = (Last created visibility modifier)
      • Trigger - Turn on (This trigger)
 
I changed the script of my Black Mask trigger. Can someone please tell me if this trigger can still cause a bug and can cause leaks?


  • Black Mask
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Visibility - Destroy BlackMaskModifier
      • Wait 0.25 seconds
      • Set TempRegion = (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Black mask across TempRegion
      • Set BlackMaskModifier = (Last created visibility modifier)
      • Trigger - Turn on (This trigger)

This trigger is really bad. Erase it quickly and never think about it again.

First, never run a periodic less than 0.03.

Next, don't use waits.

Next if you want it to run ever 0.25 seconds, just set it to that, why would you ever wait just to turn it back on again?

Just do this:
  • Black Mask
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Black mask across (Playable map area)
 
Status
Not open for further replies.
Top