• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Unit groups and SetUnitX

Status
Not open for further replies.
Level 8
Joined
May 9, 2010
Messages
266
I moved a unit using SetUnitPosition and check a group of units near him. Everything works. After that I changed SetUnitPosition to SetUnitX and Y. It doesn't work now. What should I do?
Moving Dummy unit checks the same dummys.
 
Level 8
Joined
May 9, 2010
Messages
266
as long as you're checking the right x,y it should work... my missile system (very old and not so good) uses SetUnit X/Y and it works when I added a method that checks if there's other missiles in range for example...

which is why we need to see the triggers that you're using...

Could you help if I give you a map with whole triggers?
Edit: x and y coordinates are calculated coorectly, because using
  • Custom script: call SetUnitPosition
it works and unit group checks correctly.
 
Level 8
Joined
May 9, 2010
Messages
266
where do you do the check btw? on the same function as the setunitX/Y or does it run in another function?
I check it after SetUnitX. Is it so necessary?
I have tried to set unit group from Units location and tried to use coordinates. The results are the same.
Btw:
Hmm.. I understand that when I used 0 MS, it checks everything but when I change that to 1 MS, the group doesnt check. Sure that this is not problem of function, this is problem of MS.
:vw_wtf::vw_wtf:
 
Level 8
Joined
May 9, 2010
Messages
266
That's weirder... my dummies have movespeed and I don't have problems

Heres a part of my trigger. Look pls
EDIT:
I removed locust ability from my dummy and theres no any problems even with MS.
 

Attachments

  • trig.jpg
    trig.jpg
    355.1 KB · Views: 112
Level 8
Joined
May 9, 2010
Messages
266

I dont have English WE =(
So i prnt screen that.
I have 3 Custom scripts, SetUnitX, SetUnitY And SetUnit Position, ofc one of them is turned off.
copy the whole trigger using the copy as text option then paste it here inside trigger tags...

It would be really ugly if I post triggers.
 
Level 8
Joined
May 9, 2010
Messages
266
the print screen isn't english too so why not just post the whole trigger?

Also, we're the ones that are asking for the triggers so it's our problem in case it looks ugly to us...

It would be crazy ugly. Okey, here is a triggers:
  • engine initia
    • События
      • Map initialization
    • Условия
    • Действия
      • Хэш-таблица - Create a hashtable
      • Set ENG_hash = (Last created hashtable)
      • -------- -- --------
      • -------- -- --------
      • -------- -- --------
      • -------- -- --------
      • Set ENG_UnitType = dummy
      • Set ENG_IsSlow = Да
      • Set ENG_Period = 0.02
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Если - Условия
            • ENG_IsSlow равно (==) Да
          • То - Действия
            • -------- ускорение 9.8 - влияет на силу трения --------
            • Set ENG_g = 9.81
            • -------- трение качения 7% --------
            • -------- снег 15-30% --------
            • -------- в случае не шара изменить этот коэффициент --------
            • Set ENG_SlowFactor = (0.07 x ENG_Period)
            • -------- жидкое трение 17.8 мкПА воздух 15 градусов --------
            • Set ENG_SlowLiquidFactor = ((18.00 x (Power(10.00, -6.00))) x ENG_Period)
            • -------- 35% энергии теряется при каждом рекошете --------
            • -------- скорость падает примерно на 20% --------
            • Set ENG_EnergyFactor = 0.35
            • -------- часть энергии переходит во вращение шара --------
            • -------- момент инерции шара 2/5 Мр ^2. Коэффициент равен корню из 3/5 = 0,77 --------
            • -------- скорость падает на 23% --------
            • -------- статично понижает скороть на % от изначальной --------
            • -------- 1 = мат. точка --------
            • Set ENG_InershionFactor = 0.77
            • -------- Скорость, при которой тело не в состоянии сдвинутся --------
            • Set ENG_StopFactor = (70.00 x ENG_Period)
            • -------- зависимость анимации от скорости движения --------
            • -------- скорость анимации = скорость * на этот коэффициент --------
            • Set ENG_AnimationFactor = 10.00
          • Иначе - Действия
            • Set ENG_InershionFactor = 1.00
      • Set ENG_IsExplode = Да
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Если - Условия
            • ENG_IsExplode равно (==) Да
          • То - Действия
            • -------- фактор, отвечающий за минимальную силу удара шаров для их уничтожения --------
            • -------- считается как произведение sqrt(масс) на скорость на угол двух шаров --------
            • Set ENG_DestroyFactor = 40000.00
            • -------- максимальная сила удара, при которой шары остановятся --------
            • Set ENG_NothingFactor = 50.00
            • -------- отвечает за радиус касания шаров друг с другом --------
            • -------- больше если шары иногда игнорируют касание --------
            • -------- меньше - наоборот --------
            • Set ENG_TouchKoefficient = 0.39
            • -------- спец-эффект при сталкивании шаров --------
            • Set ENG_StrikeSFX = Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
          • Иначе - Действия
      • Set ENG_IsWallBounce = Да
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Если - Условия
            • ENG_IsWallBounce равно (==) Да
          • То - Действия
            • -------- коэффициент, отвечающий за рекошет об стены --------
            • -------- меньше, если рекошеты не достаточно плавные --------
            • -------- больше, если некоторые рекошеты не срабатывают --------
            • -------- лучше оставить прежним --------
            • Set ENG_BounceKoefficient = 1.25
            • -------- спец-эффект при касании стены шаров --------
            • Set ENG_BounceSFX = Abilities\Spells\Orc\Devour\DevourEffectArt.mdl
          • Иначе - Действия
      • -------- максимальное отклонение от теоретического закона сохранения угла отражения --------
      • Set ENG_AngleDeformationFactor = 5.00
  • engine periodic ini
    • event
      • Unit - A unit start effect of ability
    • conditions
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempPoint = (TempPoint offset by 100.00 towards (Angle from TempPoint to TempPoint2) degrees)
      • Set TempPoint2 = (Target point of ability being cast)
      • Set ENG_RA = (Angle from TempPoint to TempPoint2)
      • Боевая единица - Create 1 ENG_UnitType for (Triggering player) at TempPoint facing ENG_RA degrees
      • Set ENG_Unit = (Last created unit)
      • -------- скорость (изначальная) --------
      • Set ENG_SpeedFactor = ((Random real number between 400.00 and 600.00) x ENG_Period)
      • -------- размер, связан с областью считывания ударов камней --------
      • Set ENG_size = (800.00 / ENG_SpeedFactor)
      • -------- - --------
      • -------- - --------
      • -------- - --------
      • Custom script: set udg_ENG_HandleId0 = GetHandleId(udg_ENG_Unit)
      • Боевая единица - Turn collision for ENG_Unit Откл.
      • Хэш-таблица - Save ENG_RA as (Key Angle) of ENG_HandleId0 in ENG_hash
      • Хэш-таблица - Save ENG_SpeedFactor as (Key SpeedFactor) of ENG_HandleId0 in ENG_hash
      • Хэш-таблица - Save ENG_size as (Key Size) of ENG_HandleId0 in ENG_hash
      • Отряд - Add ENG_Unit to ENG_group
      • Анимация - Change ENG_Unit's size to (ENG_size%, ENG_size%, ENG_size%) of its original size
      • Анимация - Change ENG_Unit's animation speed to (ENG_AnimationFactor x ENG_SpeedFactor)% of its original speed
      • Боевая единица - Add Превратиться в ворона to ENG_Unit
      • Боевая единица - Remove Превратиться в ворона from ENG_Unit
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
  • engin periodic loop
    • События
      • Время - Every 0.02 seconds of game time
    • Условия
      • (Number of units in ENG_group) не равно (!=) 0
    • Действия
      • Отряд - Pick every unit in ENG_group and do (Actions)
        • Цикл - Действия
          • Custom script: set udg_ENG_key = GetHandleId(GetEnumUnit())
          • Set ENG_SpeedFactor = (Load (Key SpeedFactor) of ENG_key from ENG_hash)
          • Боевая единица - Turn collision for (Picked unit) Откл.
          • Set TempUnit = (Picked unit)
          • Set ENG_RA = (Facing of (Picked unit))
          • Set ENG_size = (Load (Key Size) of ENG_key from ENG_hash)
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • Если - Условия
                • ENG_SpeedFactor больше (>) 0.00
              • То - Действия
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • Если - Условия
                    • ENG_IsSlow равно (==) Да
                  • То - Действия
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • Если - Условия
                        • ENG_SpeedFactor больше (>) ENG_StopFactor
                      • То - Действия
                        • Хэш-таблица - Save (((ENG_SpeedFactor / (1.00 + ENG_SlowLiquidFactor)) - (ENG_SlowFactor x ENG_g)) x 1.00) as (Key SpeedFactor) of ENG_key in ENG_hash
                      • Иначе - Действия
                        • Хэш-таблица - Save 0.00 as (Key SpeedFactor) of ENG_key in ENG_hash
                        • Анимация - Change (Picked unit)'s animation speed to 0.00% of its original speed
                  • Иначе - Действия
                • Custom script: set udg_ENG_x = GetUnitX(GetEnumUnit())
                • Custom script: set udg_ENG_y = GetUnitY(GetEnumUnit())
                • Custom script: set udg_ENG_xn = udg_ENG_x + udg_ENG_InershionFactor*udg_ENG_SpeedFactor*Cos(udg_ENG_RA*bj_DEGTORAD)
                • Custom script: set udg_ENG_yn = udg_ENG_y + udg_ENG_InershionFactor*udg_ENG_SpeedFactor*Sin(udg_ENG_RA*bj_DEGTORAD)
                • Set CP_Point = (Point(ENG_xn, ENG_yn))
                • Триггер - Run Check Walkability <gen> (ignoring conditions)
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Если - Условия
                      • CP_PointIsWalkable равно (==) Нет
                      • ENG_IsWallBounce равно (==) Да
                    • То - Действия
                      • Set TempPoint = (Position of TempUnit)
                      • Set ENG_dx = (ENG_SpeedFactor x ENG_BounceKoefficient)
                      • Set ENG_dy = ENG_dx
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • Если - Условия
                            • ENG_RA больше или равно (>=) 0.00
                            • ENG_RA меньше или равно (<=) 90.00
                          • То - Действия
                            • Custom script: set udg_ENG_xo = udg_ENG_x + udg_ENG_dx
                            • Custom script: set udg_ENG_yo = udg_ENG_y + udg_ENG_dy
                          • Иначе - Действия
                            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • Если - Условия
                                • ENG_RA больше (>) 90.00
                                • ENG_RA меньше или равно (<=) 180.00
                              • То - Действия
                                • Custom script: set udg_ENG_xo = udg_ENG_x - udg_ENG_dx
                                • Custom script: set udg_ENG_yo = udg_ENG_y + udg_ENG_dy
                              • Иначе - Действия
                                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  • Если - Условия
                                    • ENG_RA больше (>) 180.00
                                    • ENG_RA меньше или равно (<=) 270.00
                                  • То - Действия
                                    • Custom script: set udg_ENG_xo = udg_ENG_x - udg_ENG_dx
                                    • Custom script: set udg_ENG_yo = udg_ENG_y - udg_ENG_dy
                                  • Иначе - Действия
                                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      • Если - Условия
                                        • ENG_RA больше (>) 270.00
                                        • ENG_RA меньше или равно (<=) 360.00
                                      • То - Действия
                                        • Custom script: set udg_ENG_xo = udg_ENG_x + udg_ENG_dx
                                        • Custom script: set udg_ENG_yo = udg_ENG_y - udg_ENG_dy
                                      • Иначе - Действия
                      • Custom script: set udg_CP_Point = Location(udg_ENG_xo, udg_ENG_y)
                      • Триггер - Run Check Walkability <gen> (ignoring conditions)
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • Если - Условия
                            • CP_PointIsWalkable равно (==) Нет
                          • То - Действия
                            • Set ENG_NFA = ((180.00 + (Random real number between (-1.00 x ENG_AngleDeformationFactor) and (1.00 x ENG_AngleDeformationFactor))) - ENG_RA)
                          • Иначе - Действия
                            • Set ENG_NFA = ((0.00 + (Random real number between (-1.00 x ENG_AngleDeformationFactor) and (1.00 x ENG_AngleDeformationFactor))) - ENG_RA)
                      • Custom script: call RemoveLocation(udg_CP_Point)
                      • Хэш-таблица - Clear all child hashtables of child ENG_key in ENG_hash
                      • Отряд - Remove (Picked unit) from ENG_group
                      • Боевая единица - Remove TempUnit from the game
                      • Боевая единица - Create 1 ENG_UnitType for Игрок 1 (красный) at TempPoint facing ENG_NFA degrees
                      • Set ENG_Unit = (Last created unit)
                      • Custom script: set udg_ENG_HandleId0 = GetHandleId(udg_ENG_Unit)
                      • Отряд - Add ENG_Unit to ENG_group
                      • Анимация - Change ENG_Unit's size to (ENG_size%, ENG_size%, ENG_size%) of its original size
                      • Анимация - Change ENG_Unit's animation speed to (ENG_AnimationFactor x ENG_SpeedFactor)% of its original speed
                      • Custom script: call DestroyEffect(AddSpecialEffectLoc( udg_ENG_BounceSFX, udg_TempPoint))
                      • Хэш-таблица - Save (Facing of ENG_Unit) as (Key Angle) of ENG_HandleId0 in ENG_hash
                      • Хэш-таблица - Save (ENG_SpeedFactor x (Power((1.00 - ENG_EnergyFactor), 0.50))) as (Key SpeedFactor) of ENG_HandleId0 in ENG_hash
                      • Хэш-таблица - Save ENG_size as (Key Size) of ENG_HandleId0 in ENG_hash
                      • Custom script: call RemoveLocation(udg_TempPoint)
                    • Иначе - Действия
                      • -------- - --------
                      • Custom script: call SetUnitX(GetEnumUnit(), udg_ENG_xn)
                      • Custom script: call SetUnitY(GetEnumUnit(), udg_ENG_yn)
                      • Custom script: call SetUnitPosition(GetEnumUnit(), udg_ENG_xn, udg_ENG_yn)
                      • -------- - --------
                • Custom script: call RemoveLocation(udg_TempPoint)
                • Custom script: call RemoveLocation(udg_CP_Point)
                • Set TempPoint2 = (Position of TempUnit)
                • Set TempGroup = (Units within ((1.00 x ENG_TouchKoefficient) x ENG_size) of TempPoint2 matching (((Unit-type of (Matching unit)) равно (==) (Unit-type of (Picked unit))) and ((Matching unit) не равно (!=) TempUnit)))
                • Отряд - Pick every unit in TempGroup and do (Actions)
                  • Цикл - Действия
                    • Игра - Display to (All players) the text: (Name of (Picked unit))
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Если - Условия
                          • (Number of units in TempGroup) не равно (!=) 0
                        • То - Действия
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • Если - Условия
                              • ENG_IsExplode равно (==) Да
                            • То - Действия
                              • Set ENG_Picked = (Picked unit)
                              • Set TempPoint = (Position of (Picked unit))
                              • -------- Взрыв здесь --------
                              • Set ENG_key2 = (Key (Picked unit))
                              • Set ENG_size2 = (Load (Key Size) of ENG_key2 from ENG_hash)
                              • Set ENG_SpeedFactor2 = (Load (Key SpeedFactor) of ENG_key2 from ENG_hash)
                              • Set ENG_TotalDamage = ((((Power(ENG_size, 0.50)) x ENG_SpeedFactor) + ((Power(ENG_size2, 0.50)) x ENG_SpeedFactor2)) x ((Abs(((Facing of TempUnit) - (Facing of (Picked unit))))) + 1.00))
                              • Custom script: //call BJDebugMsg(R2S(udg_ENG_TotalDamage))
                                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  • Если - Условия
                                    • ENG_TotalDamage больше или равно (>=) ENG_DestroyFactor
                                  • То - Действия
                                    • Custom script: set udg_ENG_xm = 0.5 * (GetUnitX(GetEnumUnit()) + GetUnitX(udg_TempUnit))
                                    • Custom script: set udg_ENG_ym = 0.5 * (GetUnitY(GetEnumUnit()) + GetUnitY(udg_TempUnit))
                                    • Custom script: set udg_TempPoint2 = Location(udg_ENG_xm, udg_ENG_ym)
                                    • Custom script: set bj_wantDestroyGroup = true
                                    • Отряд - Pick every unit in (Units within 225.00 of TempPoint matching ((Unit-type of (Matching unit)) не равно (!=) (Unit-type of (Picked unit)))) and do (Actions)
                                      • Цикл - Действия
                                        • Set TempPoint = (Position of (Picked unit))
                                        • Боевая единица - Cause ENG_Picked to damage (Picked unit), dealing (((Load (Key Size) of ENG_key from ENG_hash) + (Load (Key Size) of ENG_key2 from ENG_hash)) / (0.05 x (Distance between TempPoint and TempPoint2))) damage of attack type Заклинание and damage type Обычный
                                        • Custom script: call RemoveLocation(udg_TempPoint)
                                    • Custom script: call DestroyEffect(AddSpecialEffectLoc( udg_ENG_StrikeSFX, udg_TempPoint2))
                                    • Отряд - Remove (Picked unit) from ENG_group
                                    • Отряд - Remove TempUnit from ENG_group
                                    • Хэш-таблица - Clear all child hashtables of child ENG_key in ENG_hash
                                    • Хэш-таблица - Clear all child hashtables of child ENG_key2 in ENG_hash
                                    • Боевая единица - Remove (Picked unit) from the game
                                    • Боевая единица - Remove TempUnit from the game
                                    • Custom script: call RemoveLocation(udg_TempPoint2)
                                  • Иначе - Действия
                                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      • Если - Условия
                                        • ENG_TotalDamage меньше или равно (<=) ENG_NothingFactor
                                      • То - Действия
                                        • Хэш-таблица - Save 0.00 as (Key SpeedFactor) of ENG_key in ENG_hash
                                        • Анимация - Change (Picked unit)'s animation speed to 0.00% of its original speed
                                        • Хэш-таблица - Save 0.00 as (Key SpeedFactor) of ENG_key2 in ENG_hash
                                        • Анимация - Change TempUnit's animation speed to 0.00% of its original speed
                                      • Иначе - Действия
                                        • -------- НЕ Ð*АБОТАЕТ ВСЕГДА --------
                                        • -------- МБ ПОТОМУ ЧТО НЕ ПÐ*ОГÐ*УЖАЕТСЯ SIZE? --------
                                        • -------- действия при среднем попадании --------
                                        • -------- не сильным чтобы разрушить и не слабым чтобы остановиться --------
                                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • Если - Условия
                                              • ENG_SpeedFactor2 равно (==) 0.00
                                            • То - Действия
                                              • -------- действия в случае, когда один из комней стоит --------
                                              • Хэш-таблица - Clear all child hashtables of child ENG_key2 in ENG_hash
                                              • Отряд - Remove ENG_Picked from ENG_group
                                              • Боевая единица - Remove ENG_Picked from the game
                                              • Боевая единица - Create 1 ENG_UnitType for Игрок 1 (красный) at TempPoint facing ENG_NFA degrees
                                              • Set ENG_Unit = (Last created unit)
                                              • Custom script: set udg_ENG_HandleId0 = GetHandleId(udg_ENG_Unit)
                                              • Отряд - Add ENG_Unit to ENG_group
                                              • Set ENG_size = (Load (Key Size) of ENG_key from ENG_hash)
                                              • Анимация - Change ENG_Unit's size to (ENG_size%, ENG_size%, ENG_size%) of its original size
                                              • Анимация - Change ENG_Unit's animation speed to (ENG_AnimationFactor x ENG_SpeedFactor)% of its original speed
                                              • Custom script: call DestroyEffect(AddSpecialEffectLoc( udg_ENG_BounceSFX, udg_TempPoint))
                                              • Хэш-таблица - Save (Facing of ENG_Unit) as (Key Angle) of ENG_HandleId0 in ENG_hash
                                              • Хэш-таблица - Save (ENG_SpeedFactor x 0.80) as (Key SpeedFactor) of ENG_HandleId0 in ENG_hash
                                              • Хэш-таблица - Save ENG_size as (Key Size) of ENG_HandleId0 in ENG_hash
                                              • -------- -*-*- --------
                                            • Иначе - Действия
                                              • -------- основные действия при двух движущихся камнях --------
                                              • -------- пикд юнит = 1-й дв. камень --------
                                              • -------- темп юнит = 2-й дв. камень --------
                              • Custom script: call RemoveLocation(udg_TempPoint)
                              • Custom script: call RemoveLocation(udg_TempPoint2)
                            • Иначе - Действия
                          • Custom script: call RemoveLocation(udg_TempPoint)
                        • Иначе - Действия
                • Custom script: call DestroyGroup(udg_TempGroup)
                • Custom script: call RemoveLocation(udg_TempPoint2)
              • Иначе - Действия
If you will see nothing here, I will convert this to English text for 6-8 hours. We are repairing our home now :D
Edit: However it looks ugly because of comments in triggers.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
I think it is working now using coordinates. this is the map :D

Anyway Nice bouncing ball :D
Btw, I've told you this 2nd times turning on the loop in the trigger is bad you should check if there is any instances by using unit group is empty == true but nevermind.. :D
 

Attachments

  • engine.w3x
    32.1 KB · Views: 39
Level 8
Joined
May 9, 2010
Messages
266
I think it is working now using coordinates. this is the map :D

Anyway Nice bouncing ball :D
Btw, I've told you this 2nd times turning on the loop in the trigger is bad you should check if there is any instances by using unit group is empty == true but nevermind.. :D

Balls should bounce apart(fromout each other or something like this, I dont know how to say this :DD).
Ofc I have also some phisycs and maths problems but firstly I need to make good moving and group checking...
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Balls should bounce apart(fromout each other or something like this, I dont know how to say this :DD).
Ofc I have also some phisycs and maths problems but firstly I need to make good moving and group checking...

I think that's weirdooo....... but dude There's no wrong using SetUnitPosition why you're keeping yourself using SetUnitX/Y? SetUnitX/Y uses coordinates and they do not disrupt orders of the unit, The SetUnitPosition sets the unit location and disrupting them like pausing them when they move. I think you can use SetUnitPosition because your dummy ball do not have taken any orders and it is working as you said when you used it so stick with that function dude but you have to remove leaks :))... Anyway you have leaks when you using coordinates because you're making them location instead of real dude :/ your doing like this.
JASS:
set someRealX = GetUnitX(unit)
set someRealY = GetUnitY(unit)
set loc = Location(someRealX,someRealY)
don't do that you must not turn them to location. you MUST do it like this
JASS:
set someRealX = GetUnitX(unit)
set someRealY = GetUnitY(unit)
set unit = CreateUnit(player,'u000',someRealX,someRealY,0.)

And I think the CheckWalkability is the problem dude..
 
Level 8
Joined
May 9, 2010
Messages
266
I think that's weirdooo....... but dude There's no wrong using SetUnitPosition why you're keeping yourself using SetUnitX/Y? SetUnitX/Y uses coordinates and they do not disrupt orders of the unit, The SetUnitPosition sets the unit location and disrupting them like pausing them when they move. I think you can use SetUnitPosition because your dummy ball do not have taken any orders and it is working as you said when you used it so stick with that function dude but you have to remove leaks :))... Anyway you have leaks when you using coordinates because you're making them location instead of real dude :/ your doing like this.
JASS:
set someRealX = GetUnitX(unit)
set someRealY = GetUnitY(unit)
set loc = Location(someRealX,someRealY)
don't do that you must not turn them to location. you MUST do it like this
JASS:
set someRealX = GetUnitX(unit)
set someRealY = GetUnitY(unit)
set unit = CreateUnit(player,'u000',someRealX,someRealY,0.)

And I think the CheckWalkability is the problem dude..

Yeah, using SetUnitPosition it works fine, but after doing ball bounce, I will add 3rd coordination and then I will need to use SetUnitX anyway. Because SetUnitPosition checks walkability and I dont need it. My units arent fly because it cause wall-bounce bugs.
About leaking and other stuff, I will repair it after system would be done :p
Edit: with this CS
JASS:
set unit = CreateUnit(player,'u000',someRealX,someRealY,0.)
it works even better, thanks :D
 
Status
Not open for further replies.
Top