• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

a Simple Wc3 math

Status
Not open for further replies.
Level 7
Joined
May 18, 2010
Messages
264
  • Income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Add (100 / (IncomeFoodFarm[(Integer A)] x (Random integer number between 60 and 140))) to Players[(Integer A)] Current gold
Hy guys.
the Math here (100/(income x random100)
Does it do 100/
or X random number First?
Since its / x - +
i want it to do income x random60-140 / 100
 
  • Income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Do Multiple Actions For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Add ((IncomeFoodFarm[(Integer A)] x (Random integer number between 60 and 140 / 100)))) to Players[(Integer A)] Current gold
cause it happens in separate measures. in this trigger they will compute the 2nd condition first and the answer to it will be multiplied to the income. correct me if im wrong but I think this is the right trigger.

while in your trigger they will divide the income by 100 then multiply it to the random integer.
 

Beware that integers can cause this to malfunction. For example x*(y/z) will produce zero if z > y.

For example, 50/100 = 0. 150/100 would be 1.

mhm intresting
  • Income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Set TimeCounter[1] = 60
      • Set TimeCounter[2] = (Random integer number between 60 and 140)
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Player - Add IncomeMeatFarm[(Integer A)] to Players[(Integer A)] Current gold
            • Player - Add IncomeLumberFarm[(Integer A)] to Players[(Integer A)] Current lumber
            • Set TimeCounter[2] = (100 / (IncomeFoodFarm[(Integer A)] x (Random integer number between 60 and 140)))
            • Player - Add TimeCounter[2] to Players[(Integer A)] Current gold
            • Game - Display to (Player group((Player((Integer A))))) the text: ((String(IncomeMeatFarm[(Integer A)])) + ( + + ((String(TimeCounter[2])) + ( gold, + ((String(IncomeLumberFarm[(Integer A)])) + lumber Gained)))))
The Set TimeCounter[2]
is alwais 0 until income gets 100+
as i sayd i need
(Income x 60-140) / 100
first X then /

  • Income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Set TimeCounter[1] = 60
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Player - Add IncomeMeatFarm[(Integer A)] to Players[(Integer A)] Current gold
            • Player - Add IncomeLumberFarm[(Integer A)] to Players[(Integer A)] Current lumber
            • Set TimeCounter[3] = (IncomeFoodFarm[(Integer A)] x (Random integer number between 60 and 140))
            • Set TimeCounter[2] = (TimeCounter[3] / 100)
            • Player - Add TimeCounter[2] to Players[(Integer A)] Current gold
            • Game - Display to (Player group((Player((Integer A))))) the text: ((String(IncomeMeatFarm[(Integer A)])) + ( + + ((String(TimeCounter[2])) + ( gold, + ((String(IncomeLumberFarm[(Integer A)])) + lumber Gained)))))
i just made 2 Variables...
aniway thx on help
 
Status
Not open for further replies.
Back
Top