Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Custom Workshop for Splitting Coins  (Read 942 times)

DrTank09

  • Bay Watcher
    • View Profile
Custom Workshop for Splitting Coins
« on: January 07, 2017, 09:12:36 pm »

Hey guys, I decided to try my hand at adding a raw mod for a workshop that takes coins of any material and splits the stacks.  I thought I had everything in the right places but even after regenerating the world, the workshop doesn't show up in the build menu.  Can anyone help me to see why?

Code edit 08-01-2017 16:38

EDIT: first issue has been taken care of but now the coins just disappear.
EDIT 2: coins now come out as a product, but it auto stacks the units back to 500, going to attempt to create a new item that isn't a coin.
EDIT 3: urists are the currency, but now the coins just disappear without a product.
EDIT 4: Code works, urists are individual coins now.

The next task is to create a reaction that moves the coins to and from each other with a set amount.  If a dwarf is getting paid 100 urists for his or her work, we should be able to do a quick reaction for "Receive 6 Gold URISTS"  and another reaction for "Receive 2 Silver Urists"

URISTS do not have the correct monetary value, so they will be made to be 0 so as not to be exploitable.
Urists will be transported as coins and split into tools inside the vault and stored on a qsp.  all stockpiles must be linked and set to take and give with links only.

so coin stack of 500 goes to vault, vault then turns these coins into 500 gold urists.  those gold urists stay inside the vault.  When a unit is paying using urists, the unit creates a new stack of coins from the vault where no transportation must be done, then that coinstack gets transported to a linked qsp, and those then get transported to the appropriate vault.

Edit:5 Completed, everything works as intended.

Hey guys, the original post here http://www.bay12forums.com/smf/index.php?topic=162064.0 let me to create a mod for a building that allows us to use a form of currency.

What it does is add a building known as the "Counting Table"
Mint coins at a forge like normal, then dump those coins into a stockpile that gives to the first Counting Table.
Count Coins at the Counting Table to turn them into Urists of whatever coin metal is being used.  Urists can only be made from Coins that are copper, silver, or gold.
Urists are now tools.  Create a stockpile to receive tools from the Counting Table.
This tools stockpile should now take from the first stockpile and give to a second Counting Table.

From here the second counting table can do one of two things.  It can exchange copper Urists for silver or gold and silver for copper and gold, etc.
To do this, create a third stockpile that is dedicated to receiving tools from the second Counting Table and giving to the Second Stockpile
Or it can turn Urists back into coins at a set count for payments.  "Trasfer 10 Gold" takes 10 gold urists and turns them into 10 gold coins.
Create a 4th stockpile for coins set to take from the second Counting Table.  Now if this dwarf owes another dwarf 21 Urists, he or she can use the following commands.
Transfer 1 Gold
Transfer 1 Silver
Transfer 1 Copper

this will put the currency equivalent of 26 Dwarfbucks(Urists) into the stockpile.  Now this stockpile can be set to give to any other stockpile at any given time, usually after payment preparation is complete.  Then delete the stockpile and set it back up.

All stockpiles should be Quantum and set to take from links only.

Here is the code if you would like to use it.

reaction
Spoiler (click to show/hide)

URISTS
Spoiler (click to show/hide)

Counting Table
Spoiler (click to show/hide)

entity file additions
Spoiler (click to show/hide)

Final Edit:

I forgot to mention that I added the [REACTION_CLASS:COIN_METAL] tag to silver, gold, and copper.

« Last Edit: January 10, 2017, 12:07:55 am by DrTank09 »
Logged

Nahere

  • Bay Watcher
    • View Profile
Re: Custom Workshop for Splitting Coins
« Reply #1 on: January 08, 2017, 02:27:29 am »

Do your new files have the correct headers? For example:
Code: [Select]
building_custom vault

[OBJECT:BUILDING]
Logged

DrTank09

  • Bay Watcher
    • View Profile
Re: Custom Workshop for Splitting Coins
« Reply #2 on: January 08, 2017, 04:37:31 am »

Thank you, that put me on the right track, now I need to figure out what is going on with the reagent so that I get coins,  currently, the coins disappear.

I'm not sure if I'm getting the product information correct.  they will correctly take a stack of 500 coins to the vault and count them, but once the reaction is complete, the whole stack of 500 disappears.

anyone know what might be causing this?  that or where the raw information for the metalsmith's forge is so that I can see coin products from minting them?
« Last Edit: January 08, 2017, 04:51:48 am by DrTank09 »
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Custom Workshop for Splitting Coins
« Reply #3 on: January 08, 2017, 01:32:38 pm »

Thank you, that put me on the right track, now I need to figure out what is going on with the reagent so that I get coins,  currently, the coins disappear.

Your PRODUCT definition is incorrect, trying to grab a material from a nonexistent reagent.

Code: [Select]
   [REAGENT:A:1:COIN:NONE:METAL:NONE]
   [PRODUCT:100:1:COIN:NONE:GET_MATERIAL_FROM_REAGENT:reagent:NONE]
should be
Code: [Select]
   [REAGENT:A:1:COIN:NONE:NONE:NONE]
   [PRODUCT:100:1:COIN:NONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

DrTank09

  • Bay Watcher
    • View Profile
Re: Custom Workshop for Splitting Coins
« Reply #4 on: January 08, 2017, 04:37:19 pm »

Thank you, that did the trick, but unfortunately the coins get auto stacked back out to 500, so now I'm going to make up a new item called URISTs and see if we can make it so that these get de-stacked.

new code

reaction
Spoiler (click to show/hide)

URISTS
Spoiler (click to show/hide)

Vault
Spoiler (click to show/hide)

entity file additions
Spoiler (click to show/hide)

we are back to the issue that the coins disappear and do not transform.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Custom Workshop for Splitting Coins
« Reply #5 on: January 08, 2017, 08:41:21 pm »

we are back to the issue that the coins disappear and do not transform.
Two problems:
1. You broke the reaction again - your reagent is named "A", but your product references a reagent named "metal".
2. Your "urists" item defines an illegal MATERIAL_SIZE of ".002" - material sizes must be integers.

Try taking a look at "errorlog.txt".
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

DrTank09

  • Bay Watcher
    • View Profile
Re: Custom Workshop for Splitting Coins
« Reply #6 on: January 08, 2017, 09:53:18 pm »

do the values of items have to be integers as well?

EDIT: the errorlog.txt has nothing from these instances in it.  All instances are from me actually playing and not from me testing this out.
« Last Edit: January 08, 2017, 10:12:53 pm by DrTank09 »
Logged

DrTank09

  • Bay Watcher
    • View Profile
Re: Custom Workshop for Splitting Coins
« Reply #7 on: January 09, 2017, 06:13:02 am »

Nevermind, modifcations complete.
Logged