设置栅格值


描述

通过此动作,你可以获取网格数据结构中特定单元格的值。提供保存网格索引的变量(由创建网格动作返回) ,然后给出要获取的单元格的x和y位置(列和行)。The value can be any valid data type, but the x and y position must be whole integers within the bounds of the grid.


动作语法:

Set Grid Value Syntax


参数:

参数 描述
网格 The index (stored in a variable) of the grid to set
x The cell position along the x axis to set (the column)
y The cell position along the y axis to set (the row)
The value to set the grid cell to


例如:

Set Grid Value Example
The above action block code creates a new grid data structure and holds its index value in a global variable. It then iterates through all the instances in the room and adds their unique ID value into the cell that corresponds to their position.