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:
A real number is nothing more than an immediate numerical value. It is the simplest form of expression.
3.14159
You may use a variable as an expression. The current value of the variable will be used.
Value
These are simple arithmatic operators you can use on expressions to get new expressions.
These expressions get a real number from a creature.
These expression deal with time, both as it progresses in the game and out.
Getting Position and Distance information
Getting Miracle information both normal spells and epics.
Getting Screen Position information
Getting Camera information
Getting information dealing with a Building
Getting Influence information
Getting Alignment information
Getting Game information
Getting Impressiveness information
Getting Text Database information
Getting resource information
Get functions for Generic objects
Expressions dealing with Music
Get functions for army objects
Towns are objects which while containing other objects, have some very specific functionality
These statements are mostly used for saving/restoring the depth of field after changing it.
See also:
Gets the statistics/event details.
Gets info regarding the towns stauts
Gets toolbar and icon info
Gets migration info
Add two expressions together.
Value + 3.14149
Subtract an expression from another value
alignment of player - SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of Sister
Mulitplies two expressions together.
Divides an expression by another expression.
raises an expression to the power of another expression
bitwise AND
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
mulitplies the expression by -1
converts a constant to an expression
Get the tangent of the expression in degrees.
tan MyAngle
Get the Sine of the expression in degrees.
sin MyAngle
Get the Cosine of the expression in degrees.
cos MyAngle
Get the arctangent of the expression in degrees.
arctan MyAngle
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
Get the Arcsine of the expression in degrees.
arcsin MyAngle
Get the Arccosine of the expression in degrees.
arccos MyAngle
Get the square root of the expression in degrees.
sqrt MyValue
Abs of a value means it returns the value guarenteed back as positive. eg. -10 -> 10 and 10 -> 10
abs MyValue
calculate whats in the brackets first
(5 + 5)/10
Gets a random number between two values.
Gets the last platoon attacked by the given creature
LastPlatoon = get last platoon attacked by MyCreature
Gets the last siege weapon attacked by the given creature
LastWeapon = get last siege weapon attacked by MyCreature
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:
gets the current role of the specified creature
get creature AztecCreature role
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
Gets objects desire for an object
get MyCreature desire HUNGER for Cow
Gets the creatures energy
CurrentEnergy = get creature MyCreature energy
Gets the creatures net feedback this session
NetFeedback = get creature MyCreature feedback
Get number of times the creature has preformed the specified action.
gets the object played percentage for the current anim it is doing
get MyCreature played percentage
gets the in game phase of the moon. hasn't been used for a long time and may not work.
Gets the in game worlds time.
get game time
gets the time of day on the computer's clock. This hasn't been used in a long time and may not work.
gets the day on the computer calendar. This hasn't been used in a long time and may not work.
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.
gets the month from the computers calendar. This hasn't been used in a long time and may not work.
gets the year from the computers calendar. This hasn't been used in a long time and may not work.
The global number of game turns the script has been processed through.
This timer is not displayed. This function tells you how much time is left on the countdown
Time=get object time remaining
This timer is not displayed. This function tells you how much time since it was set/created.
Time=get object time since set
gets the countdown time time as displayed
get countdown timer time
Gets the height the land is above sea level.
land height at {LostBrother}
Gets the distance from one position to another position.
get distance from camera position to [Mother]
Gets the mana required for a spell
get mana for spell SPELL_HEAL_LEVEL_1
Gets the mana of a player
Get player 0 mana total
gets the time since the player last cast a spell
get player 1 time since last spell cast
returns the object best placed for cutscenes in an epic spell script
Nymph1 = get MySiren star EPIC_OBJECT_NYMPH
returns the star villager for the current cast miracle nearest the given position
MyStar = get star villager for MyEarthquake near {MyPos}
returns the star abode for the current cast miracle nearest the given position
MyStar = get star abode near {MyPos}
gets the 0->1 amount the mouse pointer is across the screen
mouse percentage across
gets the 0->1 amount the mouse pointer is down the screen
mouse percentage down
gets how far across the screen an object is. Scale is 0-1
{MyPos} position across
gets how far across the screen an object is. Scale is 0-1
{MyPos} position down
Gets the distance between the camera and the world point at the center of the screen
get distance ahead of camera
The game limits your camera area (inclusion) at different times, this function tells you how near the edge you are.
get inclusion distance
gets the altitude of the camera
get camera altitude
gets the stage of the camera path
MyVar = get camera stage
gets the percent completion of the current camera stage
MyVar = get camera stage percentage complete
gets the percent completion of the camera path
MyVar = get camera path percentage complete
Gets the population requirement for a tech level (GameBalanceBuilding.h)
VillagersNeeded = get population for BUILDINGPREREQ_BALANCE_TYPE_AZTEC_CITY_CENTRE
returns the current number of users for a given object
MyVal = get current number of users in MonsterMine
returns the total number of users for a given object
MyVal = get total number of users in MonsterMine
gets the base productibity of the given abode
get abode MyHouse base productivity
gets the number of people living in a house
get number of CHILDREN living in abode MyHouse
returns the amount of ore in a mine
get ore in mine MM_Mine
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}
You can find out the strength of the given player's influence at a particular position.
get player 1 influence at {Sister}
The current alignment of the player is a number from -1 to 1.
alignment of player
The current alignment any player is a number from -1 to 1.
get player 1 alignment
The current alignment of the ground at a position. Range is -1 to 1.
MyGroundAlignment = get ground alignment at {MyPos}
gets the land number, as defined in the bwe
get land number
gets the number of mouse buttons
number of mouse buttons
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
gets current amount of reward given to the player
Reward = get current tribute
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
returns the height of the water
get water height
Get the total impressiveness of all towns owned by the player
get player 1 impressiveness
Get the impressiveness of the town
Impress = get town MyTown impressiveness
Gets the number of available text entries in the given group
GroupID = get id of group "BW2T_SCRIPT_04FINAL_ADVISORS_OUTRO"
Gets the number of available text entries in the given group
get number of lines in GroupID
gets the amount of a given resource that a villager is carrying
get amount of RESOURCE_TYPE_FOOD carried by villager MyVillager
gets the total value of a given resource type from the given town
get town NorseTown RESOURCE_TYPE_FOOD total
Objects can have food and wood, this function returns the amount of food/wood an object has.
get resource RESOURCE_TYPE_WOOD in Pit
Game objects have properties, and you can use the values of these properties in expressions.
get SCRIPT_OBJECT_PROPERTY_TYPE_HEALTH of Sister
returns a given objects temperature
MyTemp = get MyVillager temperature
returns a given objects player
MyPlayer = get MyVillager player
gets the altitude of the given object
get MyBall altitude
gets the objects help. Hasn't been used in a long time. May not work.
get LostBrother help
gets the number of times the given object has been fisted
get number of times Stone fisted
returns the number of the player that killed the given object
FilthyMurderer = get number of player who killed MyLittleFella
Gets the slowest speed in the container.
get slowest speed in Flock
Gets the distance some music can be heard from a music thing.
get object music distance
returns the time an event occurs in a tune in seconds
time_val = get music "tunename" event "eventname" time
Gets the total number of villagers in a given army
get number of villagers in army MyArmy
takes a passed platoon and returns the number of villagers
get number of villagers in platoon GreekArchers1
Gets the total number of platoons in a given army
get number of platoons in army MyArmy
Gets the total number of a particular type (ArmyUnitTypeEnum.h) in an army
get number of ARMY_UNIT_TYPE_RANGED in army MyArmy
Gets the actual number of warriors in a town
get army size in town NorseTown1
Gets the number of warriors of ARMY_UNIT_TYPE in a town
get army unit type ARMY_UNIT_TYPE_MELEE number in town NorseTown1
Takes a town and returns the number of platoons that are unassigned within it
IdlePlatoons = get platoons in town NorseTown
returns the experience value of a given platoon
BigEvilPlatoonXP = get platoon BigEvilPlatoon experience
gets a towns conscript rate to a given value and troop type
get town MyTown platoon type ARMY_UNIT_TYPE_MELEE ratio
gets the number of soldiers of a given tribe within an area
get villagers of tribe TRIBE_TYPE_GREEKS nearest {MyPos} radius 40
takes a platoon and an offset and returns the villager in the platoon at that offset
MyVillager = get platoon MyPlatoon member at offset 3
gets the value of a particular platoon stat
get platoon stat PLATOON_STAT_MOVE_TO_ATTACK_DIST of MyPlatoon
gets the value of a platoons given movement stat
get movement stat FORMATION_MOVEMENT_STAT_AGENT_SPEED_MAX of MyPlatoon
gets the type of the given platoon
get army unit type of platoon MyPlatoon
gets the most experienced platoon of a given player
get player 0 most experienced platoon
gets the most experienced melee platoon of a given player
get player 0 most experienced melee platoon
gets the most experienced ranged platoon of a given player
get player 0 most experienced ranged platoon
gets the most experienced siege weapon of a given player
get player 0 most experienced siege weapon
gets the most experienced platoon of a given player
get army HomeGuard most experienced platoon
gets the number of men in a given platoon
get number of men in platoon object
gets the number of women in a given platoon
get number of women in platoon object
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
returns the number of actions in the given platoons action queue
MyVal = get size of MyPlatoon action queue
returns the action that the given platoon is currently doing
MyPlatoonAction = get current MyPlatoon action
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
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
returns the number of actions in the given siege weapons action queue
MyVal = get size of siege weapon MySiegeWeapon action queue
returns the action that the given siege weapon is currently doing
MyPlatoonAction = get current siege weapon MySiegeWeapon action
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
gets a towns number of the given siege weapon
get town MyTown siege weapon type SIEGE_BALANCE_TYPE_CATAPULT number
gets the number of soldiers belonging to a town
get number of soldiers in town MyTown
gets the number of platoons of a type in a town
get number of platoon of ARMY_UNIT_TYPE_RANGED_1 in town TheTownOnTheHill
gets the number of platoons belonging to a player
NumPlatoons = get number of platoons belonging to player 1
gets the number of platoon warriors belonging to a player
NumPlatoons = get number of platoon warriors belonging to player 1
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
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
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
get the default size of this type of platoon
get default size for platoon PLATOON_INFO_JAPANESE_MELEE_3
Returns the maximum number of soldiers who can get on a wall
RecruitSize = how many soldiers can get on wall MyWall
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
gets the percentage desire a town has for something (See Enums.h)
get Town desire TOWN_DESIRE_INFO_FOR_FOOD
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
gets the number of the specified types in the container.
get number of type HOUSE ABODE_NUMBER_A in MyTown min built 1.0
gets the number of built types in the town.
get number of built ABODE_NUMBER_A in MyTown
gets the number of the unbuilt types in the town.
get number of unbuilt ABODE_NUMBER_A in MyTown
Returns the number of towns a player owns
get player 1 town total
Gets the amount of objects in a container (Flock/Dance/Town).
size of Town
Gets the amount of adults in a container (Town).
adult size of Town
Gets capacity of an object, (Town) eg. The amount of room for adults and children
capacity of Town
Gets adult capacity of an object, (Town) eg. The amount of room for adults
adult capacity of Town
Gets the amount of objects poisoned in a container (Flock/Dance/Town).
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
returns the desire weight value for a given desire type
MyVal = get town GreekTown desire for GET_WOOD
returns the desire activation state
MyVal = get town GreekTown desire activation for GET_WOOD
returns the tech level of the given town
MyVal = get tech level of town NorseTown
gets the strength of the depth of field
get depth of field strength multiplier
See also:
gets the distance of the depth of field
get depth of field distance multiplier
See also:
gets the total number of times a particular statistic has happened (on this land)
get total of stat STATS_EVT_TOWNS_GAINED
gets the total number of disciples of the type in the town
get number of disciple VILLAGER_DISCIPLE_BREEDER in town MyTown
returns the previous owner of this town
LastOwner = get town MyTown previous player
gets the player who is currently capturing this town
NaughtyPlayer = get player capturing town MyTown
gets the time since this town was last captured
TimedSinceCapture = get time since town MyTown last captured
gets the time since the last migration started
TimedSinceMigration = get time since last migration started from town MyTown
gets the time since the last migration arrived
TimedSinceMigration = get time since last migration arrived at town MyTown
gets the time since the last migration accepted
TimedSinceMigration = get time since last migration accepted at town MyTown
gets the number of migrations accepted by the player
Total = get number of migrations accepted by town MyTown
returns the current toolbar menu, there is also an enum for this..somewhere
CurrentMenu = get toolbar menu
returns the current toolbar root menu, there is also an enum for this..somewhere
CurrentMenu = get toolbar root menu
Returns the current toolbar state
MENU_TOOLBAR_STATE_CLOSED
MENU_TOOLBAR_STATE_OPEN_NORMAL
MENU_TOOLBAR_STATE_OPEN_FULL
BarState = get toolbar state
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
returns the number of seconds since the last toolbar button was clicked
TimeSinceLastButton = get time since last toolbar button clicked
See also:
Returns the migration threshold between the two given towns
Threshold = get migration threshold from JapaneseTown to AztecTown
Returns the town that the given town is migrating too
Town = get town JapaneseTown migrating
Returns the migration party which is migrating
MigrationParty = get migration from JapaneseTown to AztecTown
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