Search found 4 matches
- Wed Feb 21, 2024 11:54 pm
- Forum: Modding discussion
- Topic: How to swap armors without dropping items?
- Replies: 8
- Views: 3789
Re: How to swap armors without dropping items?
That's a really good point, I'll update that in the next version.
- Tue Apr 13, 2021 5:30 pm
- Forum: Modding discussion
- Topic: How to swap armors without dropping items?
- Replies: 8
- Views: 3789
Re: How to swap armors without dropping items?
I thought about doing that but Ive read that lua lacks thread safety and I'm concerned that one thread might modify the value of the inventory slot bonus while it's being read. Is that a cause for concern?
- Tue Apr 13, 2021 7:10 am
- Forum: Modding discussion
- Topic: How to swap armors without dropping items?
- Replies: 8
- Views: 3789
Re: How to swap armors without dropping items?
I figured out a solution! I create a temporary inventory, move everything into there, swap armors, and then move all the items back. If there's a more elegant way to accomplish this, though, I'd love to know! mainInventory = game.player.get_main_inventory() tempInventory = game.create_inventory(#mai...
- Tue Apr 13, 2021 3:38 am
- Forum: Modding discussion
- Topic: How to swap armors without dropping items?
- Replies: 8
- Views: 3789
How to swap armors without dropping items?
I'm trying to duplicate the effect of picking up an armor from my inventory and dropping it into the armor slot using code. Ideally I'd like to make an armor wardrobe mod for quickly changing between sets of armor that have equipment in them for specialized tasks (fighting, building, moving quickly,...