Jump to content

Recommended Posts

All you need is small script directly in modoverrides.lua file:

local t = {
	--Your old options.
}

--Small script.
for i=#t,1,-1 do
	local opt = t[i]
	if opt.sub then --string
		t[opt] = { enabled = true }
	elseif opt[1] ~= nil and opt.enabled ~= false then --special table
		local name = opt[1]
		name = ""..name ~= name and "workshop-"..name or name
		t[name] = { enabled = true, configuration_options = opt }
		opt[1] = nil
	end
	t[i] = nil
end
return t

For example, you can see my modoverrides.lua. It's compatible with old format. But I can use my new "lazy" format for adding mods and/or options. At the end of the options you can find new format examples:

Spoiler

local t={
	--["workshop-517579359"] = { enabled = true }, -- Hunger games (from Astro)
	--["workshop-515068756"] = { enabled = true }, -- MyTweaks (from Astro)
	--["workshop-436897772"] = { enabled = true }, -- Default's items pack
	["workshop-385521750"] = { enabled = true }, -- NoWalls
	["workshop-369596587"] = { enabled = true }, -- Tell me
	["workshop-377292520"] = {  -- Canibalism 18
		enabled = true, 
		configuration_options =
		{ 
			--DROP
			base_drop_meat = 0.5, --from 1-day newbies
			death_drop_meat = 3, --more kills, more fat
			food_drop_meat = 3, --max from food
			food_hp = 50, --how much +hp gives 0.5 meat
			
			game_mode = -1, --starting hp is 100%
			add_new_killer_sanity = 100,
			kills_for_ghosts = 1,
			ghost_chance = 0.3,
			
			mobs_announcements = ,
			drop_from_skeletons = 1,
			rename_human_meat = ,
			
			stealing_aggro = ,
			slimy_tool = 1,
			hot_work = ,
			sanity_aura_enabled = 1,
			is_blood = 1,
			
			human_vest_enabled = ,
			sense_amulet_enabled = ,
			
			scalp_drop_enabled = 1,
			eye_drop_enabled = 0.3,
			show_log_damage = 1,
			
			blood_from_animals = 1,
			is_bleeding = 1,
			max_bleeding = 100,
		}
	},

	--,["workshop-385299203"] = { enabled = true, } -- Canibalism II. no need
	{381745920, -- Pan Flute
		panflute_pvp_range = 15,
		knocked_reader = true,
	},
	--["workshop-421510671"] = { enabled = true }, -- Deep-Freezer
	--["workshop-394401196"] = { enabled = true }, -- Throwable Rocks
	--["workshop-381565292"] = { enabled = true }, -- Waiter 101 Together v3.1
	{380423963, -- Mine gems
		enabled = true,
		boulder_blue = 0.01,
		boulder_purple = 0.005, --Means 0.5%
		goldvein_red = 0.01,
		goldvein_purple = 0.005,
		flintless_blue = 0.02,
		flintless_red = 0.02,
		flintless_purple = 0.01,
		moon_yellow = 0.01,
		moon_orange = 0.01,
		moon_green = 0.01,
		--caves
		stalagmite_yellow = 0.02,
		stalagmite_orange = 0.02,
		stalagmite_green = 0.02,
		
		--STANDARD CAVE DEBRIS
		--common
		common_loot_rocks = 0.37,
		common_loot_flint = 0.37,
		common_loot_charcoal = ,
		--uncommon
		uncommon_loot_goldnugget = 0.05,
		uncommon_loot_nitre = 0.05,
		uncommon_loot_rabbit = 0.05,
		uncommon_loot_mole = 0.05,
		--rare
		rare_loot_redgem = 0.015,
		rare_loot_bluegem = 0.015,
		rare_loot_marble = 0.015,

		--ADDITIONAL CAVE DEBRIS (weight: can be any number)
		--common: recommended 0.37
		guano = ,
		foliage = ,
		cutlichen = ,
		--uncommon: recommended 0.05
		seeds = ,
		spoiled_food = ,
		rottenegg = ,
		pinecone = ,
		--rare: recommended 0.015
		lightbulb = ,
		durian = ,
		gears = ,
		
		--winter
		ice = ,
	}, 

	--["workshop-482313412"] = { enabled = true }, -- Glowing moonrocks
	--["workshop-404983266"] = { enabled = true }, -- Pickle
	--["workshop-418604101"] = { enabled = true }, -- Steam punk
	--["workshop-488009136"] = { enabled = true }, -- Archery
	--["workshop-488827875"] = { enabled = true }, -- Steelheart
	--["workshop-447092740"] = { enabled = true }, -- Actions
	["workshop-398251920"] = { enabled = true,
		hide_conf = 2,
	}, -- Hide Me
	--["workshop-387504389"] = { enabled = true }, -- Burnie
	--["workshop-488018406"] = { enabled = true }, -- Break The Ice
	--["workshop-401989152"] = { enabled = true }, -- Marble Suit (PvP)
	--["workshop-385650867"] = { enabled = true }, -- Traps
	--,["workshop-375850593"] = { enabled = true } -- Extra Equip Slots
 
	-----------------------------------------------------------------------------------------
	--New format:
	
	"ServerMod3", --Private (hidden) server mod
	"Cheats", --Private (hidden) server mod for console commands
	{375859599, -- Health Info
		show_type = ,
		divider = 5,
		--random_health_value = 0.1,
		--random_range = 0.1,
	},
	--{373682145}, -- UFO
	{522365312, -- Disable Characters
		wilson = false, -- false means "Enabled"
		willow = false, -- true maens "Disabled"
		wolfgang = true,
		wendy = false,
		wx78 = true,
		wickerbottom = true,
		woodie = true,
		wes = false,
		waxwell = false,
		wathgrithr = true,
		webber = true,
		cheat_admin = true,
		user_character = "ufo,musha,nasking,archer",
	},
	"AdminCamera", --Local server only mod (in the folder "AdminCamera").
	{"StopSpam", --Server only workshop mod, so it can be copied to separate folder "StopSpam".
		stop_any_spam = true,           --Stop any spam for any mods (even all_clients_require_mod).
		try_restart = true,             --Shut down the game if mod need update.
		players_threshold = 1,          --Maximum players for possibility of restart by the mod.
		shutdown_string = "rebooted",   --If you have auto restart script for DST server.
		countdown_time = 15,
	},
	--{544637010}, --Archer(Fate/Stay Night)
	--{451779457}, --Wilbur, The Pirate
	--{557800575}, --Sprinter Set
	{612605169}, --Anti-Crash
	{436110082}, --Top Mod 
	--{399527034}, --Magical Pouch v2
	--{442294018}, --Perishable v2
	{462434129, --Restart (c_despawn)
		enabled = false, --temporary disabled.
		FLOODING_PROTECTION = false,
		--IGNORING_ADMIN
	},
	{375850593}, --equip slots
	"Optimizer2", --private server only mod
	{643193433, --Kindling Fire
		enabled = true,
		white_night = false,
		give_lightbulb = true, 
		LIGHTBULB_PERISH_TIME = 1.8, --I think it's enough for one first night. Matches will help later.
		ignite_trees = false,
		REMOVE_SPAWNLIGHT = 600,
		
		ANTICHEAT_ENABLED = true,
		MAX_SKIP_NIGHT_TIME = 45,
		BONUS_NIGHT_TIME = 15,
		NIGHT_TIME_GAIN_SPEED = 0.3,
	},
	{539045984, --Matches
		enabled = true,
		to_give = 1,
		how_many = 15, 
		--craft_torch = ,
	}
}


--Small script.
for i=#t,1,-1 do
	local opt = t[i]
	if opt.sub then --string
		t[opt] = { enabled = true }
	elseif opt[1] ~= nil and opt.enabled ~= false then --special table
		local name = opt[1]
		name = ""..name ~= name and "workshop-"..name or name
		t[name] = { enabled = true, configuration_options = opt }
		opt[1] = nil
	end
	t[i] = nil
end
return t

Btw online lua syntax checkers:

http://ideone.com/

http://codepad.org/

 

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...