Quote
Originally posted by Musapi:
**Would it be possible to make a banking system? Say the player could buy a savings bond for say, 10,000 credits. A rank bit would give the player an interest payment of 500 credits a day. This would prevent pirates from stealing all your money.
But the problem is, outfits seem to sell for half their purchase price. Is there a bit somewhere that can make the outfit sell for full price?
**
The rank system would work well. Implement multiple ranks so that you can sell multiple values of bond.
To make bonds work, for each bond value you will require a rank, a crön, two auto-aborting missions, and one non-auto-aborting mission. One of the auto-aborting missions pays (bond purchase price) - (bond sell value) and the other pays (bond sell value). I'll call them "greater" and "lesser," respectively.
Have the bond outfit activate the rank, activate the crön with an appropriate preholdoff value, and activate the non-aborting mission. The rank pays the interest, then when the crön starts, it deactivates the rank, disposes of the bond, and aborts the mission. The mission's OnAbort set expressions activate both auto-aborting missions, thereby paying the player the full value of the bond. If the bond is sold, its OnSell expressions cause the non-aborting mission to fail. That mission's OnFail field activates only the "greater" mission, thereby refunding the player the full value of the bond.
The problem with this implementation is that (from looking at my debuglog file) it seems that a crön can have more than one iteration of itself active simultaneously. Therefore, if the player sells their bond and buys another, identical bond before the first bond's crön has terminated, then when the initial crön does its thing the player's new bond will be affected. Buying multiple bonds probably wouldn't work either, because I don't think that multiple iterations of the same rank may be active simultaneously.
--Nathan (AKA The CrönMaster)