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

[Solved] Issue "Night Elf - Root" order.

Status
Not open for further replies.
Level 14
Joined
Aug 31, 2009
Messages
775
So for my custom map, I'm trying to make a unit that essentially acts like a Siege Tank from Starcraft II with automated AI.

When it tries to attack a unit, it is instead given a "Root" order, and suitably transforms into a building version of itself. When no targets are in range, it automatically unroots itself.

The unrooting works perfectly.

The rooting however, does not.

The trigger is very simple, just a typical "Unit is attacked" event, with condition being the unit type check, and the actions are simply:

  • Set point = (Position of (Attacking unit))
  • Unit - Order (Attacking unit) to Night Elf Ancients - Root point
  • Custom script: call RemoveLocation(udg_point)
Apparently this doesn't work.

And of course, I've already checked the obvious problems like the unit not having space to root, or pathing not being buildable etc.

Any ideas how to fix?
 
Level 18
Joined
Nov 21, 2012
Messages
835
  • root
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Unit Group - Add (Attacking unit) to test_tempGroup
      • Countdown Timer - Start test_tempTimer as a One-shot timer that will expire in 0.00 seconds
  • timertest
    • Events
      • Time - test_tempTimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in test_tempGroup and do (Actions)
        • Loop - Actions
          • Unit Group - Remove (Picked unit) from test_tempGroup
          • Unit - Order (Picked unit) to Night Elf Ancients - Root (Position of (Picked unit))
 
Level 14
Joined
Aug 31, 2009
Messages
775
Essentially, there seems to be a recurring bug in the Warcraft III engine relating to orders being given at the same time a unit attacks. It's very inconsistent.

For example, let's say you make a simple trigger say something like:

Event : A unit is attacked
Conditions: (Unit type of (Attacking Unit) equal to [Whatever])
Actions: Unit - Order (Attacking Unit) to Orc Farseer - Chain Lightning (Attacked Unit)

And for the sake of argument, the unit has 0 cast point, infinite resources to cast the spell and no cooldown.

This creates an error about once every 20 tries or so. The unit will "get stuck" - if the unit is under your control and you select it, the Chain Lightning skill will turn Green (as though it is being cast) but the unit will not do anything at all - until you tell it to stop.

For the Root ability though, this happens 100% of the time - the unit is always stuck with the ability lit up in green, but not doing anything.

There are other ways to cause this "green ability freeze" too. For example, make 2 custom spells with the same casting ID, and order the unit to cast one. It freezes one of them at random, and the unit is stuck.

My guess is that the above method works because even though the timer is set to 0.00 seconds, there's a minimal time delay, and this allows the order to properly override the attack. I don't know how it works under the hood, but that'd be my estimate. Anyway, it works so... all's well that ends well?
 
Last edited:
Status
Not open for further replies.
Top