It is similar to the one I use for the income and it works just fine. But when I use it for the dialog so it shows the player how much income he gets the dialog doesn't work as it should. It doesn't take into consideration that divide by 2. I tried to divide each unit and that didn't work either, I tried to add the +20 at the end and that didn't work either. Somehow it doesn't want to divide the counting by 2 .
From the looks of it, the divide by 2 might only be doing ((Town count) + ((City count) + 0) / 2) and not including your villages or your income integer. Which on a quick test, you may not have a lot of towns or cities so you might not be noticing the small division that is occuring.
Your gonna want it to look more like ((((((All your variables and integers))))) / 2)
Instead of what you have which is ((((((All your variables and integers / 2))))))
With gui formula's the order in which you add the arithmetic functions is very important.
A better explanation is if you change a value to be arithmetic you get (Value1 + 1)
If you always click on the "1" part instead of the "Value1" part it will just keep expanding what is contained inside the main parentheses and using order of operations it will add up all your variables, and then in this case, do the division, but it will only divide the last part by 2, since all the variables were not inside a parentheses outside of the divide.
What I suggest is remaking the trigger. But each time you add your variables use the Value1 to expand the equation and then when your finished and want to divide it, change the last "+ 1" part to "/ 2". That should insure the division occurs last, and across the entire equation.
Well ,I can't seem to figure it out how to do it ...
The income is in a variable Wealth integer . I need to transform it into a text in order to add it to the show dialog. It is such a mess , cant seem to find where to add what.
I had a quick look; one thing is that your setting the income integer to + and then the calcuation where i believe this should be a modify variable that should never start with the sign. Also please post your code for when your actually setting the integer to the dialog as it was missed in your last posting. I would also recommend not converting between integer and real until the very very end ( you shouldn't be convert an integer to a real value inside of a integer arithmetic function).
Well.. never mind ... I am done trying to fix it .
I just made a different formula and changed the proprieties to those units. It is not exactly how I want it but it is close .
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello,
Can anyone tell me what is wrong with this formula ? http://postimage.org/image/mmoitdi1j/full/
It is similar to the one I use for the income and it works just fine. But when I use it for the dialog so it shows the player how much income he gets the dialog doesn't work as it should. It doesn't take into consideration that divide by 2. I tried to divide each unit and that didn't work either, I tried to add the +20 at the end and that didn't work either. Somehow it doesn't want to divide the counting by 2 .
Any ideas ?
Yay for gui formula mess :)
Suggestion: Save the income in a variable and let the dialog display that variable
From the looks of it, the divide by 2 might only be doing ((Town count) + ((City count) + 0) / 2) and not including your villages or your income integer. Which on a quick test, you may not have a lot of towns or cities so you might not be noticing the small division that is occuring.
Your gonna want it to look more like ((((((All your variables and integers))))) / 2)
Instead of what you have which is ((((((All your variables and integers / 2))))))
With gui formula's the order in which you add the arithmetic functions is very important. A better explanation is if you change a value to be arithmetic you get (Value1 + 1) If you always click on the "1" part instead of the "Value1" part it will just keep expanding what is contained inside the main parentheses and using order of operations it will add up all your variables, and then in this case, do the division, but it will only divide the last part by 2, since all the variables were not inside a parentheses outside of the divide.
What I suggest is remaking the trigger. But each time you add your variables use the Value1 to expand the equation and then when your finished and want to divide it, change the last "+ 1" part to "/ 2". That should insure the division occurs last, and across the entire equation.
@AstralCV: Go
Hm... this is a smaller version that only targets the village but it still doesn't take the divide by 2 into calculation .
Variable - Set DialogIncome ProvinceIncome Integer = (+ (DialogIncome ProvinceIncome Integer, (Integer((((Picked unit) Energy (Current)) / (((Village count for player (Picked player), counting Complete) / 2.0) + 20.0))))))
What is weird is that the same formula seems to work fine and generates the proper income , the problem is not showing it .
why not just have the dialog display that variable then?
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
@willuwontu: Go
Well ,I can't seem to figure it out how to do it ...
The income is in a variable Wealth integer . I need to transform it into a text in order to add it to the show dialog. It is such a mess , cant seem to find where to add what.
Here is an image: http://postimg.org/image/6u4vkezqp/full/ showing how it looks now. Let me know what, where and how to modify it to make it work ...
Any ideas ?
I had a quick look; one thing is that your setting the income integer to + and then the calcuation where i believe this should be a modify variable that should never start with the sign. Also please post your code for when your actually setting the integer to the dialog as it was missed in your last posting. I would also recommend not converting between integer and real until the very very end ( you shouldn't be convert an integer to a real value inside of a integer arithmetic function).
Well.. never mind ... I am done trying to fix it . I just made a different formula and changed the proprieties to those units. It is not exactly how I want it but it is close .