• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[Crash] I find it odd this crashes war3 xD

Status
Not open for further replies.
Level 14
Joined
Oct 18, 2013
Messages
713
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • SlotTakenBool[TempInt] Equal to False
    • Then - Actions
      • Set SlotTakenBool[TempInt] = True
      • Set Winner[(WinnerNum - 1)] = Finalist[TempInt]
      • Destructible - Create a IconsType[(Custom value of Winner[(WinnerNum - 1)])] at UIWinPoint[TempInt] facing 180.00 with scale 1.00 and variation 0
    • Else - Actions
      • Trigger - Run (This trigger) (checking conditions)


Alright so this piece of script crashes War3, idk if it is just for me, but I don't think so. xD I'm assuming its the "Trigger - Run (This trigger) (checking conditions)" Kinda makes me wonder why there is even a Function for "This Trigger" xD Ah well. Is a "For Each Integer" action the most efficient way to do the same thing?
 
Level 14
Joined
Oct 18, 2013
Messages
713
For some reason, it didn't copy the action above that if/then
the action above is:
set tempint= random int (1,10) So it doesn't seem it would cause an infinite loop, correct? As it would run the trigger again and generate a different integer.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,264
So it doesn't seem it would cause an infinite loop, correct?
It still could due to the random nature of random numbers. Obviously it becomes practically impossible but still could happen.

The crash is likely due to recursive nonsense. Anything from stack overflow to JASS not being able to handle the state. It could even be one of the other actions crashing in the case of it creating an invalid destructible.

I would recommend making an array list. You can then pick one index at random (0 to size-1) and remove it from the list repeating until the list is empty. This guarantees that each iteration will give you a SlotTakenBool Equal to False element. Not recursive and finite iteration length solve everything.
 
  • Like
Reactions: hdm
Level 14
Joined
Oct 18, 2013
Messages
713
@Dr. Super Good
Ah, that's exactly the kind of answer I was looking for ^^ Thanks. I singled out everything in my trigger and found out it was that "Run (This trigger)" bit. Thanks for the suggestion as well, that would seem the best way to do it.
 
Status
Not open for further replies.
Top