Jump to content

How do you add a "take" option to loot containers, like how the forge and workbench etc have one by holding e?


Acid Hits

Recommended Posts

So I wanted to add hardened chests for players that would be very resource heavy to make and have lots of hitpoints. So being able to move these around in your base would be great instead of having to waste time destroying it and then waste resources you used to make it.

 

Is there any simple way to add the "take" option you get while holding down e? So basically it would go here:

 

spacer.png

 

I feel like this information is stored within the Class property, however I'm not completely sure. I am brand new to this stuff. And I can't seem to locate where all the different Classes are stored in the data files. I tried adding a TakeDelay property that I noticed was within the Forge block properties to my item/block but that didn't seem to do it.

Link to comment
Share on other sites

In addition to the TakeDelay property, you'll also need <property name="CanPickup" value="true"/> in the block description to enable picking an item up. I'm not sure if the containers might have something that prevents them from being picked up, but I'm guessing that if you do try to pick it up, there won't be a check like for vehicles to make sure it's empty. In other words, I imagine you could easily pick up a fully loaded storage container and lose the entire inventory that way. That's something you might want to check. I know it multiplayer games, I had problems with players accidentally picking up powered vault doors because it was within their land claim area.

Link to comment
Share on other sites

8 minutes ago, Cranberry Monster said:

In addition to the TakeDelay property, you'll also need <property name="CanPickup" value="true"/> in the block description to enable picking an item up. I'm not sure if the containers might have something that prevents them from being picked up, but I'm guessing that if you do try to pick it up, there won't be a check like for vehicles to make sure it's empty. In other words, I imagine you could easily pick up a fully loaded storage container and lose the entire inventory that way. That's something you might want to check. I know it multiplayer games, I had problems with players accidentally picking up powered vault doors because it was within their land claim area.

Doesn't the CanPickup property only apply for things that can be picked up with e immediately, like frame shapes and bedrolls? As opposed to the forge or workbench where you have to hold down e? I don't know if that would work well with chests since you press e to open them.

Link to comment
Share on other sites

That's an excellent point. I suppose you could get around that by having the container need an upgrade to be movable. For example, I had a mod that added TV screens and movie screens, but you could only pick up the version that was switched off. I made a remote control item that "changed channels" by upgrading to the next version (different clip) and so on until you come to the off version. The off version can then be picked up, or you keep hitting the remote control and cycle through the videos again.

 

If you had an item like that remote control to upgrade your (hopefully) empty storage containers to a non-container block using the same model that was tagged for picking up, that might be a decent work around. Basically, you make the item (remote control) the thing necessary for the upgrade, but it doesn't use itself up in the process. As long as containers allow you to upgrade them, you'd be all set.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...