New game - code advice regarding Wealth/Currency

@CJW

Not sure I understand that code, but if it works, it is much shorter than the roundabout I wrote.

I’ll look at it with fresh eyes tomorrow, it is almost 1 in the night here.

If you scroll up, I have my code in an earlier comment.
in the code, just look for:
*label wealth_regulater
*label converter_1
*label converter_2

Thank you very much for the input, it is really a great place for help =)

@dinosw

That code is actually wrong, I must’ve copied and pasted the wrong one (I had several iterations going), this is the right code:


*temp gold 1
*temp silver 1523
*temp bronze 112

*set silver (silver + ((bronze - (bronze modulo 100)) / 100))
*set gold (gold + ((silver - (silver modulo 100)) / 100))
*set silver (silver modulo 100)
*set bronze (bronze modulo 100)

You have: ${gold} gold, ${silver} silver, ${bronze} bronze

You probably don’t really need to understand it, but those *set four lines will basically convert any excess bronze coins (over 99) into silvers, and excess silvers into gold.
The other lines are just variable definitions and a quick display, for example purposes.

In that example it’ll turn:

Gold: 1
Silver: 1523
Bronze: 112

into

Gold: 16
Silver: 24
Bronze: 12

Copy and paste all that into here, if you want to see it working.

You basically just slap those four lines in anytime you want to sort ‘top-heavy’ currencies.

1 Like

I’ll certainly give it a go =) thank you @CJW