Issue unit to (item illusions)

Magazette2

New Member
Reaction score
3
i made a custom item illusions ability and changed it to a unit ability. I want to order a unit to use that ability but i dont know how to do that. I can only get units to use ability if the ability is based off a unit/hero ability
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Custom script: call IssueTargetOrderById("Casting unit here", 852274, "Target unit here")

The details depend on where exactly that unit is coming from.
(Triggering unit, created unit, picked unit, ...)
 

Magazette2

New Member
Reaction score
3
whered u get the 852274 from

Code:
Untitled Trigger 015
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Haunt 
    Actions
        Set hauntheros = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
        Set hauntheroint = (Number of units in hauntheros)
        Unit Group - Pick every unit in hauntheros and do (Actions)
            Loop - Actions
                Set hauntheropoint = (Position of (Picked unit))
                Unit - Create hauntheroint Dummyiez for (Owner of (Casting unit)) at hauntheropoint facing Default building facing degrees
                Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                Unit - Set level of Haunts  for (Triggering unit) to (Level of Haunt  for (Triggering unit))
                Custom script:   call IssueTargetOrderById(LastCreatedUnit 852274 PickedUnit)

so is my custom cript right or do i have to set variables and use them and put im commas or what
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
More JASS...

Event
- Unit - A unit Is issued an order targeting an object
- Unit - A unit Is issued an order targeting a point
- Unit - A unit Is issued an order with no target
Conditions
Actions
- Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))

and a unit with the "illusions" item...
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> ??? why r we talking about events now?

At the time I posted, there was no trigger yet...

> Isn't that a unit ID?

No. That's the order ID of the ability "item illusion".
Unit IDs are numbers too.
But, then again, all IDs are numbers...

> is my custom script right or do I have to set variables and use them and put in commas or what

Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, 852274, GetEnumUnit())
Orders the "last created unit" to "item illusion" the "picked unit".

> why do I have to do it in JASS?

Because there is not GUI action to give that order...


You're also using "Owner of (Casting unit)"...
Casting unit doesn't work that well in triggers that do their own casting.
Store it in a variable (recommended), or try with "Triggering unit" instead.
 

Magazette2

New Member
Reaction score
3
call IssueTargetOrderById(bj_lastCreatedUnit, 852274, GetEnumUnit()) is this exactly what i have to type in?
 

warroom99

New Member
Reaction score
15
when u use items? does it make a difference?

when u order last created unit to use last created item?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
There is an "order unit to use item on unit" action (under "Hero").
That works too.
But you need a unit with inventory and item...
The actual effect is, obviously, the same.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top