Foliage Plugin – Getting Started

Enable the Foliage Plugin

Create the Foliage DataTable

Create a new Foliage Blueprint Actor (FoliagePluginActor) child

In Project Settings > Foliage Plugin > Set your newly created Foliage DataTable and Foliage Actor

When Painting / Spawning Foliage, you must change the default foliage component to “FoliagePluginComponent”

Make sure your collision settings for your foliage is set to BlockAll, or your own custom collision channel

(this is only required for interacting with the foliage instances)

Add a new Entry in the Foliage DataTable, in this example we’re creating a Tree Resource

You must make sure that the Mesh you paint (or spawn) is the same in the Foliage DataTable so that the Foliage Plugin knows what to do with it.

Inside your Character (or Controller) Blueprint, Implement the Foliage Plugin Interface

Example of adding resources to your inventory when a Foliage is damaged (harvested)

Interacting with the Foliage Plugin Example

This example uses a line trace from the Players point of view to “Apply Point Damage”
Damage is handled by the Foliage Plugin and will convert your Foliage Instance to a useable / interactable foliage actor automatically.

Configuring Sockets

Begin by adding your building to the DT_Buildings DataTable

Add a new socket to the CompatibleSocketNames array, here you determine what sockets that this building component can be placed on, in this example, Door is our compatible socket name, every building that has the socket “Door” we will be able to snap our new building to.

Inside /BuildingSystem/Meshes, open up any mesh that require a “Door” (can be anything), in this example, we’ll use “SM_Simple_Cottage

Once the Static Mesh Editor is open, in the lower right corner you’ll find the Sockets editor

Create a new socket and name it “Door

 

In the “Preview Static Mesh” selector, pick the “SM_Simple_Door” mesh as a preview mesh so that we can position it correctly

 

Use the preview window to move the door into the correct position

You can do this for anything you want to “snap” onto a building

Done!

Simple Building System 1.2 Update

Version 1.2 is now available on the UE4 Marketplace!

  • Added a Health system to finished buildings, use Q to apply damage to a finished building
  • Added a damage system
  • Added destruction system to buildings
  • Added socket placement for buildings
  • Added visual sockets for placement locations
  • Major changes in the C-Foliage component, a lot of improvements

Configuring Sockets

You can get the building system here: https://www.unrealengine.com/marketplace/simple-building-system

Simple Building System Sockets

The socket system is an easy way to determine the location of a new building that you want to place in the world.

There is a new array in the DT_Buildings DataTable that allows you to specify what sockets that this building is compatible with, for example: The door building is compatible with a Door socket

Visual Sockets

You have the option to toggle the creation of visible placement sockets in the world (DT_Buildings)

Farming System 1.1 Update

The Farming System 1.1 Update contains a lot of fixes and improvements

Max Harvesting Distance

Making the player unable to harvest and water plants when exceeding the set range.

Removed several blueprint interface functions
Replaced with a single Struct instead (PlantState)

Cleaned up a lot of the variables and functions in the BP_FarmActor
Replaced with PlantState Struct instead

Close Plant Selection Widget

This option will close The Plant Selection Widget when you’ve planted a new seed.

Farm Actor To Spawn

You can now choose which farm actor to spawn (2 versions are available, the one placed on the ground, and one with legs)

Alot of other fixes and improvements as well.