• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Waits in Loops (I know, this isnt new)

Status
Not open for further replies.
Level 3
Joined
Dec 25, 2016
Messages
39
Hey,

So im making a map where heroes are controlled by AI (first time making trigger based AI).

I had a trigger that looked like this (of course a lot more complex)

sHhK6UZ.png


The importance of the wait command is that, if not, all heroes take actions at the exact same time. It feels weird when you are playing. They change action in the exact same moment.
As you may expect, this trigger was very very buggy.

I tried a more complex way with countdown timers that looks like this:

NXdtTxO.png

with this other trigger:

LW65GAB.png


But it kept happening the same thing (all take new actions at the same time), but more buggy

So my issue is the following:
-How to command wait lines inside a loop or simulate that

Thanks!!
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
The problem is likely that IntegerA is probably getting overwritten during the waits. You can make an integer and then use "For each integer <Variable> from _ to _ do..." instead of the generic IntegerA or IntegerB loops. This will prevent them from being overwritten by other actions.
 
Status
Not open for further replies.
Top