Project Zomboid

Project Zomboid

Better money system and working ATM (MP)
Xyberviri 2022 年 6 月 3 日 下午 9:00
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.
最后由 Xyberviri 编辑于; 2022 年 6 月 3 日 下午 9:12
< >
正在显示第 1 - 11 条,共 11 条留言
Aiteron  [开发者] 2022 年 6 月 4 日 上午 2:54 
Sure
Aiteron  [开发者] 2022 年 6 月 4 日 上午 6:43 
Updated ;)
Xyberviri 2022 年 6 月 4 日 上午 10:18 
OMG Dude your awesome
The Trip Doctor 2022 年 6 月 6 日 上午 6:33 
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 2022 年 6 月 25 日 上午 2:08 
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 2022 年 6 月 25 日 下午 9:09 
引用自 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.
最后由 Xyberviri 编辑于; 2022 年 6 月 25 日 下午 9:11
PAPU 2022 年 6 月 25 日 下午 9:20 
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 2022 年 7 月 23 日 下午 4:52 
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 2022 年 7 月 23 日 下午 4:54 
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 2024 年 5 月 9 日 上午 9:20 
Hello everyone! I'd like to implement this mod on my server and it's working fine: https://psteamcommunity.yuanyoumao.com/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://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2686972114
https://psteamcommunity.yuanyoumao.com/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. 😊 😊 😊 😊 😊
< >
正在显示第 1 - 11 条,共 11 条留言
每页显示数: 1530 50