Horizontal:Flip:Sinewave


ASTER::ACTION::ObjectControl::MOTION::Set Horizontal:Flip:Sinewave

Select the Motion Template Horizontal Flip :: Sinewave and register the object instance to the motion controller.

  • Flip is an action that continues moving by reversing when exceeding the specified area.

Motion: Overview

For horizontal movement, a virtual wall can be set at each coordinate on the left and right ends. When hitting the wall, the sign of the movement amount is reversed and it moves toward the opposite wall, repeating this routine.

When a collision (actually passing through coordinates) with a virtual wall is detected, an immediate execution condition is triggered, and the x|y coordinates or fixed values of the corresponding instance can be obtained from the dedicated conditions and expressions.

The amount of movement can be set as a floating point number. In the ASTER beta version, the minimum unit of movement was 1 frame time = 1 pixel, but the official version of ASTER achieves a finer resolution of movement.


Parameter.1

Object instance selection »

Select the object instance. Only the "Active (sprite) Object" Type can be registered to the controller.

Description of the image

If "The Active Object" is not specified, an error will be displayed when executing the action from the event, and the registration process will be aborted.


Parameter.2

Input the name of the motion group »

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.3

8 parameters are serialized and sent as one string.

"   +1.5 ,      300,       +1.0,        0,            72,         false ,      -40 ,     1000  "
No. Value Abbreviation Data Type Description
1 +1.5 x vel float X movement
2 300 amp int Amplitude width (pixels)
3 +1.0 ω float Angular velocity
4 0 setup ∠ int Initial setup angle
5 72 step ∠ int Step angle
6 false bool boolean Start in stopped state (true,false)
7 -40 wall-A int Virtual wall (left end) coordinate
8 1000 wall-B int Virtual wall (right end) coordinate

  • The amplitude is measured in pixels, so it must be an integer. (Subpixels are not supported)

  • Angular Velocity (omega = ω) is a floating-point number.

  • Setup Angle is the angle specified at the start of movement. It is used in combination with the Step Angle described later.

  • Step Angle is a parameter that changes the initial setup angle according to the number of object instances.

The initial setup angle is determined by adding the value of the Step Angle multiplied by the action loop index to the Setup Angle value.

SetupAngle = SetupAngle + (StepAngle * ActionLoopIndexNumber)

If there are 6 instances, and the initial setup angle is 0, and the step angle is 72, the calculation example is as follows:

    SetupAngle.1 ::   0 = 0 + ( 72 * 0 );
    SetupAngle.2 ::  72 = 0 + ( 72 * 1 );
    SetupAngle.3 :: 144 = 0 + ( 72 * 2 );
    SetupAngle.4 :: 216 = 0 + ( 72 * 3 );
    SetupAngle.5 :: 288 = 0 + ( 72 * 4 );
    SetupAngle.6 :: 360 = 0 + ( 72 * 5 ); // 360 is equivalent to 0

Additional Notes

As a dedicated command to change the amplitude width, GrowRadius for Sinewave can be used.


Registration Limit 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.