• My Pages
  • Comments
  • Add Link
  • Subscribe
  • Subscribe User
  • Edit (GUI)
  • Edit (Text)
  • Rename Page
  • Copy Page
  • Load Page
  • Save Page
  • Delete Page
  • Attachments
  • Check Spelling
  • Diffs
  • Info
  • Revert to this revision
  • XML
  • Render as Docbook
  • Print View
  • Raw Text
  • Delete Cache
  • Like Pages
  • Local Site Map
  • Remove Spam
  • Package Pages
  • Sync Pages
    • Diff for "FieldId"
    Differences between revisions 8 and 9
    Revision 8 as of 2015-05-23 20:04:02
    Size: 940
    Editor: tech
    Comment:
    Revision 9 as of 2015-05-23 20:05:55
    Size: 935
    Editor: Inanna
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 3: Line 3:
    Each FieldId is directly related to a coordinate pair, the game server uses FieldIds 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. Each FieldId is directly related to a coordinate pair, the game server uses [[MapFunctions#GetFieldId|FieldIds]] 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.
    Line 9: Line 9:
    Alternately, you can use the NEAT [[http://guide.neatportal.com/wiki/MapFunctions#GetFieldId|GetFieldId(coords)]] function to convert a set of coords into a FieldId Alternately, you can use the NEAT [[MapFunctions#GetFieldId|GetFieldId(coords)]] function to convert a set of coords into a FieldId

    The FieldId is a number between 0-63999 (at least on 800x800 grid servers)

    Each FieldId is directly related to a coordinate pair, the game server uses FieldIds 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.

    You can convert x and y into FieldId using this forumla:

    FieldId = x+(y*800)

    Alternately, you can use the NEAT GetFieldId(coords) function to convert a set of coords into a FieldId

    You can convert fieldId back into x and y using this forumla:

    x = fieldId MOD 800

    y = floor(fieldId / 800)

    Or you can use

    FieldIdToCoords(fieldId)



    CategoryConstants

    FieldId (last edited 2015-05-23 20:05:55 by Inanna)