[Trigger] unit move

Status
Not open for further replies.
Level 3
Joined
Jul 26, 2011
Messages
38
Guys What is the error of this trigger?
  • Start Quest
    • Events
      • Dialog - A dialog button is clicked for npc_var_dialog
    • Conditions
      • (Clicked dialog button) Equal to var_DialogArray[3]
    • Actions
      • Game - Display to (Player group((Triggering player))) the text: |cffffcc00Rune Ques...
      • Set U_Group = (Units owned by (Triggering player) matching (((Triggering unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in U_Group and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Center of Beast Entrance <gen>)
when i press the dialog botton the unit is not instantly move to the region !
can u help me guys?


thx
 
triggering unit is wrong there....you have to use matching unit everytime you use units owned by XY MATCHING something something.
 
triggering unit is wrong there....you have to use matching unit everytime you use units owned by XY MATCHING something something.

it didnt work sir, i change the triggering unit to mathching unit

  • Set U_Group = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
  • Unit - Move (Matching unit) instantly to (Center of Beast Entrance <gen>)
 
yxou just have to change the first one (where you set the group) to matching unit....the second one have to be picked unit ^^
 
So is this solved now?

Btw Center of region should be stored into point variable and then removed after it's use with:
  • Custom script: RemoveLocation( udg_VARIABLE )
To remove leaks.

Also any Unit Group will create leak because you will create group.
In jass it look like this:
JASS:
function ForGroupBJ takes group whichGroup, code callback returns nothing
    // If the user wants the group destroyed, remember that fact and clear
    // the flag, in case it is used again in the callback.
    local boolean wantDestroy = bj_wantDestroyGroup
    set bj_wantDestroyGroup = false

    call ForGroup(whichGroup, callback)

    // If the user wants the group destroyed, do so now.
    if (wantDestroy) then
        call DestroyGroup(whichGroup)
    endif
endfunction
So all you need to do is to place:
  • Custom script: set bj_wantDestroyGroup = true
Above Unit Group trigger action and it will be removed later in code.
or in your case, you can do next:
  • Custom script: call DestroyGroup( udg_U_Group )
 
Status
Not open for further replies.
Back
Top