PDA

View Full Version : Table generated Parcels and custom money...



lamorric
February 4th, 2021, 20:42
Using a table to randomly generate a parcel, is there a way to get a custom money (Nuyen, Pesos, Lira, etc.) to appear in the currency section of the Parcel?

Zacchaeus
February 4th, 2021, 21:07
Yes. Click on Options and then on currencies and change the currencies there. Now your parcels will show whatever you have entered there

lamorric
February 4th, 2021, 21:24
Awesome, thx!

lamorric
February 5th, 2021, 19:14
Follow up question...

If I wanted my extension to add these new currencies, what is the best way to do this?

I tried using the GameSystem.currencies = { ... } in an onInit(), like how Trenloe added languages in his Fantasy Languages Extension, but that didn't work.

I was able to get it to work by doing DB.createChild under currencies list node, then using DB.setValue to set that child's value, and then calling CurrencyManager.refreshCampaignCurrencies(). That all seemed a bit clunky, and I thought I might have missed a better more best practice way of doing it.

Moon Wizard
February 5th, 2021, 23:58
It's probably just easier to manually add the currencies to the campaign when you need them...

The problem you'll run into with modifying the GameSystem.currencies is that it is only used once to populate the campaign currency list with the game system default currencies; then never used again. You'd have to have any extension you write check whether the currency list is already set up or not. If not set up, then insert into GameSystem.currencies; otherwise if already set up, then check the current currency list, and add the new ones if not there.

Regards,
JPG