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

[Solved] Triggers causes Wc3 closes

Status
Not open for further replies.
Level 5
Joined
Jun 23, 2010
Messages
46
Hi everybody, well i was working in my map and something causes that wc3 closes without any window, i tested a lot of times and i guess that i found the problem: the triggers that i use.
My map includes an AI that is working with triggers but it causes that wc3 closes at 15min in every game, i think that when it happen the game have so many actions to do simultaneously... i dont know what to do..
This are the trigger format that i use:
example.png

Triggers are off unless the game need it, when AI Pandaren is selected, for example
Sorry for my english
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
Your triggers are leaking by the looks of things. Although not part of the crash you may want to fix them. Specifically in the picture above the group destroy actions only occur if there are more than 4 units in the group, so while there are less than or equal to 4 the two groups leak. Place the destroy group calls after and outside the conditional statement but still inside the player group loop.

Your trigger also leaks a player group I think. Hard to tell with the GUI.

Is it possible that you get into an infinite loop? For example one of the orders the AI issues then causes more orders which trigger itself.

Maybe your AI design is inefficient. For example the trigger shown above applies to all computers, possibly ones which may never be able to build the unit. Some optimizations could possibly improve AI performance and prevent any crashes.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Is it possible that you get into an infinite loop? For example one of the orders the AI issues then causes more orders which trigger itself.
This. The issued unit order might be causing an infinite loop. Are there any triggers that run off the "A unit is Issued an order with no target?"

Your trigger also leaks a player group I think. Hard to tell with the GUI.
It does.

On top of the leaks DSG pointed out, the GUI function "Unit Group - Units of Type" has an unpreventable leak. I suggest filtering out the unittype with an If / Then / Else.


Also, next time you post triggers, just copy paste them between trigger tags. Take a look at this thread if you're confused on how to do it.
 
Level 5
Joined
Jun 23, 2010
Messages
46
Okay, first, thanks so much for answers guys, i keep trying to solve this.
I find a way to use triggers that dont requires so many variables:
First i need a trigger to assign race type to AI player, and then other trigger to train the unit
  • Set forsaken variable
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of living Town Hall (Forsaken) units owned by (Picked player)) Equal to 1
        • Then - Actions
          • Set PlayerIAForsaken = (Picked player)
        • Else - Actions
  • Archer Fo
    • Events
      • Time - Every 35.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a Computer player) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of living Undead Footman (Forsaken) units owned by PlayerIAForsaken) Less than or equal to 3
            • Then - Actions
              • Unit - Order (Random unit from (Units owned by PlayerIAForsaken of type Skeletal Marksman)) to train/upgrade to a Undead Footman (Forsaken)
            • Else - Actions

Is it possible that you get into an infinite loop? For example one of the orders the AI issues then causes more orders which trigger itself.



This. The issued unit order might be causing an infinite loop. Are there any triggers that run off the "A unit is Issued an order with no target?"

I didnt get it this, sorry
You guys mean that the infinite loop can be the reason of the crash? Or i should use a trigger with infinite loop to fix the crash?
The crash can be caused because the map have so many triggers with the "periodic event" timer?

(Sorry for double post, but i couldnt send the entire message)
 
Last edited by a moderator:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
With Archer Fo there still is a player group (force) leak. You also leak at least 1 group and possibly even 1 or more handles.

Surely the player loop is not even needed?
You guys mean that the infinite loop can be the reason of the crash?
Yes we mean that an infinite loop can cause the crash. Its one of the most common reasons for WC3 suddenly closing without a crash report dialog.

The crash can be caused because the map have so many triggers with the "periodic event" timer?
No it can only be caused by doing something recursive, as mentioned in the example. For example if you have a trigger that fires when a unit is issued a point order and in its actions issues the triggering unit a point order then it will recursively fire itself until the game closes.
 
Status
Not open for further replies.
Top