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

Can't use ability through Jass, why? :[

Status
Not open for further replies.
Level 5
Joined
Nov 27, 2007
Messages
85
I need to use this ability for AI.
Here's how I'm doing it:
JASS:
call IssuePointOrderLoc(u, "ward", udg_TempPoint)
IT DOESNT WORK! Just nothing happens.

I added "ward" to "Text - Order String - Use/Turn on" entry In Object Editor to this ability.

Base ability: Reveal (used in human arcane tower and in goblin shop).
Note: Reveal doesn't have any "turn on string" in Object Editor.

My guess - it's because of base Ability, Reveal. It doesnt have any "turn on string" (it's NONE). Could it be the reason?

What should I do? Is there any way to have AI use this ability?
I wish so much there was such a func:
JASS:
native UnitUseAbility takes unit u, integer ability_id returns nothing

Ability screenshot:
xability.gif
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
The order string won't be changed by editing the mentioned field in object editor.

You can use Reveal via its numeric order id.

JASS:
call IssuePointOrderByIdLoc(u, 852270, udg_TempPoint)

The numeric order id can be found out by creating a simple trigger:

  • Events
    • Unit - A unit Obtains an order targeting an object
    • Unit - A unit Obtains an order targeting a point
    • Unit - A unit Obtains an order with no target
  • Conditions
  • Actions
    • Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))
and then cast the ability manually in a test run.

or just use the order converter of Blade.dk.

I wish so much there was such a func:

You could use an item with the ability.

JASS:
function UnitUseItemPointLoc takes unit whichUnit, item whichItem, location loc returns boolean
    return UnitUseItemPoint(whichUnit, whichItem, GetLocationX(loc), GetLocationY(loc))
endfunction
 
You could use an item with the ability.

JASS:
function UnitUseItemPointLoc takes unit whichUnit, item whichItem, location loc returns boolean
    return UnitUseItemPoint(whichUnit, whichItem, GetLocationX(loc), GetLocationY(loc))
endfunction

Obviously, you need to have the equivalent item equipped for that function to be effective.
 
Status
Not open for further replies.
Top