Jump to content

How to conditionally disable/enable slots.


jimmeh57

Recommended Posts

So I have recently come up with a new idea: how to go about disabling a certain slot during a particular condition (a certain level of sanity, for example), and then enabling it again once a different condition has been met. I'm just not sure how to go about doing this, I've been looking into inventorybar.lua, equippable.lua, and equipslot.lua, but I have been unable to find anything there on how to make this happen.

Link to comment
Share on other sites

  • Developer

So I have recently come up with a new idea: how to go about disabling a certain slot during a particular condition (a certain level of sanity, for example), and then enabling it again once a different condition has been met. I'm just not sure how to go about doing this, I've been looking into inventorybar.lua, equippable.lua, and equipslot.lua, but I have been unable to find anything there on how to make this happen.

The game doesn't currently have the concept of disabled inventory slots.  If you were to add this, I'd suggest adding the idea of a disabled slot to 'inventory.lua' and then change the way the slot is visiualized in 'inventorybar.lua'.  Hope that helps.

Link to comment
Share on other sites

The game doesn't currently have the concept of disabled inventory slots.  If you were to add this, I'd suggest adding the idea of a disabled slot to 'inventory.lua' and then change the way the slot is visiualized in 'inventorybar.lua'.  Hope that helps.

 

I have not looked into inventory but aren't body/head/weapon basically inventory slots that require a certain type to be able to equip into those slot? So you could make more of them but with requirements that can't be met effectively making them disabled. Sounds like it should work, not sure how you would do it per say but I have seen mods with new slots like a backback and amulet slot so I know its possible.

Link to comment
Share on other sites

I have not looked into inventory but aren't body/head/weapon basically inventory slots that require a certain type to be able to equip into those slot? So you could make more of them but with requirements that can't be met effectively making them disabled. Sounds like it should work, not sure how you would do it per say but I have seen mods with new slots like a backback and amulet slot so I know its possible.

Basically what I want to do is to disable the body slot. I'm just not sure if it would be easier to take away that slot, or to make 'body slot' items unable to be equipped. Either way, I still have to figure out how to go about doing so.

Link to comment
Share on other sites

Basically what I want to do is to disable the body slot. I'm just not sure if it would be easier to take away that slot, or to make 'body slot' items unable to be equipped. Either way, I still have to figure out how to go about doing so.

Look around at mods one give allot of extra slots as well as giving an amulet ab backpack slot that likely will show you where to start

Link to comment
Share on other sites

Look around at mods one give allot of extra slots as well as giving an amulet ab backpack slot that likely will show you where to start

Okay, so in this mod, I found this text:

 

function inventorypostinit(component,inst)
inst.components.inventory.numequipslots = 5
end
 
Now, I think this is what I've gotta change, just, I'm not exactly sure what the code would look like? Do I have to do this in modmain.lua, since said mod was made in modmain? And also, how would I go about choosing which mod is taken away?
 
I'm not expecting you to know the answers to these questions, I'm just brainstorming here.
 
Thanks for the reply.
Link to comment
Share on other sites

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