help with dummy units

C

Cepheids

Guest
when the following code is executed, the caster warps about the target till he is beside it. however, my dummy unit refuses to cast the spell. can anyone tell me why my dummy unit doesnt cast?

i made the dummy unit have a model, and i managed to cast it manually before the expiration timer runs out. how come i can cast it but the trigger cant order it to cast?

Code:
Crossslash
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Crossslash 
    Actions
        Custom script:   local unit XCaster = GetSpellAbilityUnit()
        Custom script:   local unit XTarget = GetSpellTargetUnit()
        Custom script:   local integer udg_LoopCounter = 1
        Unit - Add Invulnerable (Neutral) to Caster
        For each (Integer LoopCounter) from 1 to 10, do (Actions)
            Loop - Actions
                Custom script:   set udg_Caster = XCaster
                Custom script:   set udg_Target = XTarget
                Set Point[0] = (Position of Caster)
                Set Point[1] = (Position of Target)
                Set Point[2] = (Point[0] offset by ((Distance between Point[0] and Point[1]) x 1.60) towards (Angle from Point[0] to Point[1]) degrees)
                Unit - Move Caster instantly to Point[2]
                Unit - Create 1 Dummy for (Owner of Caster) at Point[0] facing Point[2]
                Unit - Add Crossslash  to (Last created unit)
                Unit - Set level of Crossslash  for (Last created unit) to (Integer(((Distance between Point[0] and Point[2]) / 200.00)))
                Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                Custom script:   call IssueTargetOrderBJ( GetLastCreatedUnit(), "crossslash", udg_Target )
                Custom script:   call RemoveLocation(udg_Point[0])
                Custom script:   call RemoveLocation(udg_Point[1])
                Custom script:   call RemoveLocation(udg_Point[2])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Crossslash  for (Last created unit)) Less than or equal to 1
                    Then - Actions
                        Unit - Remove Invulnerable (Neutral) from Caster
                        Skip remaining actions
                    Else - Actions
                        Wait ((Real((Level of Crossslash  for (Last created unit)))) / 10.00) game-time seconds
 

Jazradel

Helping people do more by doing less.
Reaction score
102
Custom script: call IssueTargetOrderBJ( GetLastCreatedUnit(), "crossslash", udg_Target )

Is your problem. You can only use orders already in the game. You must use the order of the ability your spell is based on.
 
C

Cepheids

Guest
you mean i cant use my own orders? even if i make the order string in the ability to be as such?

that is horrible...
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> even if i make the order string in the ability to be as such?

Actually, you can't invent new order IDs.

But, there's plenty of them already...
And, for the record, changing the "text - order string" does nothing.
 

Daelin

Kelani Mage
Reaction score
172
In fact, I suggest everyone to use Channel ability, because it is the only one which allows you to add new Order IDs, maybe even invent. Didn't try but it may be possible.

And Jazradel, don't use BJ functions whenever possible. In this case, the correct native is

IssueTargetOrder(GetLastCreatedUnit(), "crossslash", udg_Target )

In fact, IssueTargetOrderBJ looks like this:

function IssueTargetOrderBJ takes unit whichUnit, string order, widget targetWidget returns boolean
return IssueTargetOrder( whichUnit, order, targetWidget )
endfunction

So you see? It's useless to use a function which simply calls a native, when you could call the native yourself. You will realize that as your codes get more complicated, using natives makes things no longer lag. ;) Cheers!

~Daelin
 

xPheRe

New Member
Reaction score
43
Often BJ functions are warpers between GUI actions and JASS.
Sometimes it's because parameters in the GUI function are in different order than in the JASS one.
Or they need some convertion (strings to ability codes and everything)

But IssueTargetOrderBJ... is really useless, yes.
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
And, do you want to create a multiboard without the using of BJ functions?

Sometimes you have to choose betwen 'Make a realy long script with 100% natives' and 'Make a shorter one but with a few BJ functions'.

And there is also alot of BJ functions that makes the life alot easier.
Like RMaxBJ and the simular things.
 
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