• 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!

HELP REMOVING LAG on PICK UNIT ATTACK ORDER

Status
Not open for further replies.
Level 8
Joined
Nov 22, 2004
Messages
192
Hi! I have looked up that issue and it has been experienced before, yet I have found no solution googling it on forums.

So here is my trigger in text copy. The PROBLEm is I cannot delay the order on ppicked unit as it does nothing. I tried about every combination I could think of and the only way the order is recognized is as so. If I put my attack to lower the lag after a wait time, there is no response and nothing happens, the units just stay there. But by ordering the attack move order just after picking a unit gourp is extremely demanding and there is a small lag like a hick up that slows down the play and is annoying, So here is what the trigger looks like now.

Set UnitGroup01 = (Units owned by Player 8 (Pink))

Unit Group - Pick every unit in UnitGroup01 and do (Actions)

Loop - Actions

Set PickedUnit01 = (Picked unit)

Unit - Order PickedUnit01 to Attack (Random unit from (Units in (Playable map area)(((Race of (Matching unit)) Not equal to Human) and ((((Owner of (Matching unit)) controller) Not equal to Passive) and (((Matching unit) is A structure) Equal to False)))))

Wait 5.00 seconds

Custom script: call DestroyGroup(udg_UnitGroup01)
 
You shouldn't use waits in loops. To make it actually work properly requires a local variable which is a JASS thing.

As for why it's laggy, it's probably because of the "Random unit from Units in Playable Map Area" part. Every iteration of the loop, you're making a new unit group out of every unit in the map. Why don't you make this unit group at the start (call it UnitGroup02 or something)? Then you can pick a random unit from it inside the loop.
 
You shouldn't use waits in loops. To make it actually work properly requires a local variable which is a JASS thing.

As for why it's laggy, it's probably because of the "Random unit from Units in Playable Map Area" part. Every iteration of the loop, you're making a new unit group out of every unit in the map. Why don't you make this unit group at the start (call it UnitGroup02 or something)? Then you can pick a random unit from it inside the loop.
OK wait ignore my previous post (I deleted it LOL). I will retry... I think it will work I had forgotten a copy past run trigger... I will retry. It might just work.
 
You shouldn't use waits in loops. To make it actually work properly requires a local variable which is a JASS thing.

As for why it's laggy, it's probably because of the "Random unit from Units in Playable Map Area" part. Every iteration of the loop, you're making a new unit group out of every unit in the map. Why don't you make this unit group at the start (call it UnitGroup02 or something)? Then you can pick a random unit from it inside the loop.
OK it works. Thanks twice for your help!
 
you could cast a spell on the unit like fire fly, which makes them want to attack naturally

using a trigger you can add the buff and point out a culprit for the victim to target
 
Status
Not open for further replies.
Back
Top