Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vending Machines can optionally use your Bank Balance #79442

Conversation

QuillInkwell
Copy link
Contributor

@QuillInkwell QuillInkwell commented Jan 31, 2025

Summary

Infrastructure "Vending Machines can optionally use your Bank Balance"

Purpose of change

Vending machines are in kind of an awkward place in Aftershock. I know it's not a huge issue but I find it annoying I can trade everything with my bank balance except vending machines. So after I have deposited my funds, gone around the station buying my gear, I have to go back to the ATM and withdraw some money on my card so I can hit the vending machines.

It's especially frustrating because vending machines are the only thing that call for a cash card. If it weren't for them you could keep all your money in your bank and never hold a cash card or chit again.

Describe the solution

Add a new flag BANK_NETWORKED, Vending machines that have this flag allow you to pay with your bank balance. As well as your cash cards. Add two new Vending machines that use this flag. One for reinforced and one for non-reinforced. (Powered down and broken left deliberately left out) Finally added a new JSON property to vending machines that allows you to place them as networked during mapgen. (Currently this only does anything if they are also powered)

All Aftershock Vending machines have been converted to the new networked variant. Ending the tyranny of the cash card ushering forth the true digital currency the setting promises. Enjoy of the convenience of not having to run back to the ATM every time you need to get some munchies or ammo from the station vending machine. And never get kicked out of buying from vending machines because you forgot to load your cash card before going planet side.

Describe alternatives you've considered

Leaving the Vending Machines as they are. I originally tried to make all Vending Machines in Aftershock use this system. But this was changed to the current flag based approach.

This really opens the door to not having cash cards or chits at all since all trading could be done with your bank account. Well I mean it might be prudent to use the EFILE system to make it possible to still find cash on people or as loot. Maybe the chits could become digital notations only found on electronics and such. And be removed trader inventories since you can just have them credit your bank account directly anyway. (Found that out recently.)

Although that would invoke further weirdness of having money you can't exactly use until you get to an ATM. Which makes me sad. So maybe the real solution is some kind of item use action. Something to hack an electronic and get cash within a per item defined min and max amount if you succeed. Then we could still let you find money as loot without needing for it to ever be an item. Combo that with allowing professions to define starting bank balance and the cash card could be done away with entirely I think. Or maybe I'm just crazy.

If that sounds good I'd be down to try making it happen.

Testing

Went onto the station. Deposited the cash card into my bank. Tested buying items from vending machines deducts from my Character's bank account. Confirmed cannot buy without any money in my bank account. Created a vanilla world. Realized I had to spawn a powered on vending machine since those just don't exist anymore. Tested it, vanilla vending machines still use cash cards.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Mods Issues related to mods or modding json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Jan 31, 2025
src/iexamine.cpp Outdated Show resolved Hide resolved
@RenechCDDA
Copy link
Member

RenechCDDA commented Jan 31, 2025

Note also that new characters start with a randomized bank balance, including a balance that could be negative(!)

cash = rng( -200000, 200000 );

Unsure if Aftershock wants to do something about that, but just figured I'd mention it.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 31, 2025
@QuillInkwell
Copy link
Contributor Author

QuillInkwell commented Jan 31, 2025

I can see where you're coming from. I was locked into thinking let's just get rid of cash cards. So I wrote the code to basically ignore them entirely. However strictly speaking that is not at all necessary since it can easily do both.
So I have re-written it to favor using cash cards first and then begin using your balance.

I admit it behaves a bit weird if you started with negative balance, not broken weird since it is safeguarded from making transactions you cant afford to make. But awkward since it won't let you buy things if your account is negative by an amount equal or greater to the amount on your card.

But the same awkwardness I think would be true of trading with NPCs from your bank balance. So really we'd want to just set players to never spawn with negative balance. Which I think we can do. Just not in this PR. I'd like to make it so you can set your starting cash in a profession maybe. And then we wouldn't even need to give players a cash card at the start.

@Maleclypse
Copy link
Member

Can we set certain factions to not use bank balance for trading in aftershock? I'd like for the prepnet to only do cash cards instead of direct balance transactions. Doesn't need to be addressed in this PR but neo-luddites need to be ludditing against something specifically and bank balance seems like a fair one.

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [Markdown] Markdown issues and PRs Mods: Aftershock Anything to do with the Aftershock mod labels Feb 1, 2025
@QuillInkwell
Copy link
Contributor Author

Can we set certain factions to not use bank balance for trading in aftershock? I'd like for the prepnet to only do cash cards instead of direct balance transactions. Doesn't need to be addressed in this PR but neo-luddites need to be ludditing against something specifically and bank balance seems like a fair one.

This required a bit of reworking but I've got it figured out now:
Instead of applying it universally to all vending machines in Aftershock, it now works on a per machine basis. If you set a machine as networked during mapgen then that machine will allow payments from your bank balance. This option is off by default, so all base game machines spawn as un-networked.

That should allow both behaviors to co-exist within Aftershock and PrepNet can go on ludditing against the system to their hearts content.

@QuillInkwell QuillInkwell changed the title [Aftershock] Vending Machines in Aftershock use your Bank Balance Vending Machines can optionally use your Bank Balance Feb 1, 2025
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 1, 2025
@github-actions github-actions bot added Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 1, 2025
@GuardianDll GuardianDll merged commit 68cdd03 into CleverRaven:master Feb 1, 2025
28 checks passed
@QuillInkwell QuillInkwell deleted the aftershock_vending_machines_use_bank branch February 3, 2025 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style <Documentation> Design documents, internal info, guides and help. Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs Mods: Aftershock Anything to do with the Aftershock mod Mods Issues related to mods or modding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants