what problem in this gui?

takethat

Active Member
Reaction score
12
i am trying to make a skill that will tell you how many (specific) unit infront of the casting unit. but this gui will still pick every unit in that range.


Trigger:
  • test01
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) == Test call
    • Actions
      • Set TempPoint1 = (Position of (Triggering unit))
      • Set TempGroup1 = (Units within 1000.00 of TempPoint1 matching ((Unit-type of (Matching unit)) == Footman))
      • Set TempInt = (Number of units in TempGroup1)
      • For each (Integer A) from 1 to TempInt, do (Actions)
        • Loop - Actions
          • Set TempUnit1 = (First unit of TempGroup1)
          • Set TempPoint2 = (Position of TempUnit1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Angle from TempPoint1 to TempPoint2) <= 10.00
                  • (Angle from TempPoint1 to TempPoint2) >= 170.00
            • Then - Actions
              • Unit Group - Remove TempUnit1 from TempGroup1
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint2)
      • Game - Display to (All players) the text: (String((Number of units in TempGroup1)))
      • Custom script: call DestroyGroup(udg_TempGroup1)
      • Custom script: call RemoveLocation(udg_TempPoint1)
 

kaboo

New Member
Reaction score
45
1. havent you placed only footmans to your map ?¨
2. to remove the units that are not in front of caster u use conditions angle <=10 AND angle >=170 , think about it a little and tell me how can an angle be less than 11 and greater than 169 in the same time?
 

takethat

Active Member
Reaction score
12
kaboo:
i put various type of unit, but it wil only count the number of footman.

an angle ofcoz can not be less than 11 and greater than 169 in the same time
u probably miss out this part

Trigger:
  • Or - Any (Conditions) are true
    • Conditions
    • (Angle from TempPoint1 to TempPoint2) &lt;= 10.00
    • (Angle from TempPoint1 to TempPoint2) &gt;= 170.00


see the Or?
 

kaboo

New Member
Reaction score
45
ouch, havent seen that .)
but now i think i see the problem:
for each integerA from 1 to tempint do actions
tempunit1=first unit from temp group

and if this unit is in front of the caster it will be the first for all "integers A"
 
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