You can use another variable i.e. 'cost' to replace the '1' and say Gold greater equal to Cost. Then on the right side actions AFTER you have set the damage and subtracted the gold, you set 'cost' to a value for next time, if the gold taken only increases by 1 for each level then you set 'cost' to self+1. Also remember to subtract 'cost' from Gold on the right side.

You can use another variable i.e. 'cost' to replace the '1' and say Gold greater equal to Cost. Then on the right side actions AFTER you have set the damage and subtracted the gold, you set 'cost' to a value for next time, if the gold taken only increases by 1 for each level then you set 'cost' to self+1. Also remember to subtract 'cost' from Gold on the right side.

Thanks alot i got it to work :)

Now i want make a diminishing return on the cost increase, anyone knows how to do that?

Now i want make a diminishing return on the cost increase, anyone knows how to do that?

Please explain?

-Tower upgrade cost 1g at start

-when upgraded it should scale upwards in price but with diminishing returns (so its not just multiplying itself to very high numbers)

-Im fiddling with formulas like [round((cost*0.95)+1)] but im completely new to coding and construct itself (and math apparently), so what am i doing wrong ?

Well you set cost to a value for next time and it'll be up to you to decide how it scales and what that formula is. I used self+1 so it increases by 1 each time you upgrade, the actual value will be for you to decide.

Glennroh, I think you're on the right track there, with your formula like: [round((cost*0.95)+1)]

I'd make a little table of cost and DMG points you want to hit and then come up with your formula. Test it in a spreadsheet and then code it. Maybe that's an OCD approach, but to me it's good for more complex situations and tuning sets of values.

Glennroh, I think you're on the right track there, with your formula like: [round((cost*0.95)+1)]

I'd make a little table of cost and DMG points you want to hit and then come up with your formula. Test it in a spreadsheet and then code it. Maybe that's an OCD approach, but to me it's good for more complex situations and tuning sets of values.

Good tip :)

Btw i have done it right all the way, just did the "set value" instead of "add value". But ye a table is good for balancing