Jump to content

Adding a new "rip bandages" recipe


Banjo

Recommended Posts

So I was wanting to add a simple script recipe to allow you to rip dish towels into bandages.

 

This was my script:

module MoreBandageOptions{    imports    {        Base    }    recipe Rip bandages    {       DishCloth,              Result:RippedSheets=4,       Time:80.0,    }}

I was sure it was correct, and when I load the game it indeed lets me rip dish towels and gives me 4 bandages... but it also doesn't destroy/remove the dish towel. In fact, I can keep ripping 4 bandages off a single dish towel forever, it seems!

 

What the heck did I do wrong?

 

I've made other recipes work, and can do the same with - say - socks and have it work fine. What's the deal with the dish towel?

 

(I've tried putting the script - "ZPBanjo_MoreBandageOptions.txt" - in both the main "scripts" folder and in a "Mods\MoreBandageOptions" subfolder and both cause the same issue).

 

Also (less importantly, but something I'm curious about), why when I right-mouse-click on a skirt or shirt in a container, it gives me the "rip bandages" option (if I click, it takes the item then rips it into bandages as normal), but when I right-mouse-click on a dish cloth in a container (with my mod running), it doesn't give the "rip" option... I have to take it and put it in my inventory first, then right-click on it there to get that choice to appear.

Link to comment
Share on other sites

There's something that determines whether things have to be in the main inventory or anywhere else before you can do 'crafting' things with them, but I'll be damned if I know what.

 

Possibly something to do with dishtowels not being actually "destroyed" when they're used normally?

Link to comment
Share on other sites

Thanks RobertJohnson! That fixed it! (clyde)

 

I'm still confused WHY it doesn't work with my original script, though (i.e. why some recipes need "destroy" and others assume it without "keep"). Not a problem really, since your tip solves the issue, but still makes me wonder... is it because the DishCloth is set as "drainable" in its item properties (items.txt)?

 

And Rathlord, what you said makes perfect sense in regard to my second question... thanks! I'm still wanting to make the "rip bandages" command appear when the DishCloth is in a container and not your inventory, as it does currently for clothing. Whatever that "something" is that decides if you need an item in your inventory or not... maybe its the same reason (set as drainable rather than assumed to be destroyed on use)?

Link to comment
Share on other sites

Possibly. Maybe you can look at some original items that work this way for hints. Try comparing, say, a can opener (or possibly soup) that only work when in the inventory to a shirt which works anywhere. An odd exception is sheets, which can be used on windows only from your inventory but can be ripped anywhere? Hmmph.

Link to comment
Share on other sites

Possibly. Maybe you can look at some original items that work this way for hints. Try comparing, say, a can opener (or possibly soup) that only work when in the inventory to a shirt which works anywhere. An odd exception is sheets, which can be used on windows only from your inventory but can be ripped anywhere? Hmmph.

Actually, are ripping clothes/sheets the only thing that can be 'crafted' outside the player's inventory? Now I think about it, it may be the only items I've spotted that with. Maybe it's actually a bug (IMO, consistency and common sense should make you take it first anyway) or maybe it's a lua context menu added to those particular items elsewhere that I haven't found yet?

 

Not an issue, really, but interesting...

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...