This is a guide on how to integrate Player Electricity System into Survival Game Kit V1.

Make a backup of you project before following this guide.

Start by migrating the PlayerElectricitySystem folder from the Player Electricity System project to your Survival Game Kit V1 project like the video below. Make sure the engine version of both projects is the same.

Collision


In the Survival Game Kit V1 project go to the Project Settings then go to the Collision category and copy the video below.

Next create the new Presets and copy the settings show in the images below.

Next edit the existing presets like shown in the video.

Next go to the BP_CableConnectionPointComponent and go to the Class Defaults then make sure the Preview Collision Channel is set to Preview.

Gamemode


Go to the BP_SurvivalGameMode blueprint and copy the video below.

Next go to the BP_MasterCharacter and copy the video below.

Open the E_BuildTypes in the content browser and add a new enumerator and call it Power like the image below.

At this point I recommend playing in editor, this will compile the effected blueprints, once the character loads in your can exit play in editor.

Player Building Component


Next go to the BP_PlayerBuildingComponent, create a new variable called PlayerPowerComponent and set its type to BP_PlayerPowerComponent then copy the images below, locations at the top of the screenshots.

Go to the Is Valid Build Part? macro and connect the Power pin to the Is Valid output.

Next go to the Select Delete Grid Event collapsed node and add the nodes shown below, then connect them to the Power output pin on the Switch node.

Next I recommend playing in editor, this will compile the effected blueprints, once the character loads in your can exit play in editor, I also suggest clicking save all in the content browser to save your progress.

Player Power Component


Go to the BP_PlayerPowerComponent then go to its Class Defaults and copy the settings shown in the image below.

Create a new variable called PlayerInventory and set its type to BP_PlayerInventoryComponent.

Then copy the images below, locations at the top of the screenshots.

Master Power Device


Go to the BP_MasterPowerDevice and copy the video below.

Copy the image below, location at the tops of the image.

Go to the GetDeviceOwners function and create a new local variable called OwnersL and set its type to Text then set it to an Array. Then copy the image below.

Copy image below, location at the top of the screenshot.

Select the Mesh component in the Components then in the Details search for Visibility and untick Visible.

Copy the video below,

Copy the image below, create the Set Render Custom Depth node first then connect the GetComponentsByClass nodes output to the target pin.

Next select the BP_HealthComponent in the Components panel and delete it.

Next create a new variable called BuildPartRow and set its type to DataTableRowHandle, tick on Instance Editable, then in the variables class defaults set the Data Table to BuildPartList and leave the Row Name set to None like the image below.

Next copy the image below, location in the Placement collapsed node.

Master Build Part


Go to the BP_MasterBuildPart and copy the image below, location at the top of the image.

UI


Next go to the BP_DeviceHealth widget, then go to the UpdateWidget function and create a new local variable, call it BuildPartL and set its type to BP_MasterBuildPart. Then copy the images below.

Next I recommend playing in editor this will compile the effected blueprints, then once the character loads in exit play in editor. I also recommend clicking save all in the content browser.

Save System


Go to the BP_PowerGameModeComponent and copy the image below.

Next go to the BP_SurvivalGameSave and copy the video below,

Next go to the BP_InventorySaveSystem and then go to the Load Master Build Parts function and create a new local variable called IndexL and set its type to Integer. Then copy the image below.

Next copy the video below,

Then copy the images below,

Next go to the Save Master Build Part function and create a new local variable called IndexL and set its type to Integer. Then copy the images below.

Interaction


Go to the BP_Switch and copy the video below,

Then copy the image below,

Make sure you have ticked on Intractable in the Class Defaults.

Next go the BP_ElectricDoor and copy the video below,

Then copy the image below,

Then go to the BP_Generator and copy the video below,

Next copy the image below,

Adding Build Parts


You will need to create new row entries in the Build Part List for each power device, you will also need to create an item for each device in the ItemList then you will need to create new world item blueprints for each of those items.

Below is an example how to setup these build parts and items, you will need to do the same for the rest of the devices. You can see a second example (here) for the large battery.

Click the Add button to add a new row to the BuildPartList, then double click the row name in the bottom left corner and set the device name. Then go though and set the build part details, make sure you set the Type to Power and make sure you set the Blueprint Class to the devices blueprint.

Next go to the ItemList and create a new row by selecting the Add button, then double click the row name in the bottom left corner and rename the row to the device name.

Your Row Name in the ItemList MUST be the same as the Row Name of the build part in the BuildPartList!

Then go though and set the item details, make sure you add the Place action to the InventoryActions setting. You can set the other item details like Icon, description, static mesh etc.

Next return to the Build Part List and select the devices row in the data table, then open the Building Cost settings, then select Item 1 and set the Data Table to ItemList, then set the Row Name to the entry you just added to the ItemList like the image below. You can also set the Item 1 Count of that item required to place the device.

Next in the content browser go to the SurvivalGameKit/Blueprints/Items/WorldItems folder, then duplicate BP_9mmRound_WI blueprint and rename it to your device name, so for example BP_Cable_WI.

Then open that blueprint and go to the Class Defaults and find the Item setting, then change the Row Name to your devices row name in the ItemList like the image below.

Lastly open the device blueprint in the PlayerElectricitySystem/Blueprints/Devices so for example the BP_MasterCable then in its Class Defaults search for the Build Part Row setting then set its Data Table to BuildPartList and set its Row Name to the devices row name from the BuildPartList like the image below.

You can now drag the new device world item you created in the WorldItems folder into the level from the content browser for the player to pickup in game.

Keep in mind you will need to repeat these steps for each device, the cable wont be placeable until its snapped to a socket on anther device. You can see a second example (here).

Other Blueprints


Go to the BP_DamageZone and select the Damage Zone component in the components panel, then copy the collision settings shown below.

Go to the BP_BuildingBlockZone and select the Building Block Zone component in the components panel, then copy the settings shown in the image below.

Go to the BP_DamageBlockZone and select the Safe Zone component in the components panel, then copy the settings shown in the image below.

Go to the BP_PlayerInventoryComponent and copy the code below, location at the top of the screenshot.

You may want to remove HUD elements from the power HUD, there is a guide here on changing the HUD which includes instruction on removing the controls and resources panels.