User Tools

Site Tools


4rpl:commands:fc

Differences

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

Link to this comparison view

Next revision
Previous revision
4rpl:commands:fc [2021/01/08 16:01] – external edit 127.0.0.14rpl:commands:fc [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
-<=[[4rpl:start| Index]]+<=[[4rpl:start| Index]] \\ 
 +<=[[4rpl:start#math_utility| Math Utility]]
  
 +<WRAP tabs>
 +  * [[4rpl:commands:FC|FC]]
 +  * [[4rpl:commands:UFC|UFC]]
 +</WRAP>
 ====== FC ====== ====== FC ======
 FC(<-cellX <-cellZ) ->flatCell FC(<-cellX <-cellZ) ->flatCell
Line 8: Line 13:
 Takes a map cell coordinate and returns a flattened cell location. The flat cell location is equal to: cellX + cellZ * MAP_WIDTH Takes a map cell coordinate and returns a flattened cell location. The flat cell location is equal to: cellX + cellZ * MAP_WIDTH
 Note: THe X and Z coordinates will be clipped to the map bounds. So values less than 0 are permuted to 0, x is limited to MAP_WIDTH-1, etc. Note: THe X and Z coordinates will be clipped to the map bounds. So values less than 0 are permuted to 0, x is limited to MAP_WIDTH-1, etc.
 +
 +See [[UFC]] for the reverse calculation.
 ===== Examples ===== ===== Examples =====
 <code 4rpl> <code 4rpl>
4rpl/commands/fc.1610121708.txt.gz · Last modified: 2025/02/14 14:56 (external edit)