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

Math - Something for every 5th time?

Status
Not open for further replies.
Level 2
Joined
Jan 4, 2017
Messages
10
Is there a mathematical way I can set a trigger to activate so that every 5th time a unit checks into a building/region, something will happen, like extra gold? I'm tired of typing out the "if condition" for every 5th time :p
 
Under Category Math for Integer/Real there is that allready implemented with the Function: mod.
  • (visits mod 5) Equal 0
You'll have to count the Visits or you use the Trigger execution count.
  • ((Execution count of (This trigger)) mod 5) Equal 0
Modulus gives you the rest of simple division.
example
5/2 =2 R 1 -> Mod of 5 & 2 = 1
 
Last edited:
Status
Not open for further replies.
Top