Lionhead Challenge Language Documentation

Up to contents.

12 Expressions

Expressions have a numerical value. They may be just a number, a value gotten from an object or the result of a complicated arithmetic equation. In this section we introduce all the different forms of expression available in the challenge language.

See also:

12.1 real

A real number is nothing more than an immediate numerical value. It is the simplest form of expression.

3.14159

12.2 variable

You may use a variable as an expression. The current value of the variable will be used.

Value

12.3 Expression Arithmetic

These are simple arithmatic operators you can use on expressions to get new expressions.

  1. expression + expression
  2. expression - expression
  3. expression * expression
  4. expression / expression
  5. expression ^ expression
  6. expression ¬& expression
  7. expression % expression
  8. -expression
  9. variable constant
  10. tan expression
  11. sin expression
  12. cos expression
  13. arctan expression
  14. arctan2 expression over exression
  15. arcsin expression
  16. arccos expression
  17. sqrt expression
  18. abs expression
  19. (expression)
  20. number from expression to expression

12.4 Expressions dealing with creatures

These expressions get a real number from a creature.

  1. get last platoon attacked by object
  2. get last siege weapon attacked by object
  3. get creature object CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE
  4. get creature objetc role
  5. get object interaction magnitude
  6. get object desire constant for object
  7. get creature object energy
  8. get creature object feedback
  9. get number of constant for object
  10. get object played percentage

12.5 Time Expressions

These expression deal with time, both as it progresses in the game and out.

  1. get moon percentage
  2. get game time
  3. get real time
  4. get real day
  5. get real weekday
  6. get real month
  7. get real year
  8. time
  9. get object time remaining
  10. get object time since set
  11. get countdown timer time

12.6 Position Expressions

Getting Position and Distance information

  1. land height at position
  2. get distance from coord_expresison to coord_expression

12.7 Miracle Expressions

Getting Miracle information both normal spells and epics.

  1. get mana for spell constant
  2. get player expression mana
  3. get player expression time since last spell cast
  4. get object star constant
  5. get star villager near position
  6. get star abode near position

12.8 Screen Position Expressions

Getting Screen Position information

  1. mouse percentage across
  2. mouse percentage down
  3. coord position across
  4. coord position down

12.9 Camera Expressions

Getting Camera information

  1. get distance ahead of camera
  2. get inclusion distance
  3. get camera altitude
  4. get camera stage
  5. get camera stage percentage complete
  6. get camera path percentage complete

12.10 Building Expressions

Getting information dealing with a Building

  1. get population for constant
  2. get current number of users in object
  3. get total number of users in object
  4. get abode object base productivity
  5. get number of constant living in abode object
  6. get ore in mine object

12.11 Influence Expressions

Getting Influence information

  1. influence at position
  2. get player expression influence at position

12.12 Alignment Expressions

Getting Alignment information

  1. alignment of player
  2. get player expression alignment
  3. get ground alignment at coord_expression

12.13 Game Expressions

Getting Game information

  1. get land number
  2. number of mouse buttons
  3. persistent data constant
  4. get current tribute
  5. interface action constant available
  6. get water height

12.14 Impressiveness Expressions

Getting Impressiveness information

  1. get player expression impressiveness
  2. get town object impressiveness

12.15 Text Database Expressions

Getting Text Database information

  1. get id of group string
  2. get number of lines in expression

12.16 Resource Expressions

Getting resource information

  1. get amount of constant carried by villager object
  2. get town object constant total
  3. get resource constant in object

12.17 Generic Expressions

Get functions for Generic objects

  1. get constant of object
  2. get object temperature
  3. get object player
  4. get object altitude
  5. get object help
  6. get number of times object fisted
  7. get number of player who killed object
  8. get slowest speed in object

12.18 Music Expressions

Expressions dealing with Music

  1. get object music distance
  2. get music string event string time

12.19 Army Expressions

Get functions for army objects

  1. get number of villagers in army object
  2. get number of villagers in a platoon
  3. get number of platoons in army object
  4. get number of constant in army object
  5. get army size in town object
  6. get army unit type ARMY_UNIT_TYPE number in town object
  7. get idle platoons in town object
  8. get platoon object experience
  9. get town object platoon type constant at ratio expression
  10. get villagers of tribe constant nearest position radius expression
  11. get platoon object member at offset expression
  12. get platoon stat constant of MyPlatoon
  13. get movement stat constant of object
  14. get army unit type of platoon object
  15. get player expression most experienced platoon
  16. get player expression most experienced melee platoon
  17. get player expression most experienced ranged platoon
  18. get player expression most experienced siege weapon
  19. get army object most experienced platoon
  20. get number of men in platoon object
  21. get number of women in platoon object
  22. get number of action constant in platoon action queue
  23. get size of platoon action queue
  24. get current platoon action
  25. get first index of action constant in platoon action queue
  26. get number of action constant in siege weapon object action queue
  27. get size of siege weapon object action queue
  28. get current siege weapon object action
  29. get first index of action constant in siege weapon object action queue
  30. get town object siege weapon type constant number
  31. get number of soldiers in town object
  32. get number of platoon of constant in town object
  33. get number of platoons belonging to player expression
  34. get number of platoon warriors belonging to player expression
  35. get amount of constant for platoon constant of size expression
  36. get amount of constant for siege weapon constant
  37. get number of platoon of player expression at coord_expression radius expression
  38. get default size for platoon constant
  39. how many soldiers can get on wall object
  40. get time since player expression attacked object

12.20 Town Expressions

Towns are objects which while containing other objects, have some very specific functionality

  1. get object desire constant
  2. get research ARTEFACT available
  3. get number of type types in object
  4. get number of built constant in object
  5. get number of unbuilt constant in object
  6. get player expression town total
  7. size of object
  8. adult size of object
  9. capacity of object
  10. adult capacity of object
  11. poisoned size of object
  12. get building and villager health total in object
  13. get town object desire for constant
  14. get town object desire activation for constant
  15. get tech level of town object

12.21 Expressions dealing with depth of field

These statements are mostly used for saving/restoring the depth of field after changing it.

See also:

  1. get depth of field strength multiplier
  2. get depth of field distance multiplier

12.22 Statistics events

Gets the statistics/event details.

  1. get total of stat constant
  2. get number of disciple constant in town object

12.23 Town stauts

Gets info regarding the towns stauts

  1. get town object previous player
  2. get player capturing town
  3. get time since town object last captured
  4. get time since last migration started from town object
  5. get time since last migration arrived at town object
  6. get time since last migration accepted at town object
  7. get number of migrations accepted by town object

12.24 Toolbar and Icon events

Gets toolbar and icon info

  1. get toolbar menu
  2. get toolbar root menu
  3. get toolbar state
  4. create world icon consant on object with arrow constant (x offset expression) (y offset expression)
  5. get time since last toolbar button clicked

12.25 Migration events

Gets migration info

  1. get migration threshold for town object and town object
  2. get town object migrating
  3. get migration between object and object
  4. get next town percentage to migrate to town object

12.3.1 expression + expression

Add two expressions together.

Value + 3.14149

12.3.2 expression - expression

Subtract an expression from another value

alignment of player - SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of Sister

12.3.3 expression * expression

Mulitplies two expressions together.

12.3.4 expression / expression

Divides an expression by another expression.

12.3.5 expression ^ expression

raises an expression to the power of another expression

12.3.6 expression ¬& expression

bitwise AND

12.3.7 expression % expression

Get the modulas of the two values. As we work with floats the remainder includes the decimal point info. eg. 10.54 %8 gives a value of 2.54 exm: 1.54%8

12.3.8 -expression

mulitplies the expression by -1

12.3.9 variable constant

converts a constant to an expression

12.3.10 tan expression

Get the tangent of the expression in degrees.

tan MyAngle

12.3.11 sin expression

Get the Sine of the expression in degrees.

sin MyAngle

12.3.12 cos expression

Get the Cosine of the expression in degrees.

cos MyAngle

12.3.13 arctan expression

Get the arctangent of the expression in degrees.

arctan MyAngle

12.3.14 arctan2 expression over exression

Get the arctangent of the expression in degrees. Like atan2 in c you pass the dy and dx arctan2 of y/x returned -180 ->+180 as it looks at which quadrant

arctan2 Dy and Dx

12.3.15 arcsin expression

Get the Arcsine of the expression in degrees.

arcsin MyAngle

12.3.16 arccos expression

Get the Arccosine of the expression in degrees.

arccos MyAngle

12.3.17 sqrt expression

Get the square root of the expression in degrees.

sqrt MyValue

12.3.18 abs expression

Abs of a value means it returns the value guarenteed back as positive. eg. -10 -> 10 and 10 -> 10

abs MyValue

12.3.19 (expression)

calculate whats in the brackets first

(5 + 5)/10

12.3.20 number from expression to expression

Gets a random number between two values.

12.4.1 get last platoon attacked by object

Gets the last platoon attacked by the given creature

LastPlatoon = get last platoon attacked by MyCreature

12.4.2 get last siege weapon attacked by object

Gets the last siege weapon attacked by the given creature

LastWeapon = get last siege weapon attacked by MyCreature

12.4.3 get creature object CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE

Finds out what the current value of a transitional attribute is. Used mostly to save an an attribute before modifying it so that you can later reset it. The values it can use are:
CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE_ALIGNMENT
CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE_FATNESS
CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE_STRENGTH
CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE_SIZE

OldAlignment = get creature MyCreature CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE_ALIGNMENT

See also:

12.4.4 get creature objetc role

gets the current role of the specified creature

get creature AztecCreature role

12.4.5 get object interaction magnitude

Gets the interaction value on an object, (Creature) > 0 is Nice stroke, < 0 is slap! Hasn't been used in a long time. May not work.

get object interaction magnitude

12.4.6 get object desire constant for object

Gets objects desire for an object

get MyCreature desire HUNGER for Cow

12.4.7 get creature object energy

Gets the creatures energy

CurrentEnergy = get creature MyCreature energy

12.4.8 get creature object feedback

Gets the creatures net feedback this session

NetFeedback = get creature MyCreature feedback

12.4.9 get number of constant for object

Get number of times the creature has preformed the specified action.

12.4.10 get object played percentage

gets the object played percentage for the current anim it is doing

get MyCreature played percentage

12.5.1 get moon percentage

gets the in game phase of the moon. hasn't been used for a long time and may not work.

12.5.2 get game time

Gets the in game worlds time.

get game time

12.5.3 get real time

gets the time of day on the computer's clock. This hasn't been used in a long time and may not work.

12.5.4 get real day

gets the day on the computer calendar. This hasn't been used in a long time and may not work.

12.5.5 get real weekday

gets what day of the week it is from teh computers calendar. This hasn't been used in a long time and may not work.

12.5.6 get real month

gets the month from the computers calendar. This hasn't been used in a long time and may not work.

12.5.7 get real year

gets the year from the computers calendar. This hasn't been used in a long time and may not work.

12.5.8 time

The global number of game turns the script has been processed through.

12.5.9 get object time remaining

This timer is not displayed. This function tells you how much time is left on the countdown

Time=get object time remaining

12.5.10 get object time since set

This timer is not displayed. This function tells you how much time since it was set/created.

Time=get object time since set

12.5.11 get countdown timer time

gets the countdown time time as displayed

get countdown timer time

12.6.1 land height at position

Gets the height the land is above sea level.

land height at {LostBrother}

12.6.2 get distance from coord_expresison to coord_expression

Gets the distance from one position to another position.

get distance from camera position to [Mother]

12.7.1 get mana for spell constant

Gets the mana required for a spell

get mana for spell SPELL_HEAL_LEVEL_1

12.7.2 get player expression mana

Gets the mana of a player

Get player 0 mana total

12.7.3 get player expression time since last spell cast

gets the time since the player last cast a spell

get player 1 time since last spell cast

12.7.4 get object star constant

returns the object best placed for cutscenes in an epic spell script

Nymph1 = get MySiren star EPIC_OBJECT_NYMPH

12.7.5 get star villager near position

returns the star villager for the current cast miracle nearest the given position

MyStar = get star villager for MyEarthquake near {MyPos}

12.7.6 get star abode near position

returns the star abode for the current cast miracle nearest the given position

MyStar = get star abode near {MyPos}

12.8.1 mouse percentage across

gets the 0->1 amount the mouse pointer is across the screen

mouse percentage across

12.8.2 mouse percentage down

gets the 0->1 amount the mouse pointer is down the screen

mouse percentage down

12.8.3 coord position across

gets how far across the screen an object is. Scale is 0-1

{MyPos} position across

12.8.4 coord position down

gets how far across the screen an object is. Scale is 0-1

{MyPos} position down

12.9.1 get distance ahead of camera

Gets the distance between the camera and the world point at the center of the screen

get distance ahead of camera

12.9.2 get inclusion distance

The game limits your camera area (inclusion) at different times, this function tells you how near the edge you are.

get inclusion distance

12.9.3 get camera altitude

gets the altitude of the camera

get camera altitude

12.9.4 get camera stage

gets the stage of the camera path

MyVar = get camera stage

12.9.5 get camera stage percentage complete

gets the percent completion of the current camera stage

MyVar = get camera stage percentage complete

12.9.6 get camera path percentage complete

gets the percent completion of the camera path

MyVar = get camera path percentage complete

12.10.1 get population for constant

Gets the population requirement for a tech level (GameBalanceBuilding.h)

VillagersNeeded = get population for BUILDINGPREREQ_BALANCE_TYPE_AZTEC_CITY_CENTRE

12.10.2 get current number of users in object

returns the current number of users for a given object

MyVal = get current number of users in MonsterMine

12.10.3 get total number of users in object

returns the total number of users for a given object

MyVal = get total number of users in MonsterMine

12.10.4 get abode object base productivity

gets the base productibity of the given abode

get abode MyHouse base productivity

12.10.5 get number of constant living in abode object

gets the number of people living in a house

get number of CHILDREN living in abode MyHouse

12.10.6 get ore in mine object

returns the amount of ore in a mine

get ore in mine MM_Mine

12.11.1 influence at position

You can find out the strength of the player's influence at a particular position. influence can be 'influence' or 'raw influence' the raw version means excluding the player allies influence.

influence at {Sister}

12.11.2 get player expression influence at position

You can find out the strength of the given player's influence at a particular position.

get player 1 influence at {Sister}

12.12.1 alignment of player

The current alignment of the player is a number from -1 to 1.

alignment of player

12.12.2 get player expression alignment

The current alignment any player is a number from -1 to 1.

get player 1 alignment

12.12.3 get ground alignment at coord_expression

The current alignment of the ground at a position. Range is -1 to 1.

MyGroundAlignment = get ground alignment at {MyPos}

12.13.1 get land number

gets the land number, as defined in the bwe

get land number

12.13.2 number of mouse buttons

gets the number of mouse buttons

number of mouse buttons

12.13.3 persistent data constant

gets the value of persistent data, created by scripters. Hasn't been used for a long time. May not work.

persistent data PERSISTANT_VALUE_EXAMPLE

12.13.4 get current tribute

gets current amount of reward given to the player

Reward = get current tribute

12.13.5 interface action constant available

returns whether or not the given interface action is available. See GameBalanceGeneral.h (MANACOST_BALANCE_TYPE) for a list of interface actions

CanChangeTimeOfDay = interface action MANACOST_BALANCE_TYPE_ENTERTIMECHANGE available

12.13.6 get water height

returns the height of the water

get water height

12.14.1 get player expression impressiveness

Get the total impressiveness of all towns owned by the player

get player 1 impressiveness

12.14.2 get town object impressiveness

Get the impressiveness of the town

Impress = get town MyTown impressiveness

12.15.1 get id of group string

Gets the number of available text entries in the given group

GroupID = get id of group "BW2T_SCRIPT_04FINAL_ADVISORS_OUTRO"

12.15.2 get number of lines in expression

Gets the number of available text entries in the given group

get number of lines in GroupID

12.16.1 get amount of constant carried by villager object

gets the amount of a given resource that a villager is carrying

get amount of RESOURCE_TYPE_FOOD carried by villager MyVillager

12.16.2 get town object constant total

gets the total value of a given resource type from the given town

get town NorseTown RESOURCE_TYPE_FOOD total

12.16.3 get resource constant in object

Objects can have food and wood, this function returns the amount of food/wood an object has.

get resource RESOURCE_TYPE_WOOD in Pit

12.17.1 get constant of object

Game objects have properties, and you can use the values of these properties in expressions.

get SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of Sister

12.17.2 get object temperature

returns a given objects temperature

MyTemp = get MyVillager temperature

12.17.3 get object player

returns a given objects player

MyPlayer = get MyVillager player

12.17.4 get object altitude

gets the altitude of the given object

get MyBall altitude

12.17.5 get object help

gets the objects help. Hasn't been used in a long time. May not work.

get LostBrother help

12.17.6 get number of times object fisted

gets the number of times the given object has been fisted

get number of times Stone fisted

12.17.7 get number of player who killed object

returns the number of the player that killed the given object

FilthyMurderer = get number of player who killed MyLittleFella

12.17.8 get slowest speed in object

Gets the slowest speed in the container.

get slowest speed in Flock

12.18.1 get object music distance

Gets the distance some music can be heard from a music thing.

get object music distance

12.18.2 get music string event string time

returns the time an event occurs in a tune in seconds

time_val = get music "tunename" event "eventname" time

12.19.1 get number of villagers in army object

Gets the total number of villagers in a given army

get number of villagers in army MyArmy

12.19.2 get number of villagers in a platoon

takes a passed platoon and returns the number of villagers

get number of villagers in platoon GreekArchers1

12.19.3 get number of platoons in army object

Gets the total number of platoons in a given army

get number of platoons in army MyArmy

12.19.4 get number of constant in army object

Gets the total number of a particular type (ArmyUnitTypeEnum.h) in an army

get number of ARMY_UNIT_TYPE_RANGED in army MyArmy

12.19.5 get army size in town object

Gets the actual number of warriors in a town

get army size in town NorseTown1

12.19.6 get army unit type ARMY_UNIT_TYPE number in town object

Gets the number of warriors of ARMY_UNIT_TYPE in a town

get army unit type ARMY_UNIT_TYPE_MELEE number in town NorseTown1

12.19.7 get idle platoons in town object

Takes a town and returns the number of platoons that are unassigned within it

IdlePlatoons = get platoons in town NorseTown

12.19.8 get platoon object experience

returns the experience value of a given platoon

BigEvilPlatoonXP = get platoon BigEvilPlatoon experience

12.19.9 get town object platoon type constant at ratio expression

gets a towns conscript rate to a given value and troop type

get town MyTown platoon type ARMY_UNIT_TYPE_MELEE ratio

12.19.10 get villagers of tribe constant nearest position radius expression

gets the number of soldiers of a given tribe within an area

get villagers of tribe TRIBE_TYPE_GREEKS nearest {MyPos} radius 40

12.19.11 get platoon object member at offset expression

takes a platoon and an offset and returns the villager in the platoon at that offset

MyVillager = get platoon MyPlatoon member at offset 3

12.19.12 get platoon stat constant of MyPlatoon

gets the value of a particular platoon stat

get platoon stat PLATOON_STAT_MOVE_TO_ATTACK_DIST of MyPlatoon

12.19.13 get movement stat constant of object

gets the value of a platoons given movement stat

get movement stat FORMATION_MOVEMENT_STAT_AGENT_SPEED_MAX of MyPlatoon

12.19.14 get army unit type of platoon object

gets the type of the given platoon

get army unit type of platoon MyPlatoon

12.19.15 get player expression most experienced platoon

gets the most experienced platoon of a given player

get player 0 most experienced platoon

12.19.16 get player expression most experienced melee platoon

gets the most experienced melee platoon of a given player

get player 0 most experienced melee platoon

12.19.17 get player expression most experienced ranged platoon

gets the most experienced ranged platoon of a given player

get player 0 most experienced ranged platoon

12.19.18 get player expression most experienced siege weapon

gets the most experienced siege weapon of a given player

get player 0 most experienced siege weapon

12.19.19 get army object most experienced platoon

gets the most experienced platoon of a given player

get army HomeGuard most experienced platoon

12.19.20 get number of men in platoon object

gets the number of men in a given platoon

get number of men in platoon object

12.19.21 get number of women in platoon object

gets the number of women in a given platoon

get number of women in platoon object

12.19.22 get number of action constant in platoon action queue

returns the index number of the given action in the given platoons action queue

MyVal = get number of action PLATOON_AGENDA_ACTION_RETREAT in MyPlatoon action queue

12.19.23 get size of platoon action queue

returns the number of actions in the given platoons action queue

MyVal = get size of MyPlatoon action queue

12.19.24 get current platoon action

returns the action that the given platoon is currently doing

MyPlatoonAction = get current MyPlatoon action

12.19.25 get first index of action constant in platoon action queue

returns the first index number of the given action in the given platoons action queue

MyVal = get first index of action PLATOON_AGENDA_ACTION_RETREAT in MyPlatoon action queue

12.19.26 get number of action constant in siege weapon object action queue

returns the index number of the given action in the given siege weapons action queue

MyVal = get number of action SIEGEWEAPON_AGENDA_ACTION_FACE_POSITION in siege weapon MySiegeWeapon action queue

12.19.27 get size of siege weapon object action queue

returns the number of actions in the given siege weapons action queue

MyVal = get size of siege weapon MySiegeWeapon action queue

12.19.28 get current siege weapon object action

returns the action that the given siege weapon is currently doing

MyPlatoonAction = get current siege weapon MySiegeWeapon action

12.19.29 get first index of action constant in siege weapon object action queue

returns the first index number of the given action in the given siege weapons action queue

MyVal = get first index of action SIEGEWEAPON_AGENDA_ACTION_FACE_POSITION in siege weapon MySiegeWeapon action queue

12.19.30 get town object siege weapon type constant number

gets a towns number of the given siege weapon

get town MyTown siege weapon type SIEGE_BALANCE_TYPE_CATAPULT number

12.19.31 get number of soldiers in town object

gets the number of soldiers belonging to a town

get number of soldiers in town MyTown

12.19.32 get number of platoon of constant in town object

gets the number of platoons of a type in a town

get number of platoon of ARMY_UNIT_TYPE_RANGED_1 in town TheTownOnTheHill

12.19.33 get number of platoons belonging to player expression

gets the number of platoons belonging to a player

NumPlatoons = get number of platoons belonging to player 1

12.19.34 get number of platoon warriors belonging to player expression

gets the number of platoon warriors belonging to a player

NumPlatoons = get number of platoon warriors belonging to player 1

12.19.35 get amount of constant for platoon constant of size expression

get the amount of resource require for platoon recruitment

get amount of RESOURCE_TYPE_IRE for platoon PLATOON_INFO_GREEK_MELEE_1 of size 20

12.19.36 get amount of constant for siege weapon constant

get the amount of resource required for siege weapon recruitment

get amount of RESOURCE_TYPE_IRE for siege weapon SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_1

12.19.37 get number of platoon of player expression at coord_expression radius expression

Gets the number of platoons of a particular player near to the given position and within a radius in metres

get number of platoon of player CompPlayer near {MyTownCentre} radius 10

12.19.38 get default size for platoon constant

get the default size of this type of platoon

get default size for platoon PLATOON_INFO_JAPANESE_MELEE_3

12.19.39 how many soldiers can get on wall object

Returns the maximum number of soldiers who can get on a wall

RecruitSize = how many soldiers can get on wall MyWall

12.19.40 get time since player expression attacked object

gets the time since a player attacked a town. If the player never attacked a town the time since the attack is a very huge amount of time. Not currently working.

get time since player 1 attacked KhazarTown1

12.20.1 get object desire constant

gets the percentage desire a town has for something (See Enums.h)

get Town desire TOWN_DESIRE_INFO_FOR_FOOD

12.20.2 get research ARTEFACT available

Returns an enum with the current state of this artefact: RESEARCH_AVAILABILITY_NOT_AVAILABLE
RESEARCH_AVAILABILITY_AVAILABLE
RESEARCH_AVAILABILITY_RESEARCHED

AvailabilityState = get research ARTEFACT_ABODE_NUMBER_ALTAR available

12.20.3 get number of type types in object

gets the number of the specified types in the container.

get number of type HOUSE ABODE_NUMBER_A in MyTown min built 1.0

12.20.4 get number of built constant in object

gets the number of built types in the town.

get number of built ABODE_NUMBER_A in MyTown

12.20.5 get number of unbuilt constant in object

gets the number of the unbuilt types in the town.

get number of unbuilt ABODE_NUMBER_A in MyTown

12.20.6 get player expression town total

Returns the number of towns a player owns

get player 1 town total

12.20.7 size of object

Gets the amount of objects in a container (Flock/Dance/Town).

size of Town

12.20.8 adult size of object

Gets the amount of adults in a container (Town).

adult size of Town

12.20.9 capacity of object

Gets capacity of an object, (Town) eg. The amount of room for adults and children

capacity of Town

12.20.10 adult capacity of object

Gets adult capacity of an object, (Town) eg. The amount of room for adults

adult capacity of Town

12.20.11 poisoned size of object

Gets the amount of objects poisoned in a container (Flock/Dance/Town).

12.20.12 get building and villager health total in object

This returns a health total of a towns buildings and people. This is not a general value 0->1 it is a sum of the health of each individual building and person.

get building and villager health totoal in MyTown

12.20.13 get town object desire for constant

returns the desire weight value for a given desire type

MyVal = get town GreekTown desire for GET_WOOD

12.20.14 get town object desire activation for constant

returns the desire activation state

MyVal = get town GreekTown desire activation for GET_WOOD

12.20.15 get tech level of town object

returns the tech level of the given town

MyVal = get tech level of town NorseTown

12.21.1 get depth of field strength multiplier

gets the strength of the depth of field

get depth of field strength multiplier

See also:

12.21.2 get depth of field distance multiplier

gets the distance of the depth of field

get depth of field distance multiplier

See also:

12.22.1 get total of stat constant

gets the total number of times a particular statistic has happened (on this land)

get total of stat STATS_EVT_TOWNS_GAINED

12.22.2 get number of disciple constant in town object

gets the total number of disciples of the type in the town

get number of disciple VILLAGER_DISCIPLE_BREEDER in town MyTown

12.23.1 get town object previous player

returns the previous owner of this town

LastOwner = get town MyTown previous player

12.23.2 get player capturing town

gets the player who is currently capturing this town

NaughtyPlayer = get player capturing town MyTown

12.23.3 get time since town object last captured

gets the time since this town was last captured

TimedSinceCapture = get time since town MyTown last captured

12.23.4 get time since last migration started from town object

gets the time since the last migration started

TimedSinceMigration = get time since last migration started from town MyTown

12.23.5 get time since last migration arrived at town object

gets the time since the last migration arrived

TimedSinceMigration = get time since last migration arrived at town MyTown

12.23.6 get time since last migration accepted at town object

gets the time since the last migration accepted

TimedSinceMigration = get time since last migration accepted at town MyTown

12.23.7 get number of migrations accepted by town object

gets the number of migrations accepted by the player

Total = get number of migrations accepted by town MyTown

12.24.1 get toolbar menu

returns the current toolbar menu, there is also an enum for this..somewhere

CurrentMenu = get toolbar menu

12.24.2 get toolbar root menu

returns the current toolbar root menu, there is also an enum for this..somewhere

CurrentMenu = get toolbar root menu

12.24.3 get toolbar state

Returns the current toolbar state
MENU_TOOLBAR_STATE_CLOSED
MENU_TOOLBAR_STATE_OPEN_NORMAL
MENU_TOOLBAR_STATE_OPEN_FULL

BarState = get toolbar state

12.24.4 create world icon consant on object with arrow constant (x offset expression) (y offset expression)

enables or disables drawing of the hand icons. This returns a float which is a handle to the icon and can be sued to delete it. Optional arrow

MyIconHandle = create world icon BINDABLE_ACTION_TYPE_MOVE on MyRock with arrow ARROW_TYPE_NONE

12.24.5 get time since last toolbar button clicked

returns the number of seconds since the last toolbar button was clicked

TimeSinceLastButton = get time since last toolbar button clicked

See also:

12.25.1 get migration threshold for town object and town object

Returns the migration threshold between the two given towns

Threshold = get migration threshold from JapaneseTown to AztecTown

12.25.2 get town object migrating

Returns the town that the given town is migrating too

Town = get town JapaneseTown migrating

12.25.3 get migration between object and object

Returns the migration party which is migrating

MigrationParty = get migration from JapaneseTown to AztecTown

12.25.4 get next town percentage to migrate to town object

finds the town most likely to migrate to the specified town and gives the percentage chance that it will migrate

CurrentHighMigrationPercent = get next town percentage to migrate to town MyTown

See also:

This documentation generated by LHDOC, © Lionhead Studios 2000