Hobobatman Posted July 31, 2020 Share Posted July 31, 2020 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 More sharing options...
dubiousintent Posted August 1, 2020 Share Posted August 1, 2020 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 More sharing options...
UnvalidUserName Posted August 1, 2020 Share Posted August 1, 2020 (edited) 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 August 1, 2020 by UnvalidUserName Link to comment Share on other sites More sharing options...
Hobobatman Posted August 1, 2020 Author Share Posted August 1, 2020 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 More sharing options...
UnvalidUserName Posted August 2, 2020 Share Posted August 2, 2020 The syntax of AddItem is wrong, use this as a reference: AddItem Here is an article on Base Effect Check in the Game Effect tab to find them and just add a new entry there, choose Scritp as your archetipe and add the corrected script to the Associated items. Link to comment Share on other sites More sharing options...
Hobobatman Posted August 2, 2020 Author Share Posted August 2, 2020 That worked famously! Thanks for all the help, UnvalidUserName! Link to comment Share on other sites More sharing options...
Recommended Posts