• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

SetUnitX/Y - Compilation Error

Status
Not open for further replies.
Hello, for move a unit without cancel any orders, i used the SetUnitXY JASS fonction, but i have a compilation error. I can't correct this error with my Jass knowledge, so i need oyur help :

Here are the trigger and the custom code script :
JASS:
function SetUnitXY takes unit u, real x, real y returns nothing
    call SetUnitX(u, x)
    call SetUnitY(u, y)
endfunction
  • Starfall Loop
    • Evénements
      • Temps - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from SF_Index2 to SF_Index, do (Actions)
        • Boucle - Actions
          • Set SF_Point = (Position of SF_Caster[(Integer A)])
          • Set SF_CoorX = (X of SF_Point)
          • Set SF_CoorY = (Y of SF_Point)
          • Custom script: call SetUnitXY(udg_SF_Dummy[Integer A], udg_SF_CoorX, udg_SF_CoorY)
          • Custom script: call RemoveLocation( udg_SF_Point )
 
Hmm, no compilation error now, but SF_Dummy[IntegerA] is still not moving.

  • Starfall
    • Evénements
      • Unité - A unit Initie l'effet d'une compétence
    • Conditions
      • (Ability being cast) Egal Ã* Etoile Filante
    • Actions
      • Déclencheur - Turn on Starfall Loop <gen>
      • Déclencheur - Turn on Starfall End <gen>
      • Set SF_Index = (SF_Index + 1)
      • Set SF_Caster[SF_Index] = (Casting unit)
      • Set SF_Point = (Position of (Triggering unit))
      • Unité - Create 1 Starfall Dummy Dummy for (Owner of (Triggering unit)) at SF_Point facing Orientation bâtiment par défaut degrees
      • Unité - Set level of Starfall Dummy for (Last created unit) to (Level of Etoile Filante for (Triggering unit))
      • Unité - Order (Last created unit) to Prêtresse de la lune elfe de la nuit - Etoile filante
      • Set SF_Dummy[SF_Index] = (Last created unit)
      • Custom script: call RemoveLocation( udg_SF_Point )
  • Starfall Loop
    • Evénements
      • Temps - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from SF_Index2 to SF_Index, do (Actions)
        • Boucle - Actions
          • Set SF_Point = (Position of SF_Caster[(Integer A)])
          • Set SF_CoorX = (X of SF_Point)
          • Set SF_CoorY = (Y of SF_Point)
          • Custom script: call SetUnitXY(udg_SF_Dummy[bj_forLoopAIndex], udg_SF_CoorX, udg_SF_CoorY)
          • Custom script: call RemoveLocation( udg_SF_Point )
  • Starfall End
    • Evénements
      • Unité - A unit Meurt
    • Conditions
      • (Unit-type of (Dying unit)) Egal Ã* Starfall Dummy Dummy
    • Actions
      • Set SF_Index2 = (SF_Index2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • SF_Index Egal Ã* SF_Index2
        • Alors - Actions
          • Déclencheur - Turn off Starfall Loop <gen>
          • Déclencheur - Turn off (This trigger)
        • Sinon - Actions
 
Status
Not open for further replies.
Top