[Solved] How to set TempLoc as position of unit?

Status
Not open for further replies.
Level 18
Joined
Jun 2, 2009
Messages
1,233
Hello everyone. This is my trigger. It is working.

  • Then - Actions
    • Set TempPoint = (Position of (Picked unit))
    • Set TempGroup = (Units within 1000.00 of TempPoint matching ((((Matching unit) is in HerolarALL) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True)))
    • Custom script: call RemoveLocation (udg_TempPoint)
    • Unit - Order (Picked unit) to Human Archmage - Blizzard (Position of (Random unit from TempGroup))
Before we get the question let me ask you. Is this a proper trigger?

If yes, thank you. My problem is solved.

If no, check the bottom.

  • Then - Actions
    • Set TempPoint = (Position of (Picked unit))
    • Set TempGroup = (Units within 1000.00 of TempPoint matching ((((Matching unit) is in HerolarALL) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True)))
    • Custom script: call RemoveLocation (udg_TempPoint)
    • Set TempPoint = (Position of (Matching unit))
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • Unit - Order zU_AIHero[(Integer A)] to Human Archmage - Blizzard TempPoint
After i set TempPoint = The hero i want to cast spell i am removing TempPoint
But after i do that, i am using TempPoint again but this time position
I cannot set TempPoint = Position of (Matching unit) why?
This is why because of many units can be picked?
Or we cannot use matching unit outside of the conditions? (probably this one true)

And if i did correctly (i mean my first trigger) is there any downside of my system?
This is my AI system for my map.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Is this a proper trigger?
Almost.
  • Then - Actions
    • Set TempPoint = (Position of (Picked unit))
    • Set TempGroup = (Units within 1000.00 of TempPoint matching ((((Matching unit) is in HerolarALL) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True)))
    • Set TempPoint2 = (Position of (Random unit from TempGroup))
    • Unit - Order (Picked unit) to Human Archmage - Blizzard TempPoint2
    • Custom script: call RemoveLocation (udg_TempPoint)
    • Custom script: call RemoveLocation (udg_TempPoint2)
    • Custom script: call DestroyGroup(udg_TempGroup)
 
Level 25
Joined
Mar 29, 2020
Messages
1,466
Is this a full trigger or only a small piece of one? I'm assuming this isn't the whole thing, bc you never picked a unit that you refer to as "picked unit". in general the variable "picked unit" is for when you are looping through a unit group or something that uses the wording - "pick every unit in x and do..." - so then picked unit is the unit you are currently iterating.

similarly there is no "matching unit" set the second time you set tempoint. you used "matching unit" correctly in the line where you define tempgroup.

what exactly are you trying to do?
 
Status
Not open for further replies.
Top