<?xml version="1.0" encoding="utf-8"?>
<s1 title="FieldId"><p>The FieldId is a number between 0-63999 (at least on 800x800 grid servers) </p>
<p>Each FieldId is directly related to a coordinate pair, the game server uses <jump href="/wiki/MapFunctions#G">FieldIds</jump> to reference all the squares on the map... 0,0 has fieldId of 0.... 1,0 has fieldId of 1... 799,0 has fieldId of 799... 1,1 is fieldId 800... there is a direct mathematical relationship between the coords and the fieldId. Many of the advanced scripting functions require you to convert your coordinates into fieldIds to use them. </p>
<p>You can convert x and y into FieldId using this forumla: </p>
<p>FieldId = x+(y*800) </p>
<p>Alternately, you can use the NEAT <jump href="/wiki/MapFunctions#G">GetFieldId(coords)</jump> function to convert a set of coords into a FieldId </p>
<p>You can convert fieldId back into x and y using this forumla: </p>
<p>x = fieldId MOD 800 </p>
<p>y = floor(fieldId / 800) </p>
<p>Or you can use </p>
<p><jump href="/wiki/FieldIdToCoords" class="nonexistent">FieldIdToCoords</jump>(fieldId) </p>
<p></p>

<br/>------------------------------------------------------------------------------<br/>
<p> </p>

<br/>------------------------------------------------------------------------------<br/>
<p> <jump href="/wiki/CategoryConstants">CategoryConstants</jump> </p>
</s1>