Jump to content

TalSh

Member
  • Posts

    9
  • Joined

  • Last visited

Posts posted by TalSh

  1. 1 hour ago, tommysticks said:
    
    function itemCheck(item, resultItem, player)
    
    	local pInv = player:getInventory();
    	local iTab2 = {}; --need an empty table later
    	local dItem;
    	
    	for i = 0, (item:size()-1) do --item = number of items required for recipe
    		dItem = item:get(i); 
    		if dItem:getCategory() == "Container" then --if any items in recipe are bags...
    			print("Container detected")
    			if player:getClothingItem_Back() == dItem then --...and are equiped on the back...
    				player:setClothingItem_Back(nil);
    			end
    			if player:getPrimaryHandItem() == dItem then --...or are equiped primary...
    				player:setPrimaryHandItem(nil);
    			end
    			if player:getSecondaryHandItem() == dItem then --...or are equiped secondary...
    				player:setSecondaryHandItem(nil); --remove them from being equipped
    			end
    			dInv = dItem:getInventory(); --get the inventory of recipe item
    			dInvItems = dInv:getItems(); --get the size of the inventory
    			if dInvItems:size() >= 1 then --if container is empty we are finished i.e. less than 1 item
    				for i2 = 0, (dInvItems:size()-1) do --if not, iterate over each item
    					invItem = dInvItems:get(i2);
    					table.insert(iTab2, invItem) --add each item to empty table
    					print(invItem:getType());
    				end
    			end
    		end
    	end
    	
    	for i3, k3 in ipairs(iTab2) do
    		print (k3:getType()..": removing from container.")
    		dInv:Remove(k3); --remove items from container in recipe
    		pInv:AddItem(k3); --add items to player inventory
    	end
    end

    Try pasting that over Nolan's original code and everything should work. I did some limited testing.

    This is amazing. Thank you so much. Those annotations are so great! I really appreciate you taking the time to do this. 

  2. Sorry for resurrecting this old thread, but using the tips provided by tommysticks and nolanri, I was able to fix the bag equipping issue. Thank you both!

     

    The other annoying issue persists: items in your equipped bag are lost if it is used in the crafting process. I understand this issue also existed in Hydrocraft, so I assumed it couldn't be fixed. Is this still true? Any way to get around it other than warning users to empty their bags before crafting?

  3. After more testing, and after specifying that the required recipe items are destroyed during the crafting, the problem only occurs when you right click an equipped bag and use that to start the crafting process. If you craft through the dedicated crafting menu, it will never use an equipped bag, nor will it count towards the recipe requirements. 

  4. Hello everyone.

     

    A mod I wrote allows players to sew upgraded hiking bags using existing hiking bags. I've found a bug where if one of the hiking bags used to make the upgraded version is equipped on the player's back, the resulting backpack is unequipped, and the player no longer has an option to equip anything on his/her back, as if the original bag is still equipped. There are no options to unequip, as the game thinks nothing is equipped.  The resulting bag (and any others) can only be equipped as primary and secondary. The only solution is starting a new game.  I've just tested again, and this issue does not occur when the bag is equipped as primary and secondary, only when it is equipped on the player's back.

     

    Here is the code I used for the upgraded bag, and for creating the recipe:

    item SmallUpgradedHikingBag
            {
                WeightReduction    =    85,
                Weight    =    0.6,
                Type    =    Container,
                Capacity    =    27,
                DisplayName    =    Small Upgraded Hiking Bag,
                Icon    =    SmallUpgradedHikingBag,
                CanBeEquipped = Back,
                OpenSound   =   PZ_OpenBag,
                CloseSound   =   PZ_CloseBag,
                PutInSound   =   PZ_PutInBag,
            }
    
    recipe Make Small Upgraded Hiking Bag
            {
                keep Needle,
                keep Scissors,
                Thread=2,
                NormalHikingBag=2,
                Result:SmallUpgradedHikingBag,
                Time:250.0
            }

     

    Has anyone seen or been able to fix this? What am I missing? Sorry if this has already been covered. I've tried searching but couldn't find anything related.

     

    Thanks in advance!

  5. 10 hours ago, EasyPickins said:

     

    Watermelon has a bug where DaysFresh is greater than DaysTotallyRotten.   I haven't seen other problems, although in earlier versions there were bugs with food age;  I don't know if you're seeing problems with an old savefile or a new one.

    I've seen this happen with Fish Filet. It's fresh in the fridge and rotten when I take it out. Not sure if it's related to it being an old save or not. 

     

    20160430214751_1.jpg

×
×
  • Create New...