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

Detect autocast?

Status
Not open for further replies.
Level 15
Joined
Mar 25, 2016
Messages
1,327
What do you want to detect? If autocast is enabled/disabled or if a unit uses an ability because of autocast?
The second one is impossible I guess, because you can't distinguish between manual cast and autocast.
 
Try checking out the order issued by a unit and see if it matches with the order string of the autocast ability.

To get the order string, you'll need some debug functions.

This only detects the issued order:
  • Trigger
    • Debug Order
  • Event
    • Unit - A unit is issued an order
    • Unit - A unit is issued a point order
    • Unit - A unit is issued a target order
    • Unit - A unit is issued a unit order
  • Conditions
  • Actions
    • Custom Script - call BJDebugMsg("Issued order is " + OrderId(GetIssuedOrderId()))
    • Custom Script - call BJDebugMsg("Numerical value of issued order is " + I2S(GetIsssuedOrderId()))
 
Level 25
Joined
May 11, 2007
Messages
4,651
Just use the berserk spell, it's instant.
Create two versions of it, "Run" and "Walk", when one of them is used, remove it and add the other version. Set both to same hotkey.

Easier for the player to use too, as they don't have to right click the spell in order to toggle movement.
 
Status
Not open for further replies.
Top