• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

IssueImmediateOrderById not working? (Lua)

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,954
Lua:
function Dummy_Instant_AoE(p, abil)
    abil = FourCC(abil)
    local u = p.Dummy
    if p.DummyAbility ~= nil then
        UnitRemoveAbility(u, p.DummyAbility)
    end
    SetUnitPosition(u, GetUnitX(p.Hero), GetUnitY(p.Hero))
    p.DummyAbility = abil
    UnitAddAbility(u, abil)
    IssueImmediateOrderById(u, abil)
    print("works")
end
I call this function to move a Dummy unit to the position of my Hero and then order it to cast an AoE ability (Thunder Clap in this case).

The print message appears so it's not like I'm crashing the thread. Also, I can manually cast the ability on my Dummy so it's not something simple like that.

Which leaves this as the only possible issue: IssueImmediateOrderById(u, abil)

abil is set to: "A001"
I'm 100% positive this is the correct id.

And if I don't set abil = FourCC(abil) then it crashes when I reference abil so that's not the issue either.

Any ideas?
 
Last edited:

Uncle

Warcraft Moderator
Level 74
Joined
Aug 10, 2018
Messages
7,954
Yeah, I'm using that as the alternative for now, I was just hoping I could skip a step.

It's just that from what I gathered from other threads it should be possible to order a unit to use an ability referencing it's ability id. But maybe the info was outdated/incorrect.
 
Level 27
Joined
Apr 3, 2018
Messages
500
I'm not aware of any such natives being on 1.26, so if there is such a way it has to be some new jass function that gets orderid from abilityid, so you'd have to look into the list of all new functions from later updates to find it.

I don't see any such function in the new native list from WarCraft III: The Frozen Throne - Patch 1.29.0 - Liquipedia Warcraft Wiki , they all seem to operate with tooltips and icon positions only.

You could make a database on arrays/hashtable and manually put all orders for all your abilities in there and then retrieve them when using your dummycaster function
 
Last edited:
Status
Not open for further replies.
Top