• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Crash] I find it odd this crashes war3 xD

Status
Not open for further replies.
Level 13
Joined
Oct 18, 2013
Messages
686
  • 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 13
Joined
Oct 18, 2013
Messages
686
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 63
Joined
Jan 18, 2005
Messages
27,156
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 13
Joined
Oct 18, 2013
Messages
686
@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