Size: 2834
Comment:
|
Size: 2873
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 13: | Line 13: |
||userName||String ||returns the player's name that owns the castle or valley, or null if unowned|| | ||userName ||String ||returns the player's name that owns the castle or valley, or null if unowned || |
Line 15: | Line 15: |
||name||String ||returns name of city, or "Barbarian's city", if coords are a valley it will return a string containing valley type: "Forest","Hill","Swamp","Flat",etc.|| | ||name ||String ||returns name of city, or "Barbarian's city", if coords are a valley it will return a string containing valley type: "Forest","Hill","Swamp","Flat",etc. || |
Line 18: | Line 18: |
||prestige||int ||returns prestige of owner of FieldId (or 0 if unowned) || ||honor ||int ||returns honor of owner of FieldId (or 0 if unowned) || |
||prestige ||int ||returns prestige of owner of !FieldId (or 0 if unowned) || ||honor ||int ||returns honor of owner of !FieldId (or 0 if unowned) || |
Line 21: | Line 21: |
||relation ||int ||returns number indicating color of flag: 0 = green flags, 1 = blue flags, 2 = grey flags, 3 = red flags (returns 0 for unowned valleys | ||relation ||int ||returns number indicating color of flag: 0 = green flags, 1 = blue flags, 2 = grey flags, 3 = red flags (returns 6 for unowned valleys) || |
Line 23: | Line 23: |
||state ||int ||Returns code indicating !PlayerState (status) || ||npc||Boolean ||Is city at indicated coords an NPC? Returns: True / False || |
||state ||int ||Returns code indicating [[Player State|PlayerState]] (status) || ||npc ||Boolean ||Is city at indicated coords an NPC? Returns: True / False || |
Line 32: | Line 32: |
Line 38: | Line 40: |
Player = 0 Enemy = 1 Same = 2 Friend = 3 Neutral = 4 Other = 5 NoAlliance = 6 |
Player = 0 Enemy = 1 Same = 2 Friend = 3 Neutral = 4 Other = 5 No Alliance (or No Relation) = 6 |
Line 58: | Line 53: |
mapCastleBean objects reference details about a location on the map.
mapCastleBean objects can be referenced as:
userDefinedObject.property
The .property at the end is how you will specify which detail you are referencing. Using the table below, you can for example get the name of the city with city.name.
Properties
Property |
Type |
Description |
id |
int |
Gives the FieldID of the mapCastleBean |
lastUpdated |
int |
time the information in the mapCastleBean was last updated |
userName |
String |
returns the player's name that owns the castle or valley, or null if unowned |
playerLogoUrl |
String |
returns path the the player's avatar icon, or null if unowned |
name |
String |
returns name of city, or "Barbarian's city", if coords are a valley it will return a string containing valley type: "Forest","Hill","Swamp","Flat",etc. |
allianceName |
String |
returns name of player's alliance or null if unallied or unowned. |
zoneName |
String |
returns name of state: "Franconia","Lombardy","Tuscany",etc. |
prestige |
int |
returns prestige of owner of FieldId (or 0 if unowned) |
honor |
int |
returns honor of owner of FieldId (or 0 if unowned) |
flag |
String |
returns the player's flag (or null if unowned/unoccupied) |
relation |
int |
returns number indicating color of flag: 0 = green flags, 1 = blue flags, 2 = grey flags, 3 = red flags (returns 6 for unowned valleys) |
furlough |
Boolean |
Is player at indicated coords in holiday? Returns: True / False |
state |
int |
Returns code indicating PlayerState (status) |
npc |
Boolean |
Is city at indicated coords an NPC? Returns: True / False |
changeface |
int |
not sure what this indicates. seems to always be 0. |
canLoot |
Boolean |
If you can loot from the coords. Returns: True / False |
canSend |
Boolean |
If you can send to the coords. Returns: True / False |
canScout |
Boolean |
If you can scout the coords. Returns: True / False |
canTrans |
Boolean |
If you can transport to the coords. Returns: True / False |
canOccupy |
Boolean |
If you can occupy the coords. Returns: True / False |
Related Functions
RelationIndex(mapCastleBean)
RelationIndex returns values from 0 ..6 as following:
Player = 0 Enemy = 1 Same = 2 Friend = 3 Neutral = 4 Other = 5 No Alliance (or No Relation) = 6
Examples
fid = GetFieldId(123,456) // convert coordinates into FieldId mcb = GetDetailInfo(fid) // retrieve mapCastleBean object containing details for specified FieldId if mcb == null repeat // if the server did not send updated info, repeat last step echo mcb.name echo mcb.allianceName echo mcb.prestige