Size: 3142
Comment:
|
Size: 4414
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 The Army objects can reference details about the armies marching to or from your cities. |
Line 3: | Line 5: |
m_city.cityManager.selfArmies[0].missionType | '''Incoming enemy armies can be referenced as: ''' |
Line 5: | Line 7: |
m_city.cityManager.selfArmies[0].king | . ''m_city.cityManager.enemyArmies[x].property '''or''' city.enemyArmies[x].property'' |
Line 7: | Line 9: |
m_city.cityManager.selfArmies[0].startFieldId | '''Incoming friendly armies can be referenced as: ''' |
Line 9: | Line 11: |
m_city.cityManager.selfArmies[0].targetPosName | . ''m_city.cityManager.friendlyArmies[x].property '''or''' city.friendlyArmies[x].property'' |
Line 11: | Line 13: |
m_city.cityManager.selfArmies[0].direction | '''Your own armies can be referenced as: ''' |
Line 13: | Line 15: |
m_city.cityManager.selfArmies[0].restTime | . ''m_city.cityManager.selfArmies[x].property '''or''' city.selfArmies[x].property'' |
Line 15: | Line 17: |
m_city.cityManager.selfArmies[0].startTime | 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 17: | Line 19: |
m_city.cityManager.selfArmies[0].startPosName | 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 19: | Line 21: |
m_city.cityManager.selfArmies[0].heroLevel | 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 21: | Line 23: |
m_city.cityManager.selfArmies[0].reachTime | '''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 23: | Line 44: |
m_city.cityManager.selfArmies[0].hero | |
Line 25: | Line 45: |
m_city.cityManager.selfArmies[0].targetFieldId | |
Line 27: | Line 46: |
m_city.cityManager.selfArmies[0].alliance | |
Line 29: | Line 47: |
m_city.cityManager.selfArmies[0].troop.peasants | <<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 31: | Line 49: |
m_city.cityManager.selfArmies[0].troop.militia | <<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 33: | Line 56: |
m_city.cityManager.selfArmies[0].troop.scouter | |
Line 35: | Line 57: |
m_city.cityManager.selfArmies[0].troop.pikemen | |
Line 37: | Line 58: |
m_city.cityManager.selfArmies[0].troop.swordsmen | |
Line 39: | Line 59: |
m_city.cityManager.selfArmies[0].troop.archer | '''Examples''' |
Line 41: | Line 61: |
m_city.cityManager.selfArmies[0].troop.lightCavalry | . {{{ // 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 43: | Line 67: |
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 |
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 126: | Line 73: |
CategoryVariables | ScriptObjects [[Object City]] |
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 |
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 |
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 |
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 |
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