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

Status
Not open for further replies.
Level 14
Joined
Aug 23, 2013
Messages
285
It's like this:
Begin Loop
Condition Loop: RunTheTriggerInLoop = 1
Pick a random level creep
If creep have ability A. It's picked. if not, Remove it
Continues until the specific number picked it's change Conditions RunTheTriggerInLoop = 0
if the trigger only run about 1000 time. the number creep is not fulfil the specific yet.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
the problem you have is the OP Limit, its because you can only do so many operation before your running "thread" crashes

You can only loop about 25000 times while increasing 1 int variable, if you call functions this number decreases drastically.

As jakeZinc suggested use periodic timer
 
Level 14
Joined
Aug 23, 2013
Messages
285
what is groups for. i has nearly 200 custom creep units :V
U mean every 0.04 sec it will run trigger one time? nah. i make a another trigger that if there is no creep in the room 0.5s. it will kick the hero out and allow to build the item training room.
This problem can solve by change every NORMAL creep race into another race. only custom have CREEP race. ( but this shit that so much time cause every time you change a unit race it's load about 4 -> 5 sec )
Well, the if the loop act 25000 time then the weak pc got lag?
 
It depends on the action really, but with 25000, most weak-moderate computers will have a short freeze (and chances are you'll hit the op limit unless you are doing something incredibly inexpensive op-wise).

In general, if you have to loop 25k times then you are doing something wrong. ;) If you think that you will have 25k creeps, then just think for a moment how much the number 25,000 really is.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
well. then i must change all the normal creep race into other. And, about 1000 time. does it cause a little lag?
I was plan use something like this
For A integer from 1 To X Time
If trigger run right - do nothing
If trigger run wrong - X = X + 1

But it's not working.

Make a periodic trigger then create a condition boolean inside the trigger. Make this condition If YOUR_TRIGGER is on equal to ( == ) true then Do nothing, else increase the integer by 1.
 
Status
Not open for further replies.
Top