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

Looped Conditions

Status
Not open for further replies.
Level 18
Joined
Jan 24, 2006
Messages
1,938
Is there any way to loop conditions? I need to as I'm doing something like this:

  • String Checker
  • PL[1] Equal to L[64]
  • PL[2] Equal to L[65]
  • PL[3] Equal to L[66]
  • PL[4] Equal to L[61]
Where PL an L are string variable arrays and I've set each PL to a letter in a string - a string that can be of variable length, so I don't what PL[#] it needs to go to.
 

ventuz

V

ventuz

This is another way to do the loop. This one is example of loop 10 times.

  • loop
    • Events
    • Conditions
      • intvar Not equal to 10
    • Actions
      • Set intvar = (intvar + 1)
      • -------- your repeating action here --------
      • Trigger - Run (This trigger) (checking conditions)
 
Level 13
Joined
Jun 22, 2004
Messages
783
You know that will make the trigger run 10 times in about 0.01 second?
Thats not very healty for thou game.
Make a periodic timer instead and don't re-run the trigger, or if you re-run it, place a wait command, but those are not really precious (like periodic timers are), so if waits have little amounts I would suggest using a periodic timer
 
Level 6
Joined
May 19, 2004
Messages
267
wait doesnt go below 0.3 (or something like that)
and also it is very inaccurate (wait 0.3sec on player 1's comp might be 0.5 while on player 2's it's 2sec
 
Level 7
Joined
Nov 12, 2005
Messages
299
wait doesn't go below 0.1. periodic event can technically go extremely low (if you put it to 0 it will run every 0.000001 seconds or so), but anything lower than 0.02-0.05 is not recommended for multiplayer even if you fix all of the memory leaks.
 
Status
Not open for further replies.
Top