Create A New 2D-Array (Data Fill with Object Instance Infos)


using JSON Pointer..

ASTER::ACTION::JSON::Create New 2D-Array & fill elements with infos of Active Object.

Creates a two-dimensional array at the path specified by the JSON Pointer.

  • This function creates a new two-dimensional array in the existing JSON expanded in memory.

  • When creating the array, it inserts the information of the active object into the array elements.

  • This command is for special purposes, not general use.

In the absence of preloaded JSON data, read more…

If there is no pre-loaded data, create a new JSON Object at the root and add an array.

In that case, specify the JSON Pointer directly under the root. The following description is possible:

"/NewArray"

The following description will result in an error:

"/test/NewArray"

/NewArray is known to be an array, but /test is a data structure, so it cannot be inferred whether it is an array or an object.


Function Overview

Create New JSON Array and fill elements :: Screenshot

Insert the information held by each instance of the active object into a JSON Array. The screenshot is a dump of the JSON data.

The layer number starts at index 1, and layer 0 does not exist.

Since ASTER:Rev.0.9.34, the data storage order has been changed to support MoveTowards. The latest information is as follows:

index data detail
0 X coordinate X coordinate of the instance
1 Y coordinate Y coordinate of the instance
2 spread id Sequencial number, matching the index number of the array (starting from 0)
3 Layer Number Layer number in the frame editor (starting from 1)
4 Current Animation Animation number (Animation Sequence) (default == 0 is “Stopped”)
5 Animation Direction Currently selected animation direction (number from minimum 0 to maximum 31)
6 Animation Frame Animation frame number (0 based index)

Due to the ongoing development of this feature, the inserted data may change with updates. Below is the list of obsoleted and added items.

Data Name Revision Add・Obsolete
Object Creation ID 0.8.xx Obsolete
Current Animation Num 0.9.15 Add

Parameter.1

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

JSON Pointer: Specify the insertion position of the array-type data.

If the key name is duplicated, it will be overwritten.

Create an array under the root with the key name "test", example of JSON Pointer:

"/test"

Parameter.3

Specify the number of array elements.

5

Add 5 arrays to the end of the array elements.

Retrieve and store the list of information of the object instances specified by Parameter.1 in the array created with the settings of Parameter.2. As a result, it becomes a two-dimensional array.

Reason for needing to specify elements

Because it is a command to copy the information of the reference instance.


Compensating for Lack of Instances

When the number of array elements inserted with the setting value of Parameter.3 is greater than the number of selected active object instances, each value of the already acquired instances is reused.

An example is shown below.

If the number of array elements is 7 and the number of target instances is 3,

{
     "test":[
          [100,200,  0, 0,  0,0,0],
          [500,200,  1, 0,  1,8,2],
          [300,200,  2, 1,  0,4,1],
          [100,200,  3, 0,  0,0,0],
          [500,200,  4, 0,  1,8,2],
          [300,200,  5, 1,  0,4,1],
          [100,200,  6, 0,  0,0,0],
     ]
}

The array elements are linked to the object instance information up to a certain point, but for instances that are insufficient relative to the number of elements, the values are reused.

{
     "test":[
          [100,200,  0, 0,  0,0,0], <!-- Information of instance A.0 -->
          [500,200,  1, 0,  1,8,2], <!-- Information of instance A.1 -->
          [300,200,  2, 1,  0,4,1], <!-- Information of instance A.2 -->
          [100,200,  3, 0,  0,0,0], <!-- Repeated from here :: Information of instance A.0 -->
          [500,200,  4, 0,  1,8,2], <!-- Information of instance A.1 -->
          [300,200,  5, 1,  0,4,1], <!-- Information of instance A.2 -->
          [100,200,  6, 0,  0,0,0], <!-- Repeated from here :: Information of instance A.0 -->
     ]
}

Only the Spread ID is incremented by +1 according to the number of elements, and the value is recorded.

This value completion specification may change in future updates. Rev.0.9.15