WarCraft III Maps by Antistone


Strange Results in the World Editor

 

The following are various strange and unexpected results that have been encountered in the process of using the WarCraft III World Editor, and the causes that were eventually diagnosed for them.  Some of these may be bugs that get fixed in future patches, but several of them are either pretty clearly intended or have no obvious simple "fix."

 

Table of Contents

Game Crashes

Units don't respond to issued orders

Building begins construction but doesn't finish

A trigger referring to the owner of a unit does things for player 1 that it shouldn't

A trigger which shadows two global variables with local variables doesn't work

A bouncing attack sometimes hits the same target more than once and sometimes doesn't

A unit's attack range is lower than I specified

A unit's acquisition range is higher than I set in my trigger

A unit hit by a modified Shadow Strike spell dies instantly

Critical Strike or Bash won't activate, or activate with a different probability than I specified

Level of an upgradeable ability in a Spellbook added through triggers is too high

Orb of Annihilation doesn't work

Incinerate doesn't work

Cleaving Attack doesn't work

A unit with Demolish deals no damage

An orb ability, special arrow ability (like searing arrows, cold arrows, or poison arrows) or a lifesteal ability won't work

Trigger doesn't detect casting of a spell inside a Spellbook


Game Crashes

There are several things known to cause the game to completely crash and exit, usually resulting (on a Windows machine) in an error window saying that some memory could not be "read."  Known causes include:

 

Units don't respond to issued orders

This tends to occur when there are too many trigger instances running at once; usually when a trigger which fires very frequently includes a wait, but gets activated again before the wait is up.  When this happens, the triggers tend to take a long time to execute, and units become unresponsive to player controls, although they are able to continue to act on their own (automatically acquiring targets and so forth) just fine.  The problem is aggravated by using game-time waits instead of real-time waits.

 

Building begins construction but doesn't finish

There are two problems that can cause this sort of result.

The first occurs when a human worker doesn't have the human repair ability; human workers construct buildings by placing the scaffolding and then repairing the building until it is complete, so without the repair ability construction can't finish.

The second occurs when a building's maximum hit points are set to an extremely low value (the threshold is somewhere around 8 HP).

 

A trigger referring to the owner of a unit does things for player 1 that it shouldn't

Player of (no unit) returns player 1. If you're trying to get the owner of a unit, you should always make sure that there's actually a unit to get the owner of; many trigger events supply event responses that sometimes return valid units and sometimes don't (for example, in the "a unit dies" event, the "killing unit" may or may not be an actual unit).

 

A trigger which shadows two global variables with local variables doesn't work

Shadowing one global variable with a local variable is a standard trick for using local variables mostly in the GUI and works fine, but if you try to do it with two variables in the same trigger they end up sharing the same memory and writing to one will overwrite the other.  It's not clear why this happens.  Multiple local variables used entirely in JASS which do not shadow globals should work fine.

 

A bouncing attack sometimes hits the same target more than once and sometimes doesn't

Normally, a single bouncing attack will not hit any target more than once; however, if the same unit makes another attack while the first attack is still bouncing, this will (by default) allow the bouncing attack to return and hit targets a second time.  A gameplay constant added in 1.17 should prevent this if you set it to the appropriate value; there is no known way to allow a bouncing projectile to hit targets arbitrarily many times if the unit that made the attack does not continue attacking.

 

A unit's attack range is lower than I specified

Units cannot attack from a distance greater than their Acquisition Range (as specified in the object editor), regardless of their specified attack range. Changing the Acquisition Range in mid-game through triggers has no effect on attack range.

 

A unit's acquisition range is higher than I set in my trigger

Acquisition range cannot be set lower than about 51.0 through triggers; values lower than this will not have the intended effect.

 

A unit hit by a modified Shadow Strike spell dies instantly

The time that Shadow Strike waits between damage increments is specified in the "Casting Time" data field; a casting time of zero causes the spell to apply its decay damage repeatedly upon impact until the target unit is dead.

 

Critical Strike or Bash won't activate, or activate with a different probability than I specified

These abilities (and possibly Orb of Lightning and its variants as well) don't simply use the probability that you specify; they use a special "rolling" probability system that tries to keep the overall frequency of activations the same while decreasing the frequency of long runs, so that you don't get a lot of activations or a lot of non-activations in a row.  However, a side-effect of this system is that it rounds all probabilities to the nearest 5%.  This means that if the probability specified is 2% or lower, the ability will never activate.

This system is not used for all random abilities, however--for example Evasion uses a simple system and exactly the probability you specify.

 

Level of an upgradeable ability in a Spellbook added through triggers is too high

In an earlier patch, upgradeable abilities added through triggers used to not be granted upgrade bonuses properly; I suspect that when they fixed this, they introduced something which gives the bonus to abilities inside Spellbooks more than once, causing them to be a higher level than they should be.  You can work around the problem by using the "Unit - Set Level of Ability for Unit" trigger action to set the ability to the proper level after adding the Spellbook.

 

Orb of Annihilation doesn't work

This ability only works on units whose weapon type is set to msplash.

 

Incinerate doesn't work

This ability only works on units whose weapon type is set to missile (or possibly some variant thereof); it cannot be made to work for melee units.

 

Cleaving Attack doesn't work

This ability only works on units whose weapon type is set to normal (in other words, melee units).

 

A unit with Demolish deals no damage

Demolish doesn't multiply damage correctly against certain targets, and so if the ability can affect these targets the attack deals no damage.

 

An orb ability, special arrow ability (like searing arrows, cold arrows, or poison arrows) or a lifesteal ability won't work

The abilities listed above do not stack with each other, and a unit can only use one at a time.  A unit with an arrow ability carrying an orb item should use the arrow ability if autocasting is turned on and use the orb otherwise.

Also, the arrow abilities do not work for units with melee attacks

 

Trigger doesn't detect casting of a spell inside a Spellbook

The "Charge Gold the Lumber" ability apparently can't be detected with trigger events when it is cast from insid