Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Percents help!

12 years ago

Really sorry for spamming the help section but I have yet another question. I am having problem with percents. You see in my game I want it so that when you click on a link your empire's population increases by 127%. I tried doing it the easy way with variables but the population still stayed the same when I clicked the link. I tried doing it the hard way in scripting but no effect either. 

IF %YEAR >-1600 THEN
%POPULATION := %POPULATION * 127 / 100
 
I couldn't figure out how to make percents in scripts so I just went with plan B. So if anyone has any tips for what I should do it would really make my day (and my game) thank you.

Percents help!

12 years ago

You can use scripts just like you have there. The problem you are having might be setting your logic around negative values. Remember that when you subtract a negative, it adds a positive. And something like -1500 is greater than -1600, while -1700 is less than -1600...

Percents help!

12 years ago

Well you helped me but not intentionally :P The thing was you started in the year 3000 B.C then worked your way to modern times. So I made it so that the population only increases when you are higher than -1600 not lower. So in other words I would have had to wait until 1600 B.C or less for my population to grow from 150 xD Thank you Berk if it not for your knowledge if negatives and positives I would have never solved this mystery :)