Jump to content

[SOLVED] How i set a option to remove pop spawns?


lielkun

Recommended Posts

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 by lielkun
Link to comment
Share on other sites

  • 2 months later...

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 by Xyberviri
Link to comment
Share on other sites

  • lielkun changed the title to [SOLVED] How i set a option to remove pop spawns?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...