• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Hide Platforms trigger stops working after a while

Status
Not open for further replies.
Level 15
Joined
Jun 9, 2008
Messages
308
So this is a WEIRD one. So much so that I started to wonder if I "broke" my map in some other way unrelated to those triggers.

Scenario: I created triggers where the environment changes when a unit ("Hovercone") uses an ability.
Namely, the platforms are either hidden or unhidden.

Problem: It works like a charm for like 20 minutes or so, and then it stops, specifically, the Platforms won't be hidden anymore no matter how I use the ability (rest of the trigger works as normal). And yes I seems to be linked specifically to time elapsed, not how often I use the trigger, because I can use it 20 times in a row and it keeps working fine.
I even deleted all periodical triggers in the map to make sure there is no interference from those.
The platforms (or any destructibles) are not mentioned in any other triggers.

Here are the two relevant triggers:

Platforms are hidden:
  • Lower altitude
    • Ereignisse
      • Einheit - A unit begins to cast an ability
    • Bedingungen
      • (Ability being cast) Equal Lower Altitude (Neutral feindlich)
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Level of Altitude 0 for Hovercone) Equal 1
        • 'THEN'-Aktionen
          • Einheit - Remove Altitude 0 from Hovercone
          • Einheit - Add Altitude -1 to Hovercone
          • Animation - Change Hovercone flying height to 30.00 at 100.00
          • Gegenstand - Remove (Item carried by Hovercone of type Altimeter: Altitude= 0)
          • Held - Create Altimeter: Altitude= -1 and give it to Hovercone
          • Gegenstand - Make (Last created item) Nicht ablegbar
          • -------- Platforms out --------
          • Destructible - Pick every destructible in (Playable map area) and do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Destructible-type of (Picked destructible)) Equal Aufzug (1) Forest large
                • 'THEN'-Aktionen
                  • Destructible - Hide (Picked destructible)
                • 'ELSE'-Aktionen
        • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Level of Altitude 1 for Hovercone) Equal 1
            • 'THEN'-Aktionen
              • Einheit - Remove Altitude 1 from Hovercone
              • Einheit - Add Altitude 0 to Hovercone
              • Animation - Change Hovercone flying height to 100.00 at 100.00
              • Gegenstand - Remove (Item carried by Hovercone of type Altimeter: Altitude= 1)
              • Held - Create Altimeter: Altitude= 0 and give it to Hovercone
              • Gegenstand - Make (Last created item) Nicht ablegbar
            • 'ELSE'-Aktionen
Platforms are revealed:
  • Raise Altitude
    • Ereignisse
      • Einheit - A unit begins casting an ability
    • Bedingungen
      • (Ability being cast) Equal Raise Altitude
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Level of Altitude -1 for (Triggering unit)) Equal 1
        • 'THEN'-Aktionen
          • -------- Platforms in --------
          • Destructible - Pick every destructible in (Playable map area) and do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Destructible-type of (Picked destructible)) Equal Aufzug (1) Forest large
                • 'THEN'-Aktionen
                  • Destructible - Unhide (Picked destructible)
                • 'ELSE'-Aktionen
          • Einheit - Add Altitude 0 to (Triggering unit)
          • Einheit - Remove Altitude -1 from (Triggering unit)
          • Gegenstand - Remove (Item carried by Hovercone of type Altimeter: Altitude= -1)
          • Held - Create Altimeter: Altitude= 0 and give it to Hovercone
          • Gegenstand - Make (Last created item) Nicht ablegbar
          • Animation - Change (Triggering unit) flying height to 100.00 at 100.00
          • Einheit - Set (Triggering unit) movement speed to (Default movement speed of (Triggering unit))
        • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Level of Altitude 0 for (Triggering unit)) Equal 1
            • 'THEN'-Aktionen
              • Einheit - Remove Altitude 0 from (Triggering unit)
              • Einheit - Add Altitude 1 to (Triggering unit)
              • Animation - Change (Triggering unit) flying height to 150.00 at 100.00
              • Gegenstand - Remove (Item carried by Hovercone of type Altimeter: Altitude= 0)
              • Held - Create Altimeter: Altitude= 1 and give it to Hovercone
              • Gegenstand - Make (Last created item) Nicht ablegbar
            • 'ELSE'-Aktionen
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
1) You may want to change the Event to "A unit Starts the effect of an ability". This happens when the ability executes, whereas Begins casting happens at the beginning of the cast animation which can be cancelled and repeated multiple times.

2) I would store those Destructibles in an Array during Map Initialization and use a For Loop to Hide/Show them. This would be far more efficient as well.

3) I found that when Removing an ability that is being cast you can run into issues (may depend on the Event used). I recommend Removing the Altitude ability as the very last thing you do.

4) I would add some Variables to the trigger to make sure your Event Responses aren't changing (probably not necessary).

5) I would look for triggers that happen when your unit Acquires/Loses an item, these may interfere.
 
Last edited:
Level 15
Joined
Jun 9, 2008
Messages
308
I think I see lines refering to items (but no idea what happens to them :grin:) couldn't there be an inventory problem of some sort?
5) I would look for triggers that happen when your unit Acquires/Loses an item, these may interfere.
I will remove the item section for testing purposes, though in principle I do not see what effect they'd have on destructibles, and are not referenced in any other triggers.
I'll come back after some more testing.

EDIT: I literally deleted all other triggers and the problem does not reappear even after 40 minutes.
I still don't see how the other triggers interfere with destructibles, which strengthens my dark fear that it might be a symptom of leaks destroying the game over time.
On to more testing.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
I will remove the item section for testing purposes, though in principle I do not see what effect they'd have on destructibles, and are not referenced in any other triggers.
I'll come back after some more testing.

EDIT: I literally deleted all other triggers and the problem does not reappear even after 40 minutes.
I still don't see how the other triggers interfere with destructibles, which strengthens my dark fear that it might be a symptom of leaks destroying the game over time.
On to more testing.
Adding to what A]mun said, there's the Event: Destructible within region dies which only allows 64 destructibles to be registered per region. Maybe some odd limitation like that is happening? Do you create any new Destructibles at some point in the game? I guess not since you said you don't.

And again, I would definitely try to use an Array to store the Platforms as well as a For Loop to enumerate over them, if you aren't already.
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Destructible - Pick every destructible in (Playable map area) and do (Actions)
      • Loop - Actions
        • If (Destructible-type of (Picked destructible) Equal to Platform) then
          • Set Variable Platform_Counter = Platform_Counter + 1
          • Set Variable Platform_Array[Platform_Counter] = (Picked destructible)
  • For each (Platform_Loop) from 1 to Platform_Counter do (Actions)
    • Loop - Actions
      • Destructible - Hide Platform_Array[Platform_Loop]
I feel like this would help avoid any weirdness and be far more efficient.
 
Last edited:
Level 15
Joined
Jun 9, 2008
Messages
308
Adding to what A]mun said, there's the Event: Destructible within region dies which only allows 64 destructibles to be registered per region. Maybe some odd limitation like that is happening? Do you create any new Destructibles at some point in the game? I guess not since you said you don't.

And again, I would definitely try to use an Array to store the Platforms as well as a For Loop to enumerate over them, if you aren't already.
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Destructible - Pick every destructible in (Playable map area) and do (Actions)
      • Loop - Actions
        • If (Destructible-type of (Picked destructible) Equal to Platform) then
          • Set Variable Platform_Counter = Platform_Counter + 1
          • Set Variable Platform_Array[Platform_Counter] = (Picked destructible)
  • For each (Platform_Loop) from 1 to Platform_Counter do (Actions)
    • Loop - Actions
      • Destructible - Hide Platform_Array[Platform_Loop]
I feel like this would help avoid any weirdness and be far more efficient.
Thank you; I do tend to neglect streamlinging triggers and roll more on a "as long as it works" basis, so a lesson on craftsmanship is always appreciated.

(I can't find a "For Loop" function, only "For Integer", maybe that's just because my WE is outdated. If that is the case, I will implement that once I upgrade. Right now I'm just gonna finish the demo in my current version.)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,871
The For Integer function is a For Loop, sorry for the confusion.

For Loops are universal in computer science and are present in most if not all programming languages. Warcraft 3's programming language Jass (or Lua) are no exception. Basically everything you're doing in the Trigger Editor is standard programming stuff, it's just Warcraft-ified so that all of the technical mumbo jumbo is hidden behind an easy to understand interface.

Anyway, I see that you updated your post and said that the problem disappears after deleting all of your other triggers, so I think it's safe to assume that the issue is in one of those deleted triggers. I could maybe take a look over them if you wanted, as long as the map doesn't have 10,000 triggers or something :p
 
Status
Not open for further replies.
Top