Quickstart
Last updated
Last updated
To get started with using the Ultimate Building System we'll need to set up a few settings.
First we want to create a new Resource Gathering Rates Data Asset. To do so, right click in the content browser head to miscellaneous and then click the Data Asset button.
This will present you with a new window with a bunch of options. Search for PDA_ResourceGahteringRateSettings
, click on it and then click the select button.
You should now have a new asset created, name it whatever you want, for demonstration purposes I'll be naming it DA_MyRateSettings.
Next you need to open the Settings Data Asset which you've just created, and then you need to add a few tags.
We'll start by filling in the Default Values.
This is required for the system to know about what an item is, and what a resource is when defined through tags.
Now we need to fill in the Base Rates.
The Base Resource Rates allows us to set a base value for how rate calculation is handled. We'll be covering more on gathering rates later in on this page.
The system uses a Resource Type Tag to determine gathering rates for specific tools. Example Resource Type: Ore Pickaxe Tool Rate: 1.2 Calculation: Base rate (0.8) × Tool Rate (1.2) = Final Rate: 0.96 Axe Tool Rate: 0.4 Calculation: Base rate (0.8) × Tool Rate (0.4) = Final Rate: 0.32 In this example, using a pickaxe results in a higher gathering rate (0.96) compared to using an axe (0.32) for the ore resource type.
We can now set up the Item Gathering Rate Modifiers.
The system uses a Resource Type Tag to determine gathering rates for specific tools. If we have the resource rate calculation type set to multiply then we'll end up with the results in the example below.
Resource Type: Ore
Pickaxe Tool Rate: 1.2
Calculation: Base Rate (0.8) × Tool Rate (1.2) = Final Rate: 0.96
Axe Tool Rate: 0.4
Calculation: Base Rate (0.8) × Tool Rate (0.4) = Final Rate: 0.32
Using a pickaxe results in a higher gathering rate (0.96) compared to using an axe (0.32) for the ore resource type.
Now that we've set up the setting we'll want to create a new Resource Node Blueprint. Right Click in the Content Browser and Select the Blueprint Class button
Note: It is strongly advised to use this class we're creating as your base for all future resource nodes, ensuring that the settings we've created earlier become the standard.
Then search for Resource Node
, for the purpose of this example I'll be using the BP_UGS_ResourceNode_HarvestCount
for this. This class allows us to easily create a resource node which will be depleted after it has been harvested within a certain amount of times. You can name this whatever suits your needs.
Next open up the newly created blueprint and make sure the Class Defaults is selected, and then set the Gathering Settings to the Settings we created earlier.
I am leaving Min Harvest Count, Max Harvest Count, and Gathering Rate Calculation Type at their default values, but you can change these and play around with them if you want to do so.
Under Lootable Items
I am adding the DA_Ore_Def
to the list of items I want to be looted by the player when the player successfully harvest this resource node.
To set up your character to harvest a resource node, we simply need to utilize the Try Gather interface function.
Simply send a trace out to hit a resource node, and then use the Try Gather function. The Gatherer tags are used for determining if a tool can harvest a specific node as well as being used for calculating the gathering rates.
Note: The blueprint code above is not meant for replication - Take a look in the BP_UGS_Character
class to see how you can make your character have gathering replication working in tandem with using the Animation Replication Component