Repository navigation
Instantiable Constructors
Mtax edited this page Mar 27, 2025
·
1 revision
Instantiable Constructors are Script Assets, with code configuring Blueprint Objects, managing their Instances and containing Event Methods they are supplied with. Each Instantiable Constructor either is or inherits the
Each Instantiable Constructor can only have one Instance instantiated at a time. To operate multiple Instances, it needs to be constructed and instantiated again.
1. Create a new Script Asset and name it using the same name pattern as Blueprint Object that will use it.
2. In the Script Asset code, declare a constructor that inherits
3. Implement the Blueprint Object and declare a static
4. Add static methods with names of events that its Blueprint Object will operate, that were not inherited from
After performing above steps, the Instantiable Constructor is functional and can be configured further, such a by declaring modifiable properties with changed values or declaring a static
Instance constructor, which contains primary properties and methods used in their operations, each described below.
Each Instantiable Constructor can only have one Instance instantiated at a time. To operate multiple Instances, it needs to be constructed and instantiated again.
Destruction |
Elements |
destroyInstance() |
None |
Name |
Type |
Default |
Modifiable |
Description |
object |
Object |
Yes |
An Object Asset, the Instance of which will be created and operated by this constructor. |
|
instance |
undefined |
No |
Reference to the Instance operated by this constructor after it is created. |
|
priority |
{int} |
10 |
Yes |
The order in which repeatable events are executed by the Event Queue. The lower the number, the earlier it is executed during appropriate Event. The number 0 is implied to be the lowest value applicable and hence, the highest priority. |
stepEventQueue |
Yes |
The Priority Queue of the Event Queue into which the Event Method of the Step Event will be submitted, causing it to execute either only after a frame cycle is finished or every frame. |
Name |
Type |
Arguments |
Returns |
Description |
Various Event Methods
|
{method|function:null()} |
Not applicable. |
The function to execute by the Instance of object during its Event. This execution will be attempted every time that Event executes, so it should refer to an empty function when nothing is intended to be executed. |
|
getBaseInstanceData() |
{method} |
None. |
{struct} |
Returns a struct containing properties added or Built-In Instance Variables configured in the Instance created when createInstance() is called. At minimum, this struct must contain the reference to this constructor in its base property. |
createInstance() |
{method} |
{handle:instance} | On error: {noone} |
||
destroyInstance() |
{method} |
None. |
Uses Event Queue.instanceLayer to destroy the Instance referred to by the instance property and sets it to undefined. |
1. Create a new Script Asset and name it using the same name pattern as Blueprint Object that will use it.
2. In the Script Asset code, declare a constructor that inherits
Instance constructor.3. Implement the Blueprint Object and declare a static
object property with a value referring to its Object Asset.4. Add static methods with names of events that its Blueprint Object will operate, that were not inherited from
Instance, assigning their default value to null.
After performing above steps, the Instantiable Constructor is functional and can be configured further, such a by declaring modifiable properties with changed values or declaring a static
getBaseInstanceData() method, which would add or change the variables of the Instance. Then, it can be inherited by Constructors inheriting Instantiable Constructors.
Contents
The Hierarchy
● Event Queue● Blueprint Objects
● Instantiable Constructors
● Constructors inheriting Instantiable Constructors
Concepts