-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the XPropertyDemo wiki!
- Download the
XPropertyplugin from FAB using EpisGames Launcher. - Enable the
XPropertyplugin in your project!
- If you downloaded the plugin from another source, place it in the project folder. The plugin path will look like this:
YourProject/Plugins/XProperty
You can change the values of variables simply by knowing their type and name! Simply call one of the following functions to change the variable!
SetFloatPropertyValueInObject
SetIntPropertyValueInObject
SetObjectPropertyValueInObject
SetSoftObjectPropertyValueInObject
SetBoolPropertyValueInObject
SetNamePropertyValueInObject
SetBytePropertyValueInObject
To get the value of a variable, call one of the following functions
GetFloatPropertyValueInObject
GetIntPropertyValueInObject
GetObjectPropertyValueInObject
GetSoftObjectPropertyValueInObject
GetBoolPropertyValueInObject
GetNamePropertyValueInObject
GetBytePropertyValueInObject
To create temporary storage for a variable, use one of the following functions
MakeFloatPropertyAttribute
MakeIntPropertyAttribute
MakeObjectPropertyAttribute
MakeSoftObjectPropertyAttribute
MakeBoolPropertyAttribute
MakeNamePropertyAttribute
MakeBytePropertyAttribute
Attributes are very useful when you need to initialize an object, but each object can have different parameters. As an example, we will initialize a simple Actor
- Open any Actor and create an array of
XPropertyAttributein it.
- Make this variable
InstanceEditableandExposeOnSpawn
- Now on
BeginPlaylet's initialize our variables
- Create a float variable and name it
Health
- Let's now display our
HealthonBeginPlayusing PrintString
- Now open
LevelBlueprintand spawn our test Actor. Also, using theMakeArrayandMakeFloatPropertyAttributefunctions, pass the value to the Actor
- Click
Playand you will see that the value has been set!
In this way you can initialize different dynamic parameters of different Objects or Actors.
- This is also very convenient when you have child classes. For example, let's create a child Actor Blueprint from our test Actor.
- Open it and create a variable of type
intin it and name itCount
- Also, on
BeginPlayafter the Parent function, usePrintStringto display this value.
- Move these two Actors to the level
- Now, we know that our Parent Actor has only a variable
Health, and the Child Actor has two variablesHealthandCount. So select yourParent Actorin the level and in theDetailspanel add one element to the arrayXPropertyFloatAttribute
And in the Child Actor, add two elements: XPropertyFloatAttribute and XPropertyIntAttribute

- Click
Playand you will see that the values have been set correctly.
You can also use this variable type for DataAsset to store different parameters for different types of objects. This is very convenient, for example, for systems like inventory.
You can also use Cast to determine what type of variable is used and get the values manually.
If for some reason your attribute array is cleared after compiling the blueprint in which this variable is located, then use the XPropertyAttributes structure instead of a regular array of XPropertyAttribute objects.