So I made a trigger that basically gives each player an amount of minerals based on how many units they have killed. The problem is that either the math is wrong or the game is incorrectly calculating it afaik. I'm using a formula. (x / 5 * 25). I tried to do it in the player properties action but it didn't work there. I know I'm setting the kills right - I made another trigger to check the amount of kills the player has and it returns the value it should. (10) I changed it so that it does the formula in a variable and then I add the variable to the properties action but that doesn't seem to work either.
Unless I fail at math then 10 / 5 * 25 should = 50. The game is ginving me 0 minerals... Here is my trigger(minus the irrelevant stuff):
For a start, 10 / 5 * 25 = 0.08 as in math, * is done before /. And also in your formula you have a bracket so it definitely does 5 * 25 first = 125 then 10 / 125 = 0.08. Therefore you are adding a value less than one. You probably also have the minerals adding a integer value as wave Kills[1] is propably an integer array so therefore it is rounding it down to 0. So if you want 50, do ((Wave Kills[1] / 5) * 25). Or actually, dont even bother having that as you can just put * 5 if thats what you want as 25/5 = 5. Saves unnecessary maths.
For a start, 10 / 5 * 25 = 0.08 as in math, * is done before /. And also in your formula you have a bracket so it definitely does 5 * 25 first = 125 then 10 / 125 = 0.08. Therefore you are adding a value less than one. You probably also have the minerals adding a integer value as wave Kills[1] is propably an integer array so therefore it is rounding it down to 0. So if you want 50, do ((Wave Kills[1] / 5) * 25). Or actually, dont even bother having that as you can just put * 5 if thats what you want as 25/5 = 5. Saves unnecessary maths.
So I made a trigger that basically gives each player an amount of minerals based on how many units they have killed. The problem is that either the math is wrong or the game is incorrectly calculating it afaik. I'm using a formula. (x / 5 * 25). I tried to do it in the player properties action but it didn't work there. I know I'm setting the kills right - I made another trigger to check the amount of kills the player has and it returns the value it should. (10) I changed it so that it does the formula in a variable and then I add the variable to the properties action but that doesn't seem to work either.
Unless I fail at math then 10 / 5 * 25 should = 50. The game is ginving me 0 minerals... Here is my trigger(minus the irrelevant stuff):
I'm using a 'run trigger' for it btw.
@ST4RKiLL3R: Go
For a start, 10 / 5 * 25 = 0.08 as in math, * is done before /. And also in your formula you have a bracket so it definitely does 5 * 25 first = 125 then 10 / 125 = 0.08. Therefore you are adding a value less than one. You probably also have the minerals adding a integer value as wave Kills[1] is propably an integer array so therefore it is rounding it down to 0. So if you want 50, do ((Wave Kills[1] / 5) * 25). Or actually, dont even bother having that as you can just put * 5 if thats what you want as 25/5 = 5. Saves unnecessary maths.
Hope that helps
Zeragon
:D Thanks.