• My Pages
  • Comments
  • Add Link
  • Subscribe
  • Subscribe User
  • 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
    • Diff for "Army"
    Differences between revisions 2 and 44 (spanning 42 versions)
    Revision 2 as of 2012-10-23 13:41:46
    Size: 3142
    Editor: Inanna
    Comment:
    Revision 44 as of 2012-11-27 14:37:24
    Size: 4402
    Editor: Romulus
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 1: Line 1:
     ## page was renamed from ArmyBean
    ## page was renamed from Object ArmyBean
    Line 3: Line 4:
    m_city.cityManager.selfArmies[0].missionType The Army objects can reference details about the armies marching to or from your cities.
    Line 5: Line 6:
    m_city.cityManager.selfArmies[0].king '''Incoming enemy armies can be referenced as: '''
    Line 7: Line 8:
    m_city.cityManager.selfArmies[0].startFieldId  . ''m_city.cityManager.enemyArmies[x].property '''or''' city.enemyArmies[x].property''
    Line 9: Line 10:
    m_city.cityManager.selfArmies[0].targetPosName '''Incoming friendly armies can be referenced as: '''
    Line 11: Line 12:
    m_city.cityManager.selfArmies[0].direction  . ''m_city.cityManager.friendlyArmies[x].property '''or''' city.friendlyArmies[x].property''
    Line 13: Line 14:
    m_city.cityManager.selfArmies[0].restTime '''Your own armies can be referenced as: '''
    Line 15: Line 16:
    m_city.cityManager.selfArmies[0].startTime  . ''m_city.cityManager.selfArmies[x].property '''or''' city.selfArmies[x].property''
    Line 17: Line 18:
    m_city.cityManager.selfArmies[0].startPosName The ''[x]'' will signify which army it is - starting with 0 being the first one. If you had 6 marching farm crews for example, you would reference these with ''city.selfArmies[0].property'' through ''city.selfArmies[5].property''.
    Line 19: Line 20:
    m_city.cityManager.selfArmies[0].heroLevel 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 lord name of the person that the third incoming attack wave belongs to with ''city.enemyArmies[2].king ''
    Line 21: Line 22:
    m_city.cityManager.selfArmies[0].reachTime Some properties can have further details, for example resource and troop. Click the links in the table below to get the extra types of properties these can have. As an example, to see how much food your first returning npc farming crew is carrying, you could use ''city.selfArmies[0].resource.food''. Another example, using troops, lets you check how many scouts are in the second incoming reinforcement from your alliance mate by using'' city.friendlyArmies[1].troop.scouter.''
    Line 23: Line 24:
    m_city.cityManager.selfArmies[0].hero '''Properties'''
    ||<tablewidth="796px" tableheight="123px"#cccccc>'''Property ''' ||<#cccccc>'''Type''' ||<#cccccc>'''Description ''' ||
    ||alliance ||String ||Alliance of the player who sent the army ||
    ||armyId ||int ||army ID ||
    ||[[ArmyDirection|direction]] ||int ||The direction the army is travelling, 1 = marching, 2 = returning ||
    ||hero ||String ||The name of the hero sent with the wave ||
    ||heroLevel ||int ||The level of the hero sent with the wave ||
    ||king ||String ||Lord name of the player who sent the army ||
    ||[[MissionType|missionType]] ||int ||Type of each wave being sent from the rally point: 1 - transport, 2 - reinforce, 3 - scout, 4 - build city, 5 - attack ||
    ||reachTime ||int ||The time the wave will arrive, given in [[UnixTime]] ||
    ||[[ResourceBean|resource]] ||Object ||Object describing the army resources ||
    ||restTime || || ||
    ||startCoords ||String ||Coordinates of the city that sent the army ||
    ||startFieldId ||int ||!FieldId of the army origination point ||
    ||startPosName ||String ||Name of the city that sent the army ||
    ||startTime ||int ||The time the wave was launched, given in [[UnixTime]] ||
    ||targetCoords ||String ||Coordinates of the destination for the army ||
    ||targetFieldId ||int ||!FieldId of the army destination point ||
    ||targetPosName ||String ||Name of the destination for the army ||
    ||[[TroopStrBean|troop]] ||Object ||Object describing the army troops ||
    Line 25: Line 45:
    m_city.cityManager.selfArmies[0].targetFieldId <<BR>>
    Some Army Objects serve as functions to reference details. As above, these objects should be used with ''m_city.cityManager.object'' or ''city.object''. For example, ''city.hasEnemyArmies''.
    Line 27: Line 48:
    m_city.cityManager.selfArmies[0].alliance <<BR>>
    '''Functions'''
    ||<tablewidth="796px" tableheight="123px"#cccccc>'''Function ''' ||<#cccccc>'''Type''' ||<#cccccc>'''Description ''' ||
    ||xxxxArmies.length ||int ||Gives the number of total waves. Used with enemyArmies, selfArmies, or friendlyArmies in place of the xxxx ||
    ||hasEnemyArmiesWithin(x) ||Boolean ||Returns true if there are enemy armies incoming within x seconds. Optionally use hasEnemyArmiesWithin(x, true) to return true if there are enemy armies incoming within x seconds, or if the beacon is too low to see the time. Returns false if not ||
    ||hasEnemyArmies ||Boolean ||Returns true if you have incoming enemy armies, false if not ||
    ||!NumberOfRealAttacks ||int ||The total number of non-junk attacks incoming at your city ||
    Line 29: Line 56:
    m_city.cityManager.selfArmies[0].troop.peasants
    Line 31: Line 57:
    m_city.cityManager.selfArmies[0].troop.militia '''Examples'''
    Line 33: Line 59:
    m_city.cityManager.selfArmies[0].troop.scouter  . {{{
    // List the origin and target of the 1st marching wave of your troops
    origin = city.selfArmies[0].startPosName
    target = city.selfArmies[0].targetPosName
    echo "My first wave in the rally at city " + origin + " has " + target + " as it's target."
    Line 35: Line 65:
    m_city.cityManager.selfArmies[0].troop.pikemen Result:
    18:55:26 My first wave in the rally at city Shanra has Barbarian's city as it's target.
    18:55:27 Script stopped
    }}}
    Line 37: Line 70:
    m_city.cityManager.selfArmies[0].troop.swordsmen

    m_city.cityManager.selfArmies[0].troop.archer

    m_city.cityManager.selfArmies[0].troop.lightCavalry

    m_city.cityManager.selfArmies[0].troop.heavyCavalry

    m_city.cityManager.selfArmies[0].troop.carriage

    m_city.cityManager.selfArmies[0].troop.ballista

    m_city.cityManager.selfArmies[0].troop.batteringRam

    m_city.cityManager.selfArmies[0].troop.catapult

    m_city.cityManager.selfArmies[0].resource.gold

    m_city.cityManager.selfArmies[0].resource.food

    m_city.cityManager.selfArmies[0].resource.wood

    m_city.cityManager.selfArmies[0].resource.iron

    m_city.cityManager.selfArmies[0].resource.stone

    m_city.cityManager.castle.goOutForBattle

    m_city.cityManager.friendlyArmies[0].missionType

    m_city.cityManager.friendlyArmies[0].king

    m_city.cityManager.friendlyArmies[0].startFieldId

    m_city.cityManager.friendlyArmies[0].targetPosName

    m_city.cityManager.friendlyArmies[0].direction

    m_city.cityManager.friendlyArmies[0].restTime

    m_city.cityManager.friendlyArmies[0].startTime

    m_city.cityManager.friendlyArmies[0].startPosName

    m_city.cityManager.friendlyArmies[0].heroLevel

    m_city.cityManager.friendlyArmies[0].reachTime

    m_city.cityManager.friendlyArmies[0].hero

    m_city.cityManager.friendlyArmies[0].targetFieldId

    m_city.cityManager.friendlyArmies[0].alliance

    m_city.cityManager.friendlyArmies[0].troop.peasants

    m_city.cityManager.friendlyArmies[0].troop.militia

    m_city.cityManager.friendlyArmies[0].troop.scouter

    m_city.cityManager.friendlyArmies[0].troop.pikemen

    m_city.cityManager.friendlyArmies[0].troop.swordsmen

    m_city.cityManager.friendlyArmies[0].troop.archer

    m_city.cityManager.friendlyArmies[0].troop.lightCavalry

    m_city.cityManager.friendlyArmies[0].troop.heavyCavalry

    m_city.cityManager.friendlyArmies[0].troop.carriage

    m_city.cityManager.friendlyArmies[0].troop.ballista

    m_city.cityManager.friendlyArmies[0].troop.batteringRam

    m_city.cityManager.friendlyArmies[0].troop.catapult

    m_city.cityManager.friendlyArmies[0].resource.gold

    m_city.cityManager.friendlyArmies[0].resource.food

    m_city.cityManager.friendlyArmies[0].resource.wood

    m_city.cityManager.friendlyArmies[0].resource.iron

    m_city.cityManager.friendlyArmies[0].resource.stone
    Line 126: Line 72:
    CategoryVariables ScriptObjects

    The Army objects can reference details about the armies marching to or from your cities.

    Incoming enemy armies can be referenced as:

    • m_city.cityManager.enemyArmies[x].property or city.enemyArmies[x].property

    Incoming friendly armies can be referenced as:

    • m_city.cityManager.friendlyArmies[x].property or city.friendlyArmies[x].property

    Your own armies can be referenced as:

    • m_city.cityManager.selfArmies[x].property or city.selfArmies[x].property

    The [x] will signify which army it is - starting with 0 being the first one. If you had 6 marching farm crews for example, you would reference these with city.selfArmies[0].property through city.selfArmies[5].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 lord name of the person that the third incoming attack wave belongs to with city.enemyArmies[2].king

    Some properties can have further details, for example resource and troop. Click the links in the table below to get the extra types of properties these can have. As an example, to see how much food your first returning npc farming crew is carrying, you could use city.selfArmies[0].resource.food. Another example, using troops, lets you check how many scouts are in the second incoming reinforcement from your alliance mate by using city.friendlyArmies[1].troop.scouter.

    Properties

    Property

    Type

    Description

    alliance

    String

    Alliance of the player who sent the army

    armyId

    int

    army ID

    direction

    int

    The direction the army is travelling, 1 = marching, 2 = returning

    hero

    String

    The name of the hero sent with the wave

    heroLevel

    int

    The level of the hero sent with the wave

    king

    String

    Lord name of the player who sent the army

    missionType

    int

    Type of each wave being sent from the rally point: 1 - transport, 2 - reinforce, 3 - scout, 4 - build city, 5 - attack

    reachTime

    int

    The time the wave will arrive, given in UnixTime

    resource

    Object

    Object describing the army resources

    restTime

    startCoords

    String

    Coordinates of the city that sent the army

    startFieldId

    int

    FieldId of the army origination point

    startPosName

    String

    Name of the city that sent the army

    startTime

    int

    The time the wave was launched, given in UnixTime

    targetCoords

    String

    Coordinates of the destination for the army

    targetFieldId

    int

    FieldId of the army destination point

    targetPosName

    String

    Name of the destination for the army

    troop

    Object

    Object describing the army troops


    Some Army Objects serve as functions to reference details. As above, these objects should be used with m_city.cityManager.object or city.object. For example, city.hasEnemyArmies.


    Functions

    Function

    Type

    Description

    xxxxArmies.length

    int

    Gives the number of total waves. Used with enemyArmies, selfArmies, or friendlyArmies in place of the xxxx

    hasEnemyArmiesWithin(x)

    Boolean

    Returns true if there are enemy armies incoming within x seconds. Optionally use hasEnemyArmiesWithin(x, true) to return true if there are enemy armies incoming within x seconds, or if the beacon is too low to see the time. Returns false if not

    hasEnemyArmies

    Boolean

    Returns true if you have incoming enemy armies, false if not

    NumberOfRealAttacks

    int

    The total number of non-junk attacks incoming at your city

    Examples

    • // List the origin and target of the 1st marching wave of your troops
      origin = city.selfArmies[0].startPosName
      target = city.selfArmies[0].targetPosName
      echo "My first wave in the rally at city " + origin + " has " + target + " as it's target."
      
      Result:
      18:55:26 My first wave in the rally at city Shanra has Barbarian's city as it's target.
      18:55:27 Script stopped


    ScriptObjects

    Army (last edited 2014-02-10 21:14:29 by Inanna)