Project Zomboid

Project Zomboid

Better money system and working ATM (MP)
Xyberviri 3 Jun, 2022 @ 9:00pm
Suggestions for Mod Interconnects
Hello,

It looks like all of the code that defines what is money and its value is all in client\BMSATM\Money.lua, could you move the code for your money values and global variable BMSATM to lua\client folder to lua\shared?


Specifically this top section in "BetterMoneySystem\media\lua\client\BMSATM\Money.lua"
if BMSATM == nil then BMSATM = {} end BMSATM.Money = BMSATM.Money or {} BMSATM.Money.Values = {} local moneyValues = BMSATM.Money.Values moneyValues["1Dollar"] = { v = 1 } moneyValues["2Dollar"] = { v = 2 } moneyValues["5Dollar"] = { v = 5 } moneyValues["10Dollar"] = { v = 10 } moneyValues["20Dollar"] = { v = 20 } moneyValues["50Dollar"] = { v = 50 } moneyValues["100Dollar"] = { v = 100 } moneyValues["1KDollar"] = { v = 1000 } moneyValues["2KDollar"] = { v = 2000 } moneyValues["5KDollar"] = { v = 5000 } moneyValues["10KDollar"] = { v = 10000 } moneyValues["20KDollar"] = { v = 20000 } moneyValues["50KDollar"] = { v = 50000 } moneyValues["100KDollar"] = { v = 100000 }

To: "BetterMoneySystem\media\lua\shared\BMSATM\Money.lua" ?

Then any trader mod could use this mod as a addon and we could replace the money if we use some other system.

edit: ah i just noticed you are hard coding a module in your "BMSATM.Money.ATM.withdrawalMoney" function could we switch out getType() with getFullType() which includes the module?

let me know if you need any assistance on this I would be willing to work on patching some of this if its too much of a problem because i would really like to have this as a optional add on to my own trader mod. The issue is i have gone and already modeled and added my own money stacks to my mod to get rid of players using singles (due to lag) so i have a bunch of saves/servers already using them. I also know some trader mods dont use bills in some cases so that would also allow them to work.
Last edited by Xyberviri; 3 Jun, 2022 @ 9:12pm
< >
Showing 1-11 of 11 comments
Aiteron  [developer] 4 Jun, 2022 @ 2:54am 
Sure
Aiteron  [developer] 4 Jun, 2022 @ 6:43am 
Updated ;)
Xyberviri 4 Jun, 2022 @ 10:18am 
OMG Dude your awesome
The Trip Doctor 6 Jun, 2022 @ 6:33am 
I came to ask the same thing and see that Xyberviri beat me to (go figure!), awesome mod Aiteron - going to be using the crap out of this - you're amazing!
PAPU 25 Jun, 2022 @ 2:08am 
Sir how can i convert the server local money to $. My server ingame is ex. 10 dollars how can I convert this to 10$. I'm using Simple trader mod. Thanks in advance
Xyberviri 25 Jun, 2022 @ 9:09pm 
Originally posted by PAPU:
Sir how can i convert the server local money to $. My server ingame is ex. 10 dollars how can I convert this to 10$. I'm using Simple trader mod. Thanks in advance

You put a lua file in your mod in media\lua\shared\YOURMODID_whatever.lua with something like the following:
if getActivatedMods():contains("BetterMoneySystem") then print ("MYMODID: BetterMoneySystem detected, updating money table to support MYMODNAME") if ( BMSATM and BMSATM.Money ) then print ("MYMODID: BetterMoneySystem money table found, updating") local money = BMSATM.Money or {} money.Values = {} money.Values["Base.Money"] = { v = 1 } money.Values["Base.Money100"] = { v = 100 } money.Values["Base.Money500"] = { v = 500 } money.Values["Base.Money1000"] = { v = 1000 } money.Values["Base.Money10k"] = { v = 10000 } else print ("MYMODID: unable to find BetterMoneySystem money table!") end end

Then you make sure this mod is loaded AFTER BetterMoneySystem

'Base.Money' is the full name of the item that you are using as money.
Last edited by Xyberviri; 25 Jun, 2022 @ 9:11pm
PAPU 25 Jun, 2022 @ 9:20pm 
Thanks Sir for the quick response. I'm not techies in modding but earger to learn this. I'll try my best and get back you once its done
Eroge 23 Jul, 2022 @ 4:52pm 
You are AMAZING.
One small problem though: the tooltip indicates wallet money value didnt show up in dedicated servers. The rest part works alright.
I wrote a script that allows players search wallets in zombies' loot and get random bills or get a dead cockroach with empty wallet on my server. It's tons of fun:steammocking:
Eroge 23 Jul, 2022 @ 4:54pm 
And I found ATMs are destructible by players. How do I make it invincible?
So does this mod already use vanilla base money? I have a mod that spawns vanilla money in wallets so would work the same? without any edits to this mods lua files possibly?
unStairus 9 May, 2024 @ 9:20am 
Hello everyone! I'd like to implement this mod on my server and it's working fine: https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2815816070.

However, I'm unsure how to implement money on zombies or in loot locations. I've added two mods to include them in zombie loot:

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2686972114
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2892563252&searchtext=drop+box

I tried the first one which didn't work, then the second one after removing the first. I replaced the ID with the ATM mod item and set a 100% spawn probability to test it, but unfortunately, it still doesn't work.

Based on my limited modding knowledge, I suspect there might be a conflict with one of the mods on my server. The only mods I know that modify zombie loot and are currently on my server are "Mod Snake" and "zRe Vaccine ReMod by kERHUS".

My question is, how can I make the ATM money spawn inside zombies? Or is there a way to make the ATM mod work with the vanilla Base.Money?

I apologize for the inconvenience and thank you in advance. 😊 😊 😊 😊 😊
< >
Showing 1-11 of 11 comments
Per page: 1530 50