• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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