Please make a backup of your project before following this guide!

If you are using a version of Survival Game Kit V2 thats older then 2.0.6 then you need to make sure you have followed the guide below.

https://defusestudios.com/sgk-v2-added-destroyed-item-containers-removed-from-global-inventory/

Note – Following this guide will overwrite the BP_ItemTooltip widget so if you have changed that widget at all those changes will be lost when following this guide. Also if you have integrated Interaction Widgets all the changes in the BP_StaticMasterItem and BP_SkeletalMasterItem blueprints will be removed so you will have to refollow that part of the Interaction Widgets integration guide.

First go to the S_InvItem struct and add a new variable by clicking the New Variable button.

Set the new variable type to Integer and call it DecayTime. Then save the struct. It should look like the image below. Then click the save button.

Next play in editor, this will take a while to load’s its not crashed just leave it alone it has to recompile alot of blueprints! Once the player loads in you can exit play in editor, then save all in the content browser and restart the project.

If the engine does crash just open the project again and play in editor again and the player should load in.

Next copy the video below.

Then open the S_DecayDetails and add the variables shown in the image below, make sure you also set the default values to the same as the image as well. Once done click the Save button.

Next go to the S_DurabliltyDetails and copy the video below.

Then again play in editor, this may take a while to load just leave it, once the player loads in you can exit and click the save all button in the content browser, then restart the project.

Next go to the BP_GlobalInventoryManager and go to the CreateNewItem function and copy the video below.

Next go to the BP_MasterInventory and create a new variable called DecayMultiplier and set its variable type to Float. Then tick on Instance Editable and set the Default Value to 1.

Next create a new function called ItemDecay and in that function create the following Local Variables.

Create a local variable called ElementL and set its type to S_InvSlot

Create a local variable called DecayDetailsL and set its type to S_DecayDetails

Create a local variable called ItemL and set its type to S_InvItem

Then copy the images below, it has been split into multiple images.

Note – for the Set Members nodes select them and in the Details Panel you can tick on the inputs.

Next go to the BP_MasterInventory and then to the BeginPlay collapsed node and add the highlighted nodes shown in the image below.

Next go to the BP_EquipmentInventory and copy the video below.

Then create the following new local variables.

Create a local variable called ItemL and set its type to S_InvItem

Create a local variable called DecayDetailsL and set its type to S_DecayDetails

Create a local variable called EquipmentL and set its type to S_EquipmentSlot

Then copy the images below in the new function.

Next click the save all button in the content browser and close your project. Then download the files linked below and unzip them then copy the video below.

https://www.dropbox.com/s/lut02ylwa9aqcei/ItemDecay.zip?dl=0

Next open the project back up and go to the BP_InventoryItemIcon widget and copy the image below.

Go to the BP_EquipmentSlot widget and copy the image below.

Go to the BP_WeaponSlot widget and copy the image below.

Next go to the S_ItemSave struct, click the New Variable button and call the new variable DecayTime and set it to Integer like the image below.

Next go to the S_InvSaveSlot struct and Click the New Variable button and call the new variable DecayTime and set it to Integer like the image below.

Next play in editor, this may take a while to load. Once the player character loads in you can exit play in editor.

Next go to the BP_SGKSaveGame then to the Save Item function and copy the video below.

Next go to the BP_SaveSystem and then to the Load Saved Items function and copy the video below.

Next go to the BP_ItemTooltip and connect the Inv Item to the Inv Item set node like the image below.

You have now finished the DIY Guide, to learn how to use the new decay system check out the Feature Guide below.

https://defusestudios.com/sgk-v2-item-decay/