• 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

    Upload page content

    You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

    File to load page content from
    Page name
    Comment

    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


    CategoryFunctions