MoveTowards: Swap.EPs


ASTER::ACTION::MotionControl::MoveTowards: Pair & Swap XY Positions (Group A-B)

“Group A” and “Group B” are selected, paired based on selection order, and their instances’ positions are swapped within the given time.

“MoveTowards: SwapEPs” selects instances separately as mvt.Target and mvt.Pursuer, pairs them one-to-one based on selection order, and swaps their positions within the specified time.

A similar function, MoveTowards: SwapTgt, simplifies the selection process and the number of selections.


Function Pairing Target Operation
SwapTgt Same group (mvt.Target) Create pairs based on selection order and swap positions
SwapEPs Different groups (mvt.Target and mvt.Pursuer) Create pairs based on selection order and swap positions

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

The action of pairing instances and swapping their positions within a given time is defined as MoveTowards: Swap.

mvt.Target and mvt.Pursuer selection can be managed using the following utility (MvtUtil) designed for MoveTowards.



Instance data selected as mvt.Target can be exported to JSON.



Experimental feature: Cache instances to be linked.



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, false, 0,    30, -1, false, 30,    false "
argument Name type descriptions
60 timebound unsigned int Time until completion of operation, Frame Time
false EvD: Motion Start Boolean Event Detection Flag (rev.1.0.5)
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 EvD: Motion Close Boolean Event Detection Flag (rev.1.0.5)
The parameter specifications of MoveTowards have been partially modified. Parameters from rev.1.0.4 and earlier will not work in rev.1.0.5.

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.


EvD Flag: about to start moving

boolean

Event Detection Flag: if true, the condition runs once immediately before an instance starts moving.


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.


EvD Flag: Right after reaching the target coordinates

boolean

Event detection flag: if true, an immediate execution condition that runs once right after the instance reaches the target coordinates.


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.


Note

mvt.Target and mvt.Pursuer are recorded in ASTER based on their selection order, and pairs are formed accordingly.

When forming instance pairs, if there are unpaired instances left, the SwapEPs specification skips processing those instances.

The SwapTgt specification always requires selecting two instances, ensuring that no unpaired instances remain.