Size: 1343
Comment:
|
← Revision 8 as of 2016-01-09 10:48:40 ⇥
Size: 1973
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);border-left-width:2px;color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px; " tableclass="wikitable"#F2F2F2 style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170); ">Usage: ||<style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170);">city.getAvailableTroop() || ||<#F2F2F2 style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170); ">Example: ||<style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170);">city.getAvailableTroop() || |
||<tablebgcolor="#F9F9F9" tablestyle="margin:1em 1em 1em 0px;border-style:solid;border-color:rgb(170, 170, 170);border-left-width:2px;color:rgb(0, 0, 0);font-family:sans-serif;font-size:13px;line-height:19.5px; " tableclass="wikitable"#F2F2F2 style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170); ">Usage: ||<style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170);">city.getAvailableTroop([Optional boolian]) || ||<#F2F2F2 style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170); ">Example 1: ||<style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170);">city.getAvailableTroop() || ||<#F2F2F2 style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170); ">Example 2: ||<style="padding:0.2em;border-left-width:2px;border-style:solid;border-color:rgb(170, 170, 170);">city.getAvailableTroop(true) || |
Line 8: | Line 9: |
This function also supports an optional boolean value (true/false). if this is true, the function will return only troops that are currently in the city. This is like the city.troops object, though this is editable. |
|
Line 9: | Line 12: |
echo "I have a total of {city.getAvailableTroop().carriage} transports assigned to this city" | echo "I have a total of {city.getAvailableTroop().carriage} transports assigned to this city." echo "Of that {city.getAvailableTroop().carriage} transporters, {city.getAvailableTroop(true).carriage} are currently in the city." |
Line 16: | Line 20: |
peasants militia scouter pikemen swordsmen archer lightCavalry heavyCavalry carriage ballista batteringRam catapult |
peasants militia scouter pikemen swordsmen archer lightCavalry heavyCavalry carriage ballista batteringRam catapult |
getAvailableTroop()
Usage: |
city.getAvailableTroop([Optional boolian]) |
Example 1: |
city.getAvailableTroop() |
Example 2: |
city.getAvailableTroop(true) |
This function returns an object with information about the troops attached to a city. It can give the total of all troops, a specific troop, or the troop upkeep in a city. It counts marching troops as well as those idle.
This function also supports an optional boolean value (true/false). if this is true, the function will return only troops that are currently in the city. This is like the city.troops object, though this is editable.
echo "I have a total of {city.getAvailableTroop().carriage} transports assigned to this city." echo "Of that {city.getAvailableTroop().carriage} transporters, {city.getAvailableTroop(true).carriage} are currently in the city."
The available properties for the object are:
foodConsumeRate peasants militia scouter pikemen swordsmen archer lightCavalry heavyCavalry carriage ballista batteringRam catapult