<?xml version="1.0" encoding="utf-8"?>
<s1 title="getTravelTime"><p>this function will return the time in seconds it takes to march from point A to point B using a particular type of troops, taking into account player&apos;s relevant tech levels for compass or horseback riding. </p>
<p></p>
<s2 id="usage:" title="usage:">
<p>city.getTravelTime(fieldId1,fieldId2,troopBean,type) </p>
<p>fieldId1 and fieldId2 are the <jump href="/wiki/FieldId">fieldId</jump>&apos;s which represent coordinates for point A and B, troopBean is a special object representing a single wave of troops of any type or combination, and type can be 2 for transport or reinforcement waves or 5 for attack or scout waves. </p>
<p></p>
</s2>
<s2 id="example:" title="example:">
<p></p>
<source><![CDATA[coords = "123,456"
targetId = GetFieldId(coords)
// converts coords into fieldId

troops = "s:100k"
troopBean = GetTroops(troops)
// converts troop string into troopBean object

transTime = city.getTravelTime(city.fieldId, targetId, troopBean, 2)  // returns time to transport or reinforce target coords in seconds - from point A (city.fieldId) to point B (targetId) using specified troopBean

attackTime = city.getTravelTime(city.fieldId, targetId, troopBean, 5)  // returns time to send attack or scout to target coords in seconds - from point A (city.fieldId) to point B (targetId) using specified troopBean]]></source><p></p>
</s2>
<s2 id="Related Functions:" title="Related Functions:">
<p><jump href="/wiki/GetFieldId" class="nonexistent">GetFieldId()</jump> </p>
<p><jump href="/wiki/GetTroops">GetTroops()</jump> </p>

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