JadeKnightblazer Posted February 3, 2015 Share Posted February 3, 2015 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) endSadly 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. Link to comment https://forums.kleientertainment.com/forums/topic/50311-how-to-stop-hats-from-auto-placing-into-head-slot-when-picked-up/ Share on other sites More sharing options...
Mobbstar Posted February 3, 2015 Share Posted February 3, 2015 You could try to place it in their inventory manually upon being picked up, only dropping it when that fails. (rather than "preventing" it to go to the head slot). Link to comment https://forums.kleientertainment.com/forums/topic/50311-how-to-stop-hats-from-auto-placing-into-head-slot-when-picked-up/#findComment-609234 Share on other sites More sharing options...
JadeKnightblazer Posted February 3, 2015 Author Share Posted February 3, 2015 (edited) How would I go about that? I tried using a few functions but ended up with Item dup bugs. Edited February 3, 2015 by JadeKnightblazer Link to comment https://forums.kleientertainment.com/forums/topic/50311-how-to-stop-hats-from-auto-placing-into-head-slot-when-picked-up/#findComment-609276 Share on other sites More sharing options...
JadeKnightblazer Posted February 3, 2015 Author Share Posted February 3, 2015 (edited) 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 February 3, 2015 by JadeKnightblazer Link to comment https://forums.kleientertainment.com/forums/topic/50311-how-to-stop-hats-from-auto-placing-into-head-slot-when-picked-up/#findComment-609283 Share on other sites More sharing options...
JadeKnightblazer Posted February 3, 2015 Author Share Posted February 3, 2015 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 Link to comment https://forums.kleientertainment.com/forums/topic/50311-how-to-stop-hats-from-auto-placing-into-head-slot-when-picked-up/#findComment-609331 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now