Jump to content

Is There A Way To Disable Hats for DST?


Recommended Posts

Hi guys and ladys.

 

The problem is as followed, I want for my Guts Mod the drawback, that he can´t wear any helmets and hats, besides his mod helmet, the Berserker Helmet.

 

I have found this in the Dr. Nefarious Mod:

(in the modmain.lua)

 

local function ModHat(inst)
    if GLOBAL.ThePlayer().prefab == "nefarious" then
    inst:RemoveComponent("equippable")
end
end

AddPrefabPostInit('strawhat', ModHat)
AddPrefabPostInit('winterhat', ModHat)
AddPrefabPostInit('beefalohat', ModHat)
AddPrefabPostInit('tophat', ModHat)
AddPrefabPostInit('beehat', ModHat)
AddPrefabPostInit('minerhat', ModHat)
AddPrefabPostInit('spiderhat', ModHat)
AddPrefabPostInit('footballhat', ModHat)
AddPrefabPostInit('earmuffshat', ModHat)
AddPrefabPostInit('bushhat', ModHat)
AddPrefabPostInit('walrushat', ModHat)
AddPrefabPostInit('slurtlehat', ModHat)
AddPrefabPostInit('ruinshat', ModHat)
AddPrefabPostInit('armorgrass', ModHat)
AddPrefabPostInit('armorwood', ModHat)
AddPrefabPostInit('armormarble', ModHat)
AddPrefabPostInit('armor_sanity', ModHat)
AddPrefabPostInit('ghelmet', ModHat)
AddPrefabPostInit('bhelmet', ModHat)
AddPrefabPostInit('rhelmet', ModHat)
AddPrefabPostInit('barmor', ModHat)
AddPrefabPostInit('rarmor', ModHat)

 

 

it does exactly what I need, but it doesn´t work, maybe because it is coded only for DS/ROG. If I build a strawhat with DR Nefarious (DST) the game will crash, so it must be the code.

 

Can you help me? (and in that case also the DR. Nefarious Mod creator)

Or is it not possible for DST?

 

This is my Guts Mod:

http://steamcommunity.com/sharedfiles/filedetails/?id=493284025&searchtext=guts

And this is Dr. Nefarious:

http://steamcommunity.com/sharedfiles/filedetails/?id=503469674&searchtext=ratchet

Edited by HeilerderWelten
Link to comment
Share on other sites

@HeilerderWelten:

	local _Equip = inst.components.inventory.Equip	inst.components.inventory.Equip = function(self, item, old_to_active)		if not item or not item.components.equippable or not item:IsValid() then			return		end		if item.components.equippable.equipslot == EQUIPSLOTS.HEAD then			if not (item.prefab == "berserkerhelmet") then				self:DropItem(item)				self:GiveItem(item)				return			end		end		return _Equip(self, item, old_to_active)	end

in the master_postinit.

Link to comment
Share on other sites

@HeilerderWelten:

	local _Equip = inst.components.inventory.Equip	inst.components.inventory.Equip = function(self, item, old_to_active)		if not item or not item.components.equippable or not item:IsValid() then			return		end		if item.components.equippable.equipslot == EQUIPSLOTS.HEAD then			if not (item.prefab == "berserkerhelmet") then				self:DropItem(item)				self:GiveItem(item)				return			end		end		return _Equip(self, item, old_to_active)	end

in the master_postinit.

 

Thank you very much DarkXero for all your help, Guts is now better than I ever could imagined.

You are really an awsome person and helpul like a lighter in the dark..

 

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...