Project Zomboid

Project Zomboid

[B41 MP only] bikinitools: Server Edition - new vehicle ownership submod out!
Lacky 2023 年 5 月 18 日 上午 10:54
Issues with setting up shop prices
Hey, I have basically no experience coding and was trying my hand at the shop prices. I've basically copied the examples in the "ValuesAndPrices" file with Canned Corn as a test item to buy. But I can't get it working, any chance you could tell me where I'm going wrong?

{
title = "CannedCorn",
id = "Base.CannedCorn",
prices = {
["cash_primary"] = 5,
},
amount = 1,
},

I just copy and pasted the "Stack of money" option above and changed values, it also won't allow me to purchase "Money" from vending machines either which I assumed would work as its the main example.

Any help would be appreciated.

As a side note I'm also experiencing errors when right clicking any vending machine or using /pricelist in a vehicle shop zone.
< >
正在显示第 1 - 8 条,共 8 条留言
Lacky 2023 年 5 月 18 日 上午 10:57 
I can post either or both error logs if you'd like to see them.
最后由 Lacky 编辑于; 2023 年 5 月 18 日 上午 10:58
bikinihorst  [开发者] 2023 年 5 月 18 日 上午 11:27 
getting errors when interacting with the pricelist and shop and not getting anything out of them means a very good chance that you have a formatting error in your pricelist. check all the commas and brackets first. the example in itself works 100% so check what you wrote in the file, especially the commas.
Lacky 2023 年 5 月 18 日 下午 1:24 
Thanks for the quick reply, I've just tested uploading the unedited version of the "ValuesAndPrices" file. Much like before I am unable to purchase 'Money' from vending machines and right clicking then still returns an error, the same can be said for /pricelist.

The commas and brackets seem fine in both the default example file (Which still returns errors) and my edited version. I'm not quite sure what I'm doing wrong.
Lacky 2023 年 5 月 18 日 下午 2:51 
Well, I seem to have it in a working state currently. Thanks for the help regardless.
Lacky 2023 年 5 月 18 日 下午 3:59 
The only issue that seems to persist is the vehicle shop, It's almost certainly just me misunderstanding how to set it up.

If I set a vending machine up outside It'll tell me "You are not in a vehicle shop area." if I define the area as a vehicle shop area using the sandbox options then right clicking the vending machine results in an error and no new options.
bikinihorst  [开发者] 2023 年 5 月 19 日 上午 1:09 
i was asleep.

i can assure you the shop file in its usual state, freshly taken from the example, works 100% - i tested it after your report.

as for the errors you posted and deleted: they both relate to malformed shop coordinates in the sandbox settings instead of a malformed price list.

the shop area has to be set up with 2 coordinates and they have to be written like this: a;b;c
some people used commas here and got the same errors. double check if they are correct. as staff member you should then be able to use the command "/areas on" to show the result. if errors continue springing up you need to check the area settings.
最后由 bikinihorst 编辑于; 2023 年 5 月 19 日 上午 1:12
Lacky 2023 年 5 月 19 日 上午 1:27 
The coordinates were the issue, just popped in game and it worked like a charm. I just defaulted to writing coordinates as a,b,c as you said, thanks for all the help.
bikinihorst  [开发者] 2023 年 5 月 19 日 上午 1:45 
neat! i should probably be adding a tolerance or warning in for that case. have fun filling the lists!
< >
正在显示第 1 - 8 条,共 8 条留言
每页显示数: 1530 50