User Tools

Site Tools


legacy:grid:api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
legacy:grid:api [2025/01/13 16:14] – ↷ Page moved from grid:api to legacy:grid:api superadminlegacy:grid:api [2025/01/13 16:14] (current) – ↷ Links adapted because of a move operation superadmin
Line 15: Line 15:
 When you decide the dimension of the grid, the maximum index is changed accordingly. i.e, if you put the dimension as ''8x3'' for width and height respectively, the maximum index is ''23'' resulted from 8 multiplied by 3 minus 1 (Because array started from index 0). And the script will automatically recognize the index 0 to 7 as the first row, 8 to 15 as the second row, and 16 to 23 as the last row. When you decide the dimension of the grid, the maximum index is changed accordingly. i.e, if you put the dimension as ''8x3'' for width and height respectively, the maximum index is ''23'' resulted from 8 multiplied by 3 minus 1 (Because array started from index 0). And the script will automatically recognize the index 0 to 7 as the first row, 8 to 15 as the second row, and 16 to 23 as the last row.
  
-Because the position is stored in a one-dimension array, so does the battler position. To determine the position, you have to make a nested array that represents the screen position of that said index. For example, this is the position setting in the 640x360 screen in [[grid:sample_game|the sample game]].+Because the position is stored in a one-dimension array, so does the battler position. To determine the position, you have to make a nested array that represents the screen position of that said index. For example, this is the position setting in the 640x360 screen in [[legacy:grid:sample_game|the sample game]].
 <code ruby> <code ruby>
 Position =  Position = 
Line 29: Line 29:
  
 ===== Getting Position ===== ===== Getting Position =====
-Getting the position is largely used in the [[grid:targeting|targeting system]] __and you're expected to know how to code ruby__. Here are the list of important functions to be used (in the script call).+Getting the position is largely used in the [[legacy:grid:targeting|targeting system]] __and you're expected to know how to code ruby__. Here are the list of important functions to be used (in the script call).
  
 ==== Neighbor direction ==== ==== Neighbor direction ====
Line 127: Line 127:
   return result   return result
 </code> </code>
-It will yield an array with the value as ''[1, 2, 3, 8, 9, 10, 11, 12, 17, 18, 19]''. Note that in this particular example, the source index is hardcoded to 14. However, it can also be replaced with many things like the user position or the ''@center_grid'' as explained in the [[grid:targeting|targeting system]] +It will yield an array with the value as ''[1, 2, 3, 8, 9, 10, 11, 12, 17, 18, 19]''. Note that in this particular example, the source index is hardcoded to 14. However, it can also be replaced with many things like the user position or the ''@center_grid'' as explained in the [[legacy:grid:targeting|targeting system]] 
    
 ===== Other Functions ===== ===== Other Functions =====
legacy/grid/api.1736784873.txt.gz · Last modified: 2025/01/13 16:14 by superadmin