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

Crashing trigger

Status
Not open for further replies.
Level 9
Joined
Dec 31, 2016
Messages
314
Hi, I am quite lost in here. The trigger crashes the game and I cant find a reason why. The reason seems to lie in this condition according to my testing of the function. But I don't understand what's wrong with it.
  • MinY Less than ((Y of SpawnPoint) - 128.00)
Can you guys give me a hint, please?
MinY, MaxX etc. are border coordinates of a region.
Thank you for any help.
  • Rock Generation
    • Events
    • Conditions
    • Actions
      • Set VariableSet SpawnPoint = (Point((X of SpawnPoint2), (Y of SpawnPoint2)))
      • Custom script: call RemoveLocation(udg_SpawnPoint2)
      • Unit - Create 1 SpawnUnit for Neutral Passive at SpawnPoint facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MaxX Greater than ((X of SpawnPoint) + 128.00)
        • Then - Actions
          • Set VariableSet SpawnPoint2 = (Point(((X of SpawnPoint) + 128.00), (Y of SpawnPoint)))
          • Custom script: call RemoveLocation(udg_SpawnPoint)
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MinY Less than ((Y of SpawnPoint) - 128.00)
            • Then - Actions
              • Set VariableSet SpawnPoint2 = (Point(MinX, ((Y of SpawnPoint) - 128.00)))
              • Custom script: call RemoveLocation(udg_SpawnPoint)
              • Trigger - Run (This trigger) (checking conditions)
            • Else - Actions
 
Level 23
Joined
Apr 3, 2018
Messages
460
Your trigger seems to be running itself repeatedly. If this is done too much, it will crash the game, as every run of the trigger creates a code thread which are limited in number. If it was just done in a single thread, it would run out of operation limit and just not work any further without crashing.

It probably is fine when doing just one row, but once it starts creating multiple rows (the Y condition) the game crashes.

Try separating the load using a timer, creating a single row with every tick.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
I believe you can use "Run this trigger (Ignoring conditions)", I'm pretty sure it only ignores the Conditions literally found in the Conditions block and not in your Actions. I think this is faster even without any conditions?

Also, it may have to do with the unit creation as well, I'd disable that if you still crash after trying biridius' suggestion.
 
Last edited:
Status
Not open for further replies.
Top