Jump to content

Recommended Posts

Trying to prevent the headslot on a character to be used with normal Headslot items. For some reason Hat items like/must auto equip themselfs when picked up from the ground. Here is what I used...

	local old_Equip = inst.components.inventory.Equip    inst.components.inventory.Equip = function(self, item, old_to_active)		--Stops Armor from being equipped		if item.components.equippable.equipslot == EQUIPSLOTS.BODY then			--Do Special Armor filter here			self.inst.components.inventory:DropItem(item, true, true)			self.inst.components.talker:Say("My mighty armor is mightier")			return false 		end				--Stops Hats from being equipped		if item.components.equippable.equipslot == EQUIPSLOTS.HEAD then			--Do Special Relic filter here			item.components.equippable:ToPocket()			--self.inst.components.inventory:DropItem(item, true, true)			self.inst.components.talker:Say("This is not a Relic!")			return false 		end		        return old_Equip(self, item, old_to_active)    end

Sadly this code works prefect for armor, but hats now will not be able to be picked off the ground.  I tried to use the DropItem much like the armor, but then it just drops the item to the ground.

 

 

Overall goal. Have a custom character that can't use normal Body Armor or Head slot items, besides a few select few.

Kinda hoping for a way, Character Side, to lock Equippment slots (Staying they are full) unless the correct item is tried against it.

 

 

For some reason Head Slot items behave so weird compared to Body Slot items.... T_T

Edited by JadeKnightblazer

Well this seems to work, atleast the tests I did...

if item.components.equippable.equipslot == EQUIPSLOTS.HEAD then			--Do Special Relic filter here			self:RemoveItem(item, true)			if self:IsFull() then				if not self.activeitem and not TheInput:ControllerAttached() then					item.components.inventoryitem:OnPutInInventory(self.inst)					self:SetActiveItem(item)				else					self:DropItem(inst, true, true)					self:SetActiveItem(nil)				end			else				self:RemoveItem(item, true)				self.silentfull = true				self:GiveItem(item)				self.silentfull = false				self:SetActiveItem(nil)			end			self.inst.components.talker:Say("This is not a Relic!")			return false		end

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