Jump to content

[Request] Anti Antlion Sinkhole Mod.


Recommended Posts

I hate sinkholes, YOU hate sinkholes. Perhaps we ALL hate sinkholes. I don't really know if this is prohibited but at this point I am willing to pay for this. Basically a mod that either disables the sinkholes completely or replacing breaking ITEMS with DOING DAMAGE because it seriously.. I mean.. Ant Lions man.

Link to comment
Share on other sites

Go to your mods folder. Create a new folder and name it disablesinkholes (doesn't really matter). Create a file named modinfo.lua with the following content:

name = "Disable Sinkholes"
description = ""
author = ""
restart_required = false
forumthread = "topic/79873-request-anti-antlion-sinkhole-mod/"
version = "1"
api_version_dst = 10
dst_compatible = true
all_clients_require_mod = false
client_only_mod = false

Create another file named modmain.lua with the following content:

GLOBAL.require("components/sinkholespawner")._ctor = function(self, inst)
	self.inst = inst
	self.targets = {}
	self.StartSinkholes = function(self) end
	self.StopSinkholes = function(self) end
end

Enable the mod. It's a server-only mod. Should work on new and old worlds.

--

edit:

I naively thought caveins were handled separately from sinkholes, but it turns out they aren't. The code above nukes the sinkhole component, disabling caveins as a side effect. Instead, you can use the code below in your modmain.lua to disable sinkholes only. Players in the overworld will still receive warnings, but no attacks. If you want to disable sinkholes and caveins altogether, set tributes to none.

AddComponentPostInit("sinkholespawner", function(self)
	OldDoTargetAttack = self.DoTargetAttack
	function self:DoTargetAttack(targetinfo)
		targetinfo.pos = nil
		return OldDoTargetAttack(self, targetinfo)
	end
end)

Mod available here.

Edited by alainmcd
Link to comment
Share on other sites

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
 Share

×
  • Create New...