<?xml version="1.0" encoding="utf-8"?>
<s1 title="Map"><p>mapCastleBean objects reference details about a location on the map. </p>
<p><strong>mapCastleBean objects can be referenced as:</strong> </p>
<ul><li><p><em>userDefinedObject.property</em> </p>
</li>
</ul>
<p>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 c<em>ity.name</em>. </p>
<p><strong>Properties</strong> </p>
<table><strong class="highlight"><![CDATA[]]></strong><tr><td><strong class="highlight"><![CDATA[]]></strong><p><strong>Property </strong> </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p><strong>Type</strong> </p>
</td><td><strong class="highlight"><![CDATA[]]></strong><p><strong>Description </strong> </p>
</td></tr><tr><td><p>id </p>
</td><td><p>int </p>
</td><td><p>Gives the FieldID of the mapCastleBean </p>
</td></tr><tr><td><p>lastUpdated </p>
</td><td><p>int </p>
</td><td><p>time the information in the mapCastleBean was last updated </p>
</td></tr><tr><td><p>userName </p>
</td><td><p>String </p>
</td><td><p>returns the player&apos;s name that owns the castle or valley, or null if unowned </p>
</td></tr><tr><td><p>playerLogoUrl </p>
</td><td><p>String </p>
</td><td><p>returns path the the player&apos;s avatar icon, or null if unowned </p>
</td></tr><tr><td><p>name </p>
</td><td><p>String </p>
</td><td><p>returns name of city, or &quot;Barbarian&apos;s city&quot;, if coords are a valley it will return a string containing valley type: &quot;Forest&quot;,&quot;Hill&quot;,&quot;Swamp&quot;,&quot;Flat&quot;,etc. </p>
</td></tr><tr><td><p>allianceName </p>
</td><td><p>String </p>
</td><td><p>returns name of player&apos;s alliance or null if unallied or unowned. </p>
</td></tr><tr><td><p>zoneName </p>
</td><td><p>String </p>
</td><td><p>returns name of state: &quot;Franconia&quot;,&quot;Lombardy&quot;,&quot;Tuscany&quot;,etc. </p>
</td></tr><tr><td><p>prestige </p>
</td><td><p>int </p>
</td><td><p>returns prestige of owner of FieldId (or 0 if unowned) </p>
</td></tr><tr><td><p>honor </p>
</td><td><p>int </p>
</td><td><p>returns honor of owner of FieldId (or 0 if unowned) </p>
</td></tr><tr><td><p>flag </p>
</td><td><p>String </p>
</td><td><p>returns the player&apos;s flag (or null if unowned/unoccupied) </p>
</td></tr><tr><td><p>relation </p>
</td><td><p>int </p>
</td><td><p>returns number indicating color of flag:  0 = green flags, 1 = blue flags, 2 = grey flags, 3 = red flags, 6 = unowned valleys or unallied castles </p>
</td></tr><tr><td><p>furlough </p>
</td><td><p>Boolean </p>
</td><td><p>Is player at indicated coords in holiday? Returns: True / False </p>
</td></tr><tr><td><p>state </p>
</td><td><p>int </p>
</td><td><p>Returns code indicating player state or status: 1 = peace, 2 = truce, 3 = beginner, 5 = holiday, 6 = dream truce </p>
</td></tr><tr><td><p>npc </p>
</td><td><p>Boolean </p>
</td><td><p>Is city at indicated coords an NPC? Returns: True / False </p>
</td></tr><tr><td><p>changeface </p>
</td><td><p>int </p>
</td><td><p>not sure what this indicates. seems to always be 0. </p>
</td></tr><tr><td><p>canLoot </p>
</td><td><p>Boolean </p>
</td><td><p>If you can loot from the coords. Returns: True / False </p>
</td></tr><tr><td><p>canSend </p>
</td><td><p>Boolean </p>
</td><td><p>If you can send to the coords. Returns: True / False </p>
</td></tr><tr><td><p>canScout </p>
</td><td><p>Boolean </p>
</td><td><p>If you can scout the coords. Returns: True / False </p>
</td></tr><tr><td><p>canTrans </p>
</td><td><p>Boolean </p>
</td><td><p>If you can transport to the coords. Returns: True / False </p>
</td></tr><tr><td><p>canOccupy </p>
</td><td><p>Boolean </p>
</td><td><p>If you can occupy the coords. Returns: True / False </p>
</td></tr></table><p><strong>Related Functions</strong> </p>
<p>RelationIndex(mapCastleBean) </p>
<p>RelationIndex returns values from 0 ..6 as following: </p>
<p>0 = Player </p>
<p>1 = Enemy </p>
<p>2 = Same </p>
<p>3 = Friend </p>
<p>4 = Neutral </p>
<p>5 = Other </p>
<p>6 = No Alliance (or No Relation) </p>
<p><strong>Examples</strong> </p>
<ul><li><source><![CDATA[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]]></source></li>
</ul>
<p></p>

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