• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
Level 18
Joined
Jun 2, 2009
Messages
1,276
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.
 
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)
 
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.
Back
Top