RoboMat Posted February 2, 2014 Author Share Posted February 2, 2014 Updated to 1.0.4:Version 1.0.4- Updated to work with the latest modding utils Link to comment Share on other sites More sharing options...
Suraru Posted June 3, 2015 Share Posted June 3, 2015 Edit: The unpack magic is elsewhere.... There's a chunk of code that eats a random item every time you unpack. elseif type(itemTable[i1]) == "table" then -- We start to iterate at the second index to jump over the dummy -- item that is contained in the item-table. for i2 = 2, #itemTable[i1].items do local item = itemTable[i1].items[i2]; if instanceof(item, "InventoryItem") and instanceof(item, "InventoryContainer") then local bag = item; local itemsInContainer = table.convertArrayList(bag:getInventory():getItems()); if #itemsInContainer > 0 then context:addOption("Unpack (" .. #itemsInContainer .. " Items)", itemTable, onUnpackBag, player, itemsInContainer, bag); end end end endChanging i2 = 1 only adds an extra unpack option... the unpack magic is elsewhere.... Link to comment Share on other sites More sharing options...
RoboMat Posted June 3, 2015 Author Share Posted June 3, 2015 The actual unpacking happens in the TimedAction:function TAUnpackBag:perform() local player = self.character; local bag = self.bag; local inventory = bag:getInventory(); -- Get the bag's inventory. local container = bag:getContainer(); -- Get the container in which the bag itself is contained. -- Remove all items from the baggage container. inventory:removeAllItems(); -- Now we move all the items from the bag to the container. container:setDrawDirty(true); for _, item in ipairs(self.itemsInBag) do if item then -- If the floor is selected add the items to the ground. if container:getType() == "floor" then player:getCurrentSquare():AddWorldInventoryItem(item, 0.0, 0.0, 0.0); else container:AddItem(item); end end end -- Make sure we refresh the inventory so the items show up. local pdata = getPlayerData(player:getPlayerNum()); if pdata then pdata.playerInventory:refreshBackpacks(); pdata.lootInventory:refreshBackpacks(); end -- Remove Timed Action from stack. ISBaseTimedAction.perform(self);endBut I guess the problem might be caused by this (Line 64 in UIUnpackBagsMenu.lua):local itemsInContainer = table.convertArrayList(bag:getInventory():getItems());Might be worth writing a few tests to check if this returns all the items in the inventory. Link to comment Share on other sites More sharing options...
Suraru Posted June 9, 2015 Share Posted June 9, 2015 I just assumed it was skipping over a dummy item that no longer exists in the game, so it's skipping over an actual item causing it to disappear. Link to comment Share on other sites More sharing options...
RoboMat Posted June 10, 2015 Author Share Posted June 10, 2015 Updated to work with the latest version of PZ. Modding utilities are no longer needed. ### Version 1.1.0- Added special menu entries for one and multiple objects- Added possiblity for translations - Added german translation - Added finnish translation - Added french translation- Fix #1: Items are no longer deleted- Updated folder structure to make the mod work with the latest version of PZ- Remove utility dependencies (no extra files are needed to run the mod) GunJamann 1 Link to comment Share on other sites More sharing options...
RoboMat Posted June 23, 2015 Author Share Posted June 23, 2015 Updated to version 1.2.0:### Version 1.2.0- Added translations for the warning modal- Added russian translations- Changed the background color of the warning modal- Update the preview image Link to comment Share on other sites More sharing options...
TypoDemon Posted June 28, 2015 Share Posted June 28, 2015 I really wanted to say thank you so much for this mod. It's really going to help out and it's not a game breaking thing. If we can put things in a bag all at one time, logically we can unpack them too! Really, really neat idea that needed to be done. Again you have my utmost thanks from someone like me who can't even begin to understand how to code things and was wishing for something like this! RoboMat 1 Link to comment Share on other sites More sharing options...
RoboMat Posted June 28, 2015 Author Share Posted June 28, 2015 I really wanted to say thank you so much for this mod. It's really going to help out and it's not a game breaking thing. If we can put things in a bag all at one time, logically we can unpack them too! Really, really neat idea that needed to be done. Again you have my utmost thanks from someone like me who can't even begin to understand how to code things and was wishing for something like this! Thanks, glad you like it Link to comment Share on other sites More sharing options...
Kurogo Posted July 3, 2015 Share Posted July 3, 2015 Any chance this could work with bags/containers on the ground? I'm using the Hydrocraft mod and have a dolly sitting on the ground that's too heavy to pick up and unpack. =( Link to comment Share on other sites More sharing options...
RoboMat Posted July 3, 2015 Author Share Posted July 3, 2015 Any chance this could work with bags/containers on the ground? I'm using the Hydrocraft mod and have a dolly sitting on the ground that's too heavy to pick up and unpack. =( It should. When the bag is on the floor it comes up in the world inventory window and you should be getting the "Unpack xy items" option when you right click on it. Link to comment Share on other sites More sharing options...
RoboMat Posted July 3, 2015 Author Share Posted July 3, 2015 Just tested it to be sure and it works as expected: (Although I noticed that the items are currently placed at the player's position. Will push a fix today). Link to comment Share on other sites More sharing options...
Kurogo Posted July 3, 2015 Share Posted July 3, 2015 Even if placed on the ground, being able to recover the items is a huge blessing. Awesome work! Link to comment Share on other sites More sharing options...
Kurogo Posted July 4, 2015 Share Posted July 4, 2015 Tried it on that dolly, it won't unpack if the total items' weight is higher than the space's capacity. Link to comment Share on other sites More sharing options...
RoboMat Posted July 4, 2015 Author Share Posted July 4, 2015 Tried it on that dolly, it won't unpack if the total items' weight is higher than the space's capacity. Yes that's by design. If I'd allow people to unpack items into containers with insufficient capacity it would be an exploit, since you could fill a bag way over its originally intended maximum. A possible "fix" would be to only allow parts of the bag until the container is full. This way you could empty a huge bag over multiple containers. Link to comment Share on other sites More sharing options...
Kurogo Posted July 4, 2015 Share Posted July 4, 2015 Even that would be a godsend, as right now, I'm unable to empty the dolly at all while it sits on the ground. Link to comment Share on other sites More sharing options...
RoboMat Posted July 5, 2015 Author Share Posted July 5, 2015 Pushed Version 1.3.0### Version 1.3.0- Duration of the TimeAction is now dependent on the amount of items in the bag- Bags can now be partially emptied if the target container is too small to hold all the items (Closes #4)- Fixed #2: Items are now placed on the bag's IsoSquare Link to comment Share on other sites More sharing options...
Kurogo Posted July 5, 2015 Share Posted July 5, 2015 High five! You just made my day! RoboMat 1 Link to comment Share on other sites More sharing options...
RoboMat Posted July 5, 2015 Author Share Posted July 5, 2015 High five! You just made my day! Glad you like it Link to comment Share on other sites More sharing options...
RoboMat Posted July 6, 2015 Author Share Posted July 6, 2015 Pushed another small update### Version 1.4.0- Added a world context menu for unpacking items on the floor Link to comment Share on other sites More sharing options...
willow512 Posted July 7, 2015 Share Posted July 7, 2015 How about the inverse? Clicking on a bag in a container allows you to put the rest of the container in that bag? I've recently been packing for a move from the northwest warehouse to the sunstar hotel. It was a lot of juggling items. Being able to put items into containers and then quickly wrap them into bags would have saved me quite some effort. I might be doing it again soon. Cuz.. You know I accidentally all the house alarms in the area. And now everyone is checking in.. There apears to be a skin cream convention in the area. (And between us, most of the guests need it...) Though the goth girl in room 2 is kinda hot... Anyway it's only some interface magic, nothing OP game wise... Link to comment Share on other sites More sharing options...
RoboMat Posted July 7, 2015 Author Share Posted July 7, 2015 How about the inverse? Clicking on a bag in a container allows you to put the rest of the container in that bag? This would require an InventoryContextMenu option. The mod should then iterate over all items in the same container as the bag, ignoring the bag itself and any items that are equipped on the player.It should then transfer each item into the bag until the bag is full.There shouldn't be any time bonus for using this method, so the default TimedAction can be used for the transfer. Will see if I can get this done today. Link to comment Share on other sites More sharing options...
RoboMat Posted July 8, 2015 Author Share Posted July 8, 2015 Another small update which adds Tiny AVC support:### Version 1.5.0- Added support for Tiny AVCThis allows you to directly check for new versions of your installed mods directly ingame. Link to comment Share on other sites More sharing options...
willow512 Posted July 11, 2015 Share Posted July 11, 2015 Will see if I can get this done today.Awesome man Link to comment Share on other sites More sharing options...
RoboMat Posted July 11, 2015 Author Share Posted July 11, 2015 Released Version 1.6.0:### Version 1.6.0- Added support for quickly packing a bag - Can be selected in the inventory screen and will grab all items in the same container as the bag - Ignores bags and equipped items- Changed folder structure and added a mod id Body Builder 1 Link to comment Share on other sites More sharing options...
Body Builder Posted July 13, 2015 Share Posted July 13, 2015 Released Version 1.6.0:### Version 1.6.0- Added support for quickly packing a bag - Can be selected in the inventory screen and will grab all items in the same container as the bag - Ignores bags and equipped items- Changed folder structure and added a mod id Hi Robomat, thanks a lot for this great mod, it's really good and useful.You are very good! RoboMat 1 Link to comment 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