Skip to main content

Econony Kit Setup

Step 0 - Pre Setup

When opening the project locate your own character and controller and open both. Locate to Game/EconomyKit/Examples and open both the examplecharacter and examplecontroller.


Step 1

From the Example controller copy everything from the Event Graph into the Event graph of your controller. - Hitting compile will create an error. Rigth click the SET inventory and SET Vendor and click “Create variable”. Hitting compile again will remove these errors.

caution

Unreal Engine 4.20+

From 4.20 and up, if you also copy the node after Begin Play, the node after begin play will show in full red wires. To fix this, simply delete that node, press compile, right click and search for LOCAL event, and spawn the event again. (pre and post pictures shown below.)


Step 2

Next go to Your character blueprint and in Class Settings add the Interface called “Economy Interface”. Next in the Components tab add the component called “EconomyComp”.

Step 3

From the example character copy everything located at the top of the Event Graph into your own Character Event Graph. NOTE: It is important you do the previous step first.

Step 4

After doing this, you will get compile errors. To fix these, search for all the grayed out “EconomyComponent” variables, and switch them with the BP_EconomyComp variable(auto created from adding the BP_EconomyComp to your character). Then delete the old EconomyComponent variables.

Step 5

In your own Character in the automatically created function HasEnoughSpace hook up the HasEnoughSpace function from the Economy Comp.

Step 6

Before you can use it you will need to change the CAST node in the Event Graph of your Character.

Change this to Your controller and get the Inventory and Vendor variables from it and use those instead.

caution

Unreal Engine 4.20+

From 4.20 and up, if you also copy the node after Event Possessed, the node after Event Possessed will show in full red wires. To fix this, simply delete that node, press compile, right click and search for Local_Possessed event, and spawn the event again.