Jump to content

Make Aid items add items to the player's inventory when used?


Hobobatman

Recommended Posts

I am trying to create a mod where one of the features is that certain items will refund some of items used to make them when used (when a Stimpak is used, an empty syringe is added to the player's inventory, for example). I am having trouble finding a function that would do this in the G.E.C.K. I tried looking at similar functions in the G.E.C.K., like how a bottle cap is added to the player's inventory when they drink any Nuka-Cola, but it seems this function is entirely unique to bottle caps and can't be edited to give different items. Any advice for this would be greatly appreciated.

Link to comment
Share on other sites

A "recipe" has a list of "ingredient" items required to create the item, and a list of "output" items which are the created item and any "returned" ingredients or remnants. So just add your "empty syringe" to the "output list". An item in both the "ingredient" and "output" list is effectively a "catalyst": something required but not consumed, like a hammer. In the case of your syringe, it sounds like you want to have both a "filled" and an "empty" version so they need to be two separate items.

 

-Dubious-

Link to comment
Share on other sites

I don't think he is talking about recipes Dubious.

 

About the topic, there is no function to add an item when an item is consumed. The nuka cola bottles and the likes all use scripted effects to do it. They are not too complicated but they are a little time consuming to implement due to how many entries it takes.

The first thing you need is a script that runs with the ScriptEffectStart blocktype. Inside this script you add the thing you want to the actor using the consumable. Then make a custom Base Effect and attach the script to it. And last you add this new Base Effect to the Ingestible you want to change.

Give it a go and you'll see it's simple enough.

Edited by UnvalidUserName
Link to comment
Share on other sites

Hey, UnvalidUserName, I made a script. I think I have it right (if you see any glaring issues with it, please let me know), but I don't know how to make a custom Base Effect or add new Base Effects to an injestible. In the case depicted in the screenshot, I'm trying to add it the Doctor's Bag. For reference, in the script, MedicalTools is the ID for an item I made for the mod; the goal is to make the MedicalTools item be refunded to the player when they use a Doctor's Bag. Any further help you can give would be greatly appreciated.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...