MoveTowards: TGTARR

ASTER::ACTION::MotionControl::MoveTowards: The mvt.Target is a JSON Array

MoveTowards: TgtArr is a motion template that uses XY coordinate data stored in an array as movement targets.

The object instance selected as mvt.Pursuer refers to the XY coordinates stored in the array and moves toward the target location.

Once the movement is completed, the motion group is automatically deregistered. Even after the motion group is deregistered, the selection information of instances chosen as mvt.Tgt or mvt.Prs remains.


Before Use:

Register the path referencing the JSON array containing XY coordinate data with ASTER.

Below is a sample JSON array containing XY coordinates:

{
    "xyCoords":[
        [100,100],
        [200,100],
        [300,100],
        [400,100]
    ]
}

Regarding the function that specifies the path to the JSON array for MoveTowards’s Group.A (mvt.Target), the path is designated using JSON Pointer, but it is part of the Motion Control functionality rather than the JSON functionality.

A similar JSON functionality concept called “Targeted JSON Pointer” exists, but paths specified using Targeted JSON Pointer cannot be used in MoveTowards:TgtArr.

function description
JSON :: JSON Pointer :: Set Targeted JSON Pointer General-Purpose Use
Motion&Control :: MvtUtil: Define an array path for MvT:TgtArr Dedicated to MoveTowards:TgtArr

Parameter.1

Enter the motion group name to register to the motion controller.

Even instances created from different objects can be grouped with the same motion group name and managed by the controller.

Instances already registered to the controller cannot be duplicately registered under a different group name.

Multibyte strings (such as Japanese) can also be used, but for practical purposes, short names in lowercase letters are recommended.

"test"

When using the name set to the active object as the motion group name for registration, send an empty string.

""

Parameter.2

8 parameters are serialized and transmitted.

"  60, +0, 0, 30, -1, false, 30, false "
argument Name type descriptions
60 timebound unsigned int Time until completion of operation, Frame Time
0 reserved.1 int Reserved area with no implementation (rev.1.0.x)
0 motion-type unsigned int Only 0 is implemented (rev.1.0.x)
30 Sleep Time unsigned int Time to pause via sleep, Frame Time
-1 Sleep Repetition int Number of sleep repetitions; -1 is infinite, 0 disables
false Sleep Begin Flag boolean Flag to enable sleep at the start of operation
30 Sleep Interval Value unsigned int Time until next sleep, Frame Time
false reserved.2 boolean Reserved area with no implementation (rev.1.0.x)
The unsupported parameters will be addressed in an update. rev.1.0.4

Time Bound

unsigned int

Time required to complete movement, application frame time. In an application running at 60 FPS, 60 corresponds to approximately one second.

A value to determine movement per unit time based on distance. Movement speed increases or decreases depending on the given conditions.

The specification calculates movement based on the measured distance to the target coordinate and the set time limit, so negative values cannot be assigned to the time limit.

Assigning 0 will cancel the movement.


Reserved.1

int

Assign 0. Reserved area, not implemented in ASTER rev.1.0.x. Will be supported in future updates.


Motion Type

unsigned int

Assign 0. Select uniform linear motion.

MoveTowards sub-motion type setting. ASTER rev.1.0.x does not support values other than 0. Future updates will add support.


Sleep Time

unsigned int

Sets the duration of movement suspension, application frame time. In an application running at 60 FPS, 60 corresponds to approximately one second.

Negative values cannot be assigned.


Sleep Repetition

int

Sets the number of times sleep resumes after it finishes. If sleep is not needed, assign 0.

-1 results in an infinite loop.


Sleep Begin Flag

boolean

Flag to determine whether movement starts with sleep enabled when MoveTowards is executed.

If true, sleep occurs first, then movement begins after sleep finishes.

If false, movement starts immediately and pauses when the time comes.


Sleep Interval

unsigned int

Sets the duration before the next sleep pause after sleep has ended. Application frame time.

Negative values cannot be assigned.


Reserved.2

boolean

Assign false.

Reserved area, not implemented in ASTER rev.1.0.x. Will be supported in future updates.


Regarding registration limits and reserved variables »

Maximum Number of Registrations Allowed

The maximum number of instances that can be registered in one motion group is 255. A motion group can register up to 255 groups per motion type.

Type Max Groups Max Instances (Per Group) Total Instances (Per Motion Type)
Null 255 255 255 x 255 = 65,025
Flp | Wrp 255 255 255 x 255 = 65,025
Flp | Wrp::SineWave 255 255 255 x 255 = 65,025
Orbital 255 255 255 x 255 = 65,025
MoveTowards 255 255 255 x 255 = 65,025

The above values are theoretical and exceed the processing capability of CF25, so operation will always be conducted below the maximum values.

Practically, it is assumed that all registered motions will operate with a total number of instances below 100.


About Reserved Variables

From the object instance variables, the reserved variables are as follows:

  1. Alt Variable[0] = Spread ID

  2. Alt Variable[1] = Motion ID

The above variables are used.

Alt Variable[0]

Sequential number. The last object instance created on the frame editor is assigned 0, and then each instance is assigned a value incremented by +1 in order. It is safe to overwrite with any value.

Alt Variable[1]

Motion type. Values ranging from 0 to 4 are assigned according to the motion type at the time of registration. It is a magic number to speed up database searches. If changed, the controller will not be able to search correctly, which is dangerous.

From rev.0.9.x onward, a method of not using Alt Variable[1] has been tested, and it is not used now, but it may be reverted, so please treat Alt Variable[1] as a reserved variable.


MoveTowards:TgtArr demonstration example

Minion Minion

The above demonstration example can be created in about 7 lines from the Event Editor of CF25.

Minion Minion