Skip to content

Latest commit

 

History

History
1563 lines (851 loc) · 39.4 KB

conditions.md

File metadata and controls

1563 lines (851 loc) · 39.4 KB

Lionhead Challenge Language Documentation

Back to index.

6 Conditions

A condition is something that is either true or false. It is used primarily for if blocks, while loops and wait until.

See also:

A condition is doing something or is in a particular state.

  1. get villagers ignore object resource
  2. object active
  3. object can view camera
  4. object left_right clicked
  5. object hit
  6. object hit land
  7. object hit land position
  8. object locked interaction
  9. object played
  10. object decayed
  11. object skeleton
  12. object of type types
  13. object on fire
  14. object in object hand
  15. object in limbo
  16. object not in object hand
  17. object is constant
  18. object is not constant
  19. object exists
  20. object not exists
  21. object frozen
  22. object hit by arrow
  23. object controlled by script
  24. object is moving
  25. object has damage decal
  26. object has damage cleave

These only work on navigable objects. Namely, villagers, animals, creatures and army units.

  1. object can navigate to coord_expression
  2. object can navigate to object object
  3. object preview nav ready
  4. can object preview nav succeed
  5. is navigation stable

These conditions test what state the sky is in

  1. sky is in transition
  2. hand over sky

These conditions test the state of miracles, both normal and epic.

  1. spell constant in object
  2. spell constant for player expression
  3. player expresion spell charging
  4. player expresion specific spell charging
  5. wonder fire near coord_expression radius expression
  6. wonder in hand

These conditions test wheather dialogue, music and sound has been played, as well as tests on the advisors.

  1. constant music played
  2. spirit_type played
  3. spirit_type speaks expressions
  4. spirit_type speaks in expression
  5. dialogue ready
  6. spirit not ready
  7. read
  8. sound exists
  9. sound string playing
  10. music line expression

These conditions within them

  1. object within flock distance
  2. object in object
  3. object not in object

These conditions test what a creature is doing.

  1. leash is in hand
  2. object cast by object
  3. creature constant is available
  4. desire of object is constant
  5. object leashed
  6. object leashed to object
  7. object knows action constant
  8. object fighting
  9. object is auto fighting
  10. ask creature object to enter scripted learning for constant with object
  11. creature object finished script action

These conditionives are in.

  1. get player expression objective constant status
  2. player expression objective constant complete
  3. land end objectives processed
  4. player expression objective constant hidden

These conditions test what state a town is in.

  1. is town object of size type constant
  2. is town object settlement
  3. town object is under takeover from player expression
  4. can town object recruit constant platoon of size expression
  5. can town object recruit constant siege weapon
  6. object in hand can be placed
  7. pilgrimage object ready

These conditions test what state videos and hand demos are in.

  1. video is playing
  2. hand demo played
  3. hand demo trigger

These conditions test what state the game is in, as well as providing general true/false functionality

  1. expression second[s]
  2. help system on
  3. creature help on
  4. game is min spec

These conditions test what state a villager is in

  1. object is male
  2. object is drowning
  3. animation marker string on object played
  4. villager object can be imprisoned
  5. villager object can react
  6. villager object available
  7. villager object using alternative mesh

These conditions test what state a platoon or a catapult is in.

  1. platoon object ranged
  2. platoon object melee
  3. platoon object melee fighting
  4. platoon object ranged fighting
  5. platoon object fighting
  6. platoon object attacking platoon object
  7. platoon object under fire
  8. platoon object idle
  9. army unit object is fighting
  10. object interacting with object
  11. object is on wall
  12. army flag constant held
  13. coord_expression is in range of object
  14. object recruiting
  15. object disbanding
  16. does platoon respond to town attack
  17. does platoon respond to local platoon attack
  18. platoon object current action is constant using object
  19. platoon object current action is constant using coord_expression
  20. siege weapon object current action is constant using object
  21. siege weapon object current action is constant using coord_expression

These conditions test what state a gate or wall is in

  1. gate object open
  2. gate object moving
  3. does object connect to object

These conditions test what state the camera is in, as well as whethere the game is in widescreen or not.

  1. in widescreen
  2. camera ready
  3. cinema skipped
  4. widescreen transistion complete
  5. fade ready
  6. camera not ready

These conditions test what the player is doing, as well as what the menu and tooltips are doing.

  1. if bindable action constant performed
  2. key constant down
  3. mouse left_right_middle button down
  4. mouse left_right_middle opt_double clicked
  5. within rotation
  6. player has mouse wheel
  7. toolbar handle held

A conditions can be used to test whether or not a location is somewhere compared to another location.

  1. coord_expression viewed
  2. coord_expression ahead of camera
  3. player expression cast miracle MY_MIRACLE near coord_expression radius expression
  4. coord_expression valid for creature
  5. coord_expression left_right clicked radius expression
  6. fire near coord_expression radius expression
  7. coord_expression near coord_expression radius
  8. coord_expression not near coord_expression radius
  9. coord_expression at coord_expression
  10. coord_expression not at coord_expression
  11. coord_expression near constant cast by player expression radius effect range expression
  12. coord_expression is under landscape
  13. coord_expression and coord_expression on same side of line between coord_expression and coord_expression
  14. coord_expression on land
  15. coord_expression under water
  16. position coord_expression scrubbed radius epression

Operators that return BOOLEAN values.

  1. not condition
  2. condition and condition
  3. condition or condition
  4. expression == expression
  5. expression != expression
  6. expression >= expression
  7. expression <= expression
  8. expression > expression
  9. expression < expression

returns whether or not villagers are ignore the fact that the object has a resource

Ignoring = get villagers ignore MyTree resource

6.1.2 object active

If an object is active - eg. ScriptHighlight is active, spell dispenser active or reward is opened

Reward active

6.1.3 object can view camera

Returns if an object can view the camera

LostBrother can view camera

6.1.4 object left_right clicked

If an object clicked and has been clicked in the last few seconds then this check is true.

Checks what if an object.

6.1.6 object hit land

Checks if an object.

Puck hit land

6.1.7 object hit land position

Checks where the object.

Puck hit land position

6.1.8 object locked interaction

If an object is in locked interaction - eg. Totem moving up and down, creature stroking.

6.1.9 object played

A check on if an object has finished playing it's animation or if weather has finished it's current storm.

LostBrother played

6.1.10 object decayed

A check on an object to see if it is decayed

LostBrother decayed

6.1.11 object skeleton

A check on an object to see if it is a skeleton

LostBrother skeleton

6.1.12 object of type types

A check on an object to see if it is of a certain type

Animal of type ANIMAL COW

6.1.13 object on fire

A check on an object to see if it is on fire.

LostBrother on fire

Checks if in an object.

MyToy in MyCreature hand

6.1.15 object in limbo

Checks if in an object is in limbo

Johhny in limbo

Checks if in an objects hand.

MyToy not in MyCreature hand

Casts the result of a get property to BOOLEAN - Not sure if this function is used...

MyHouse is HOUSE_A

Checks if an object.

MyHouse is not HOUSE_A

6.1.19 object exists

checks a variable to see if it has a game thing.

LostBrother exists

6.1.20 object not exists

Checks a variable to see if it has not been assigned a game thing.

LostBrother not exists

6.1.21 object frozen

returns true if object is frozen

if MyGoolies frozen

6.1.22 object hit by arrow

returns true if the given object has been hit by an arrow. must have physics tracking enabled.

if MyVillager hit by arrow

6.1.23 object controlled by script

returns true if the object is at the final position in its waypoint schedule

MonsterFood controlled by script

6.1.24 object is moving

returns true if the object is moving from one location to another (as opposed to moving on the spot or wanting to move somewhere)

Army324 is moving

6.1.25 object has damage decal

returns true if the has a damage decal on it

RodleHouse has damage decal

6.1.26 object has damage cleave

returns true if the has been cleaved

TorledHouse has damage cleave

Does navigation think this object can navigate succesfully to the indicated position. This may not be stable, even if 'is navigation stable' returns true... as the player may build a wall in the way after the navigation starts...

OverLord can navigate to {GodHome}

See also:

Does navigation think this object. This may not be stable, even if 'is navigation stable' returns true... as the player may build a wall in the way after the navigation starts...

OverLord can navigate to [object](objects.md#8) GodHome

6.2.3 object preview nav ready

has the preview nav finished calculating?

ReadyToCheck = MyPlatoon preview nav ready

6.2.4 can object preview nav succeed

can the platoon's preview nav succeed

CanGo = can MyPlatoon preview nav succeed

is a call to 'object' guaranteed?

is navigation stable

See also:

checks to see if the sky is in transition

[wait until](statements.md#3.25.1) sky is in transition

Is the hand over the sky?

[wait until](statements.md#3.25.1) hand over sky

Has an object got a spell. (Worship sites/towns/towncentres)

spell MAGIC_TYPE_WOOD in MyWorshipSite

checks if a player has a specific spell

spell SPELL_HEAL_LEVEL_1 for player 1

Check if a spell (any) is charging for a player

player 1 spell charging

Check if a specific spell is charging for a player

player 1 spell SPELL_FOOD charging

Returns true if a wonder has recently been fired near the specified location

if wonder fire near {ScriptLoc} radius 100

Returns true if the player's hand is holding a wonder spell

if wonder in hand

6.5.1 constant music played

Returns if the script music passed is no longer playing

MUSIC_TYPE_SCRIPT_MISSIONARIES_VERSE_1 music played

A check on if a spirit_type has finished playing it's animation.

good spirit played

A check on if a spirit_type speaks the text? Hasn't been used in a long time. May not work.

good spirit speaks 102

Does the spirit_type speak in the text group? Hasn't been used in a long time. May not work.

good spirit speaks in GroupID

Returns if we can have dialogue control.

dialogue ready

Returns true if a spirit is not ready.

spirit not ready

Checks if text is being outputted to the screen. Often used after a say statement in the form: wait until read.

read

checks if a player has sound

sound exists

Is a say sound playing?

if say sound "HELP_TEXT_DEFINITELY_NEWEST_INTRO_01" playing

Look at the last line of music that was playing. Has not been used for a long time and may not work.

[wait until](statements.md#3.25.1) music line 6

6.6.1 object within flock distance

Returns all members of a flock within their flock limits?

MyFlock within flock limits

Checks if an object is within a container ie. Dance, Flock or Town.

MySheep in MyFlock

Checks that an object is not within a container.

MySheep not in MyFlock

Checks if the creature leash is in the hand

[wait until](statements.md#3.25.1) leash is in hand

A check on if an object. Hasn't been used in a long time. May not work.

MySpell cast by MyCreature

See if player has a creature type available.

creature CREATURE_TYPE_LEOPARD is available

Compares the desire of an object to a specified desire. Suitable for checking the desire of a creature.

desire of MyCreature is TO_REST

6.7.5 object leashed

Returns if an object is leashed or not.

[object](objects.md#8) leashed

Returns if an object or not.

MyCreature leashed to Rock

Returns if an object knows an action (see CREATURE_ACTION_KNOWN_ABOUT in enum.h)

MyCreature knows action CREATURE_ACTION_KNOWN_ABOUT_BUILD

6.7.8 object fighting

Returns if a creature object is fighting.

[object](objects.md#8) fighting

6.7.9 object is auto fighting

checks if a creature is auto fighting whenin a fight. This hasn't been used for a long time and may not work.

[object](objects.md#8) is auto fighting

Asks the creature to enter scripted learning mode. This hasn't been used for a long time and may not work.

IsInLearning = ask creature MyCreature to enter scripted learning for CREATURE_THROW_BALL_AT_OBJECT with Mouth

6.7.11 creature object finished script action

returns true if the given creature has finished a script action

if creature MyCreature finished script action

gets the status of an objective

ObjStat = variable get player 0 [object](objects.md#8)ive TRIBUTE_OBJECTIVE_COLLECT_WOOD status

Check to see if an objective is complete

if player 0 [object](objects.md#8)ive TRIBUTE_OBJECTIVE_COLLECT_WOOD complete

6.8.3 land end objectives processed

Have the end of land objectives been processed

[wait until](statements.md#3.25.1) land end [object](objects.md#8)ives processed

Check to see if an objective is hidden

if player 0 [object](objects.md#8)ive TRIBUTE_OBJECTIVE_COLLECT_WOOD hidden

how big is a town - village, town, city?

is town BigTown of size type SCRIPT_SETTLEMENT_SIZE_TOWN

is the town object actually a settlement?

is town MyTown settlement

returns true if the town is being taken over by the player

[wait until](statements.md#3.25.1) town MyTown is under takeover from player 1

Returns true if the town can recruit x soldiers

CanRecruit = can town MyTown recruit ARMY_UNIT_TYPE_MELEE_1 platoon of size 100

6.9.5 can town object siege weapon

Returns true if the town can recruit the siege weapon

CanRecruit = can town MyTown recruit SIEGE_BALANCE_TYPE_CATAPULT_LEVEL_1 siege weapon

6.9.6 object in hand can be placed

returns whether the building placement in the hand can be placed

CanPlace = [object](objects.md#8) in hand can be placed

returns true if a pilgrimage object is ready to be asked to accept or decline

if pilgrims [object](objects.md#8) ready

checks to see if a video is playing

[wait until](statements.md#3.25.1) not video is playing

Checks to see if a hand demo is running

hand demo played

If the hand demo trigger has been set to TRUE. The hand demo can be created with triggers. Calling this will tell when a trigger is come across. Not that triggers are clear once this function is called.

hand demo trigger

6.11.1 expression second[s]

Waits for a number of second(s) to elapse from the moment the instruction is called.

Returns if the help system is on.

help system on

Returns if the creature help system is on.

creature help on

returns true if the game is in min spec

if game is min spec

6.12.1 object is male

Checks the sex of an object for if it's male.

6.12.2 object is drowning

Checks if the object is drowning. May provide odd results for non-villagers.

returns true if the animation marker has been reached

animation marker "MyMarker" on MyVillager played

6.12.4 villager object can be imprisoned

returns true if the villager object can be imprisoned

villager MyLittleThief can be imprisoned

returns true if the villager object can react

villager MyLittleThief can react

returns false if the villager object is doing anything easily testable for

villager MyBigBoy available

6.12.7 villager object using alternative mesh

returns true if the position is on land

villager Guy42 using alternative mesh

returns true if the given platoon is ranged

platoon MyPlatoon ranged

returns true if the given platoon is melee

platoon MyPlatoon melee

6.13.3 platoon object melee fighting

returns true if the platoon is currently engaged in fisticuffs

platoon MyPlatoon melee fighting

6.13.4 platoon object ranged fighting

returns true if the platoon is currently ranged fighting

platoon MyPlatoon ranged fighting

returns true if the platoon is currently fighting

platoon MyPlatoon fighting

returns true if the platoon is currently fighting with the second platoon

if platoon MyPlatoon attacking platoon TheirPlatoon

returns true if the platoon is currently being shot at

if platoon MyPlatoon under fire

returns true if the platoon is idle

[wait until](statements.md#3.25.1) platoon MyPlatoon idle

returns true if the unit is fighting

if army unit SwordGuy is fighting

Is object. Works only on creatures and platoons.

MyCreature interacting with Totem

6.13.11 object is on wall

Returns true if the object is on a wall. Works for army units.

if MyGuy is on wall

checks to see if the given type of army flag is held

[wait until](statements.md#3.25.1) army flag ARMY_FLAG_INFO_GREEK_MELEE held

checks to see if the position is within firing range of the object (siege weapon or ranged platoon)

[wait until](statements.md#3.25.1) {TownCentre} is in range of MyTroops

6.13.14 object recruiting

checks to see if a platoon or siegeweapon is recruiting

[wait until](statements.md#3.25.1) not MyPlatoon recruiting

6.13.15 object disbanding

checks to see if platoon is disbanding

[wait until](statements.md#3.25.1) MyPlatoon disbanding

Returns true if platoon is set to respond to attack on that town

ResponseEnabled = does platoon MyPlatoon respond to town MyTown attack

Returns true if platoon is set to respond to attack on local platoons

ResponseEnabled = does platoon MyPlatoon respond to local platoon attack

Returns true if platoons current action is the one specified

if platoon MyPlatoon current action is PLATOON_AGENDA_ACTION_ATTACK_TOWN_CENTRE_FOR_TAKE_OVER using MyTown

Returns true if platoons current action is the one specified

if platoon MyPlatoon current action is PLATOON_AGENDA_ACTION_MOVE_TO_POS using {MyPos}

Returns true if siege weapons current action is the one specified

if siege weapon MyCatapult current action is SIEGEWEAPON_AGENDA_ACTION_ATTACK_THING using MyWall

Returns true if siege weapons current action is the one specified

if siege weapon MyCatapult current action is SIEGEWEAPON_AGENDA_ACTION_MOVE_TO_POS using {MyPos}

returns true if the given gatehouse object is open

gate TheTownGatehouse is open

returns true if the given gatehouse object is moving

gate TheTownGatehouse is moving

Returns true if two objects are connected (wall towers connected by a wall)

Connected = does MyTower connect to MyOtherTower

Checks are we in a widescreen section.

[wait until](statements.md#3.25.1) in widescreen

Has the camera has reached the position it is going to.

[wait until](statements.md#3.25.1) camera ready

Has the interruptible cinema been skipped

if cinema skipped

Has the widescreen transition finished.

[wait until](statements.md#3.25.1) widescreen transition complete

Has the fade transition finished.

[wait until](statements.md#3.25.1) fade ready

camera not ready

returns whether this bindable action is currently being performed

if bindable action BINDABLE_ACTION_TILT_ROTATE_ON performed

If an key is pressed down.

key KB_SPACE down

If a mouse button is down.

mouse left button down
mouse middle button down

If a mouse button is clicked or double clicked.

mouse left button  clicked

Is the player within the interface rotation border?

within rotation

Returns if the player has a mouse wheel.

player has mouse wheel

returns true if the toolbar handle is currently held

if toolbar is held

Is a position on screen.

{House} viewed

6.17.2 coord_expression ahead of camera

Is a position ahead of the camera plane

if {House} is ahead of camera

Detects whether a miracle has been cast at a position. Triggers when the miracle is poured or bounces.

if player 0 cast miracle MIRACLE_TYPE_HEAL near {MyMarker} radius 15

6.17.4 coord_expression valid for creature

Is the position valid for a creature to be at (Eg. Not a mountain side).

{SheepPos} valid for creature

If the last postion clicked (if in the last few seconds) is within the defined radius of the defined position this check is true.

{House} right clicked radius 5

A check on an position to see if it there is a fire within the defined radius.

fire near {WoodPile} radius 10

Checks if a position is within a radius of another position.

{MyVillager} near {VillagerHome} radius 20

Checks that a position is not within a radius of another position.

{MyVillager} not near (VillagerHome} 20

Checks if a position is the same as another position.

{MyVillager} at {VillagerHome}

Checks that a position is not the same as another position.

{MyVillager} not at {VillagerHome}

returns true if the spell has been cast within the given range of the given point

{MonsterMine} near SPELL_TYPE_HEAL cast by player 0 radius effect range 50

6.17.12 coord_expression is under landscape

returns true if the given position is under the landscape

{MyPos} is under landscape

returns true if the two given positions are on the same side of the line defined by two positions

{EnemyPlatoon} and {HomeTown} on same side of the line between {WestPos} and {East Pos}

returns true if the position is on land as opposed to on the occean

{Rock} on land

returns true if the position is under the level of the water. If an object is far enough under the landscape, it will also be under the water.

{Rock} under water

6.17.16 position coord_expression scrubbed radius epression

Has this position just been scrubbed with the fist?

[wait until](statements.md#3.25.1) {MyPos} scrubbed radius 10

Returns true when the condition is not true.

Returns true when both conditions are true.

Returns true when one or more of the conditions is true.

Returns true when the expression evaluate as the same.

Returns true when the expression do not evaluate as the same.

Returns true when the expression right of the operator.

Returns true when the expression right of the operator.

Returns true when the expression right of the operator.

Returns true when the expression right of the operator.