Jump to content

Removing the two-handed requirement for grabbing corpses?


32Alpha

Recommended Posts

Hello all,

 

Long time PZ player, first time poster.

 

I am trying to figure out how to remove the two-handed requirement for picking up corpses.

 

I have modified the newitems.txt file in the following directory: Steam\SteamApps\common\ProjectZomboid\media\scripts

 

I have attempted to change the following line to FALSE, but when I right click a corpse and use the context menu "Grab Corpse" it still requires two hands.

 

RequiresEquippedBothHands = TRUE

 

I have also tried deleting the line altogether, but the Grab Corpse action still requires two hands.

 

Both corpse entries now have their weight set to 0.0

 

Essentially I would just like the weightless corpse to be in my top level inventory after I grab it, but without requiring both hands.

 

At present I am trying to clean up hundreds of corpses and pile them altogether. Right now I use the Grab Corpse option, then I have to drag the body into a sub-bag (or drop the corpse) in order to grab the next corpse.

 

Is there any way to circumvent the two-handed requirement?

Link to comment
Share on other sites

I just did some looking around, and found a few references to the CorpseMale & CorpseFemale items in the following files.

 

...ProjectZomboid\media\lua\client\TimedActions\ISEquipWeaponAction.lua

...ProjectZomboid\media\lua\client\TimedActions\ISGrabCorpseAction.lua

...ProjectZomboid\media\lua\client\TimedActions\ISUnequipAction.lua

 

It looks like the Generator, CorpseMale, and CorpseFemale are setup to be forced as 2-handed items that can't be stashed in inventory by default. I'm just starting to learn the modding process so I'm not sure how to adjust the functions called in the mentioned lua files without breaking things, but that might give you some direction.

Link to comment
Share on other sites

This is great! Thank you.

 

I edited ISGrabCorpseAction.lua and removed the following lines and it does not force the corpse into your hands. 

 

forceDropHeavyItems(self.character)

self.character:setPrimaryHandItem(self.corpse);

self.character:setSecondaryHandItem(self.corpse);

 

Unfortunately it still limits you to a single corpse in your top inventory - you can't pick up additional corpses as long as you have one in your inventory.

 

Not sure if this function has anything to do with it. I tried tinkering with the numbers, but when the value for the return portion gets changed it doesn't allow you to pick up any corpses at all.

 

 
function ISGrabCorpseAction:isValid()
    if self.corpseBody:getStaticMovingObjectIndex() < 0 then
        return false
    end
    return self.character:getInventory():getItemCount("Base.CorpseMale") == 0;

end 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...