A collection of game objects and components which help to quickly implement health, mana, stamina, overheat etc.
The plugin can be used in both C++ and Blueprint projects.
- Download package file;
- Install the plugin either in your project or for all projects in engine:
- Unzip the package into Plugins folder of your project, e.g.
D:\UnrealProjects\MyProject\Plugins
; - Unzip the package to the Plugins folder in engine folder, e.g.
C:\Program Files\Epic Games\UE_5.0\Engine\Plugins
;
- Unzip the package into Plugins folder of your project, e.g.
- Restart the project;
In this case the plugin can be used for any blueprint project.
- Create the Plugins folder in the project directory;
- Create the TrickyAnimationComponents folder in the Plugins folder;
- Download the plugin source code into that folder;
- Rebuild the project;
The plugin has:
- EntityResource object;
- SimpleEntityResource object;
- EntityResourcesLibrary;
- ResourceComponent;
- SimpleResourceComponent;
Main entity resource which can automatically increase and decrease current value.
ResourceData
- a struct with the basic parameters of the entity resource:Value
- current value;Maximum Value
- maximum value;UseCustomInitialValue
- toggles if the resource must have a customValue
on creation;InitialValue
- determines the custom value ofValue
on creation;
AutoIncreaseData
- a struct with basic parameters for auto increase of the resource:IsEnabled
- toggles if auto increase is enabled;Power
- the amount of the resource on whichValue
is increased every tick;Frequency
- how often the resource will increase per second;Thershhold
- ifValue
<=Threshold
, the auto increase will start;StartDelay
- a delay time after which auto increase starts. If == 0, it starts immediately;DisableOnValueZero
- if true, auto increase will be stopped ifValue
reached zero;
AutoDecreaseDta
- a struct with basic parameters for auto decrease of the resource:IsEnabled
- toggles if auto decrease is enabled;Power
- the amount of the resource on whichValue
is decreased every tick;Frequency
- how often the resource will decrease per second;Thershhold
- ifValue
<=Threshold
, the auto decrease will start;StartDelay
- a delay time after which auto decrease starts. If == 0, it starts immediately;DisableOnValueZero
- if true, auto decrease will be stopped ifValue
reached zero;
DecreaseValue
- decreasesValue
and clamps it to 0;IncreaseValue
- increasesValue
. IfClampToMax == true
, the Value will be clamped to MaxValue;DecreaseMaxValue
- decreasesMaxValue
. IfClampValue == true
andValue > MaxValue
,Value
will be clamped to MaxValue;IncreaseMaxValue
- increasesMaxValue
. IfClampValue == true
andValue < MaxValue
,Value
will be clamped to MaxValue;GetNormalisedValue
- returns normalised value of the resource;GetValue
- returnsValue
;GetMaxValue
- returnsMaxValue
;SetAutoIncreaseEnabled
- toggles auto increase;SetAutoDecreaseEnabled
- toggles auto decrease;SetAutoIncreaseData
- setsAutoIncreaseData
;SetAutodecreaseData
- setsAutoDecreaseData
;GetAutoIncreaseData
- returnsAutoIncreaseData
by reference;GetAutoDecreaseData
- returnsAutoDecreaseData
by reference;StartAutoDecrease
- starts auto decrease;StartAutoIncrease
- starts auto increase;StopAutoDecrease
- stops auto decrease;StopAutoIncrease
- stops auto increase;
OnValueDecreased
- called whenValue
was successfully decreased;OnValueIncreased
- called whenValue
was successfully increased;OnValueZero
- called whenValue
has reached zero;OnMaxValueDecreased
- called whenMaxValue
was successfully decreased;OnMaxValueIncreased
- called whenMaxValue
was successfully increased;OnAutoDecreaseStarted
- called when auto decrease was started;OnAutoIncreaseStrated
- called when auto increase was started;OnAutoDecreaseStopped
- called when auto decrease was stopped;OnAutoIncreaseStopped
- called when auto increase was stopped;
A simple version of the entity resource. It doesn't have auto increase/decrease functionality and uses int32.
ResourceData
- a struct with base parameters:Value
- current value;MaxValue
- max value;UseCustomInitialValue
- toggles ifValue = InitialValue
orValue = MaxValue
on resource creation;
DecreaseValue
- decreasesValue
;IncreaseValue
- increasesValue
. IfClampToMax == true
, it'll be clamped toMaxValue
;DecreaseMaxValue
- decreasesMaxValue
. IfClampValue == true
andValue > MaxValue
,Value
will be clamped to MaxValue;IncreaseMaxValue
- increasesMaxValue
. IfClampValue == true
andValue < MaxValue
,Value
will be clamped to MaxValue;GetNormalisedValue
- returns normalisedValue
;GetValue
- returnsValue
;GetMaxValue
- returnsMaxValue
;
OnValueDecreased
- called whenValue
was successfully decreased;OnValueIncreased
- called whenValue
was successfully increased;OnValueZero
- called whenValue
has reached zero;OnMaxValueDecreased
- called whenMaxValue
was successfully decreased;OnMaxValueIncreased
- called whenMaxValue
was successfully increased;
CreateEntityResource
- creates an EntityResource object.CreateSimpleEntityResource
- creates a SimpleEntityResource object.
A component which handles creating and controlling one EntityResource object.
ResourceData
- a struct with the basic parameters of the entity resource:Value
- current value;Maximum Value
- maximum value;UseCustomInitialValue
- toggles if the resource must have a customValue
on creation;InitialValue
- determines the custom value ofValue
on creation;
AutoIncreaseData
- a struct with basic parameters for auto increase of the resource:IsEnabled
- toggles if auto increase is enabled;Power
- the amount of the resource on whichValue
is increased every tick;Frequency
- how often the resource will increase per second;Thershhold
- ifValue
<=Threshold
, the auto increase will start;StartDelay
- a delay time after which auto increase starts. If == 0, it starts immediately;DisableOnValueZero
- if true, auto increase will be stopped ifValue
reached zero;
AutoDecreaseDta
- a struct with basic parameters for auto decrease of the resource:IsEnabled
- toggles if auto decrease is enabled;Power
- the amount of the resource on whichValue
is decreased every tick;Frequency
- how often the resource will decrease per second;Thershhold
- ifValue
<=Threshold
, the auto decrease will start;StartDelay
- a delay time after which auto decrease starts. If == 0, it starts immediately;DisableOnValueZero
- if true, auto decrease will be stopped ifValue
reached zero;
DecreaseValue
- decreasesValue
and clamps it to 0;IncreaseValue
- increasesValue
. IfClampToMax == true
, the Value will be clamped to MaxValue;DecreaseMaxValue
- decreasesMaxValue
. IfClampValue == true
andValue > MaxValue
,Value
will be clamped to MaxValue;IncreaseMaxValue
- increasesMaxValue
. IfClampValue == true
andValue < MaxValue
,Value
will be clamped to MaxValue;GetNormalisedValue
- returns normalised value of the resource;GetValue
- returnsValue
;GetMaxValue
- returnsMaxValue
;SetAutoIncreaseEnabled
- toggles auto increase;SetAutoDecreaseEnabled
- toggles auto decrease;StartAutoDecrease
- starts auto decrease;StartAutoIncrease
- starts auto increase;StopAutoDecrease
- stops auto decrease;StopAutoIncrease
- stops auto increase;
OnValueDecreased
- called whenValue
was successfully decreased;OnValueIncreased
- called whenValue
was successfully increased;OnValueZero
- called whenValue
has reached zero;OnMaxValueDecreased
- called whenMaxValue
was successfully decreased;OnMaxValueIncreased
- called whenMaxValue
was successfully increased;OnAutoDecreaseStarted
- called when auto decrease was started;OnAutoIncreaseStrated
- called when auto increase was started;OnAutoDecreaseStopped
- called when auto decrease was stopped;OnAutoIncreaseStopped
- called when auto increase was stopped;
A component which handles creating and controlling one SimpleEntityResource object.
ResourceData
- a struct with base parameters:Value
- current value;MaxValue
- max value;UseCustomInitialValue
- toggles ifValue = InitialValue
orValue = MaxValue
on resource creation;
DecreaseValue
- decreasesValue
;IncreaseValue
- increasesValue
. IfClampToMax == true
, it'll be clamped toMaxValue
;DecreaseMaxValue
- decreasesMaxValue
. IfClampValue == true
andValue > MaxValue
,Value
will be clamped to MaxValue;IncreaseMaxValue
- increasesMaxValue
. IfClampValue == true
andValue < MaxValue
,Value
will be clamped to MaxValue;GetNormalisedValue
- returns normalisedValue
;GetValue
- returnsValue
;GetMaxValue
- returnsMaxValue
;
OnValueDecreased
- called whenValue
was successfully decreased;OnValueIncreased
- called whenValue
was successfully increased;OnValueZero
- called whenValue
has reached zero;OnMaxValueDecreased
- called whenMaxValue
was successfully decreased;OnMaxValueIncreased
- called whenMaxValue
was successfully increased;
Add one of the components to the chosen actor if you need something simple.
If you need component with several resources, e.g. health points and armor. You have to create resource objects
using CreateEntityResource
or CreateSimpleEntityResource
functions.