• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] adding a unit to a null unit group in a hashtable

Status
Not open for further replies.
Level 13
Joined
May 11, 2005
Messages
416
if i do
  • Unit Group - Add unit to (Load x of y in hashtable)
and haven't yet stored a unit group in that key, does it create a group and store it there or does it do nothing because it didn't find a group there?
if it's the second case, how do i create and store an empty group in a hashtable
 
For future-reference, nothing is done automatically in Warcraft III ;)
The only thing that's done automatically is the initialization of arrays to 0, null, "", and false.

And any time you expect something from Warcraft III, it crashes you :p
You'd think it'd move units inside the map bounds when they're out of it, but it doesn't do that, it just crashes you because it failed to render the frame.
If you expect a normal variable in Jass to have a default value like arrays, it crashes you.
If you create an infinite loop, it doesn't stop it, it crashes you.
If you destroy a null image, it crashes you.
If you refer to Player 22 or Player 19923, it crashes you.
If you refer to Player -1, it crashes you.
If you set a unit's teamcolor to something greater than 15 or less than 0, it crashes you.

Thus, you should NEVER expect Warcraft III to do things for you ;)
 
Level 13
Joined
May 11, 2005
Messages
416
If you create an infinite loop, it doesn't stop it, it crashes you.
that isn't true, at least in GUI. triggers cease to run after a depressingly short number of functions

this
  • Untitled Trigger 004
    • Player - Set Player 1 (Red) Current gold to 0
    • For each (Integer A) from 1 to 10000, do (Actions)
      • Loop - Actions
        • Player - Add 1 to Player 1 (Red) Current gold
gives me 3060 gold
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
^That is not an infinite loop, it just hits the operation limit :)

This is causes an infinite loop and crashes the game:
  • Untitled Trigger 016
    • Events
      • Unit - Knight 0018 <gen> Takes damage
    • Conditions
    • Actions
      • Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 500.00 damage of attack type Spells and damage type Normal
 
Status
Not open for further replies.
Top