• 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] Am i doing it right?

Status
Not open for further replies.
  • Set TorchHas = (Units in (Playable map area) matching ((Item carried by (Matching unit) of type Torch) Equal to (Item carried by (Matching unit) in slot Torch)))
The above should be:
  • Set TorchHas = (Units in (Playable map area) matching ((Item-type of (Item carried by (Matching unit) in slot (IntegerA)) Equal to Torch)

  • Unit Group - Add all units of TorchHas to TorchGroup
You don't need this. Just make the Unit Group pick action with the TorchHas group.

  • Custom script: call DestroyGroup(udg_TorchGroup)
When you add units from a unit group to another, like in your case, from TorchHas to TorchGroup, you don't need to destory the latter group, because it doesn't leak. It will only leak once you set the variable, e.g. Set TempGroup = (Units in ...)

After that line, everything seems to be a mess.

I would instead create one unit, once, and move it periodically, up to the item carrier's position:
  • Set Points[1] = (Position of (Picked unit))
  • Set Dummy = (Load (Key(dummy)) of (Key(Picked unit)) from Hashtable)
  • Set Points[2] = (Points[1] offset by 150.00 towards (Facing of (Picked unit)))
  • Unit - Move Dummt at Points[2]
  • Custom script: call RemoveLocation (udg_Points[1])
  • Custom script: call RemoveLocation (udg_Points[2])
 
Status
Not open for further replies.
Top