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
 
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.
 
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...
 
> 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.
 
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
 
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.
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top