lielkun Posted March 27, 2022 Share Posted March 27, 2022 (edited) I'm making a drinks mod and would like to add an option to remove pop spawns. I know how to add the option to the "mods" menu but I don't know how to define a function for it. I know i can just remove the pop spawn in the distribution, but I would like to add an option for the player to decide how they want to play. Note: I'm using the "Mod Options" mod. This is the distribution code used: https://pastebin.com/1MMnvnbi Edited February 2, 2023 by lielkun Link to comment Share on other sites More sharing options...
Tchernobill Posted March 28, 2022 Share Posted March 28, 2022 If I understand correctly you want to add an option to remove an option. If I'm correct you're too deep in the meta. lielkun 1 Link to comment Share on other sites More sharing options...
lielkun Posted March 28, 2022 Author Share Posted March 28, 2022 7 hours ago, Tchernobill said: If I understand correctly you want to add an option to remove an option. If I'm correct you're too deep in the meta. I want to do something like in "Vac's Drinks", but i don't know if there is an easier way to do it. Something like what is at the end of this code. https://pastebin.com/Q6mRcLWu Link to comment Share on other sites More sharing options...
Xyberviri Posted June 2, 2022 Share Posted June 2, 2022 (edited) Just remove the straw from you default distribution list and merge it into that one if a option is true. Or put it in its own table and wrap the add that in, though looking at your code it looks like you are replacing the default lists in game and not adding to them. On 3/28/2022 at 12:31 PM, lielkun said: I want to do something like in "Vac's Drinks", but i don't know if there is an easier way to do it. Something like what is at the end of this code. https://pastebin.com/Q6mRcLWu They already have code that does all that work for you, use this command to remove the item from all of the tables, just keep in mind its a little costly, but only happens on startup so once that is done the player never has to deal with it again. require "Items/SuburbsDistributions" RemoveItemFromDistribution(Distributions[1], "Straw",nil, true); Also just a heads up, make sure to put on your mod page that Mod Options works for servers, the host just needs to upload the zomboid\lua\mod-options.ini file to the same folder on the server for the server to read the settings. however the brand new Loot debug option will be broken because the loot tables on the server/client side wont match so you wont be able to use this new option they added in 46.71 to see loot tables :(, but loot will work because i added stuff to zombies and im seeing it drop. If you really really really want the server side mod options to match the client side you need to do message or extra mod shenanigans like the billion arsenal26 mods we see on the workshop. (it doesnt matter because again loot is server side, i confirmed this on my own mod) Also as you might have figured out sandbox variables are broken after restarting server or reloading a single player game during that event. Edited June 2, 2022 by Xyberviri Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now