Lionhead Challenge Language Documentation

Up to contents.

10 Constants

When you're doing things like playing animations, setting or getting the states of objects and things like that, you'll need to know the names of the constants which the game uses to refer to things. There are absolutely hundreds of these, so we shan't enumerate them here. See a programmer if you want to know the constants which are available to you. As we have previously seen, you can define your own constants, both locally and globally, to abbreviate these unwieldy names, making your scripts more readable.

See also:

10.1 Constant Manipulation

These let you change constants in certain ways.

  1. constant from constant to constant
  2. constant expression

10.2 Getting constants

These let you get a constant from the game.

  1. get text id from strong
  2. state of object
  3. get object desired building
  4. get hand state
  5. get object type
  6. get object sub type
  7. get object disciple type
  8. get player expression last spell cast
  9. get object current action
  10. get last gesture
  11. get last spell gesture
  12. get key for interface action constant
  13. get object relationship to object
  14. get platoon object type
  15. get platoon object plan status
  16. get object death reason
  17. get fire archer type for tribe TRIBE_TYPE
  18. get object navigation state
  19. get last toolbar button clicked
  20. get town object method of last conversion
  21. get town stauts
  22. get last town player expression method of last conversion
  23. get last settlement player expression method of last conversion

10.1.1 constant from constant to constant

get a random constant, where the constant is one of the ones between the two enum values you pass in.

10.1.2 constant expression

Converts an expression to a constant.

10.2.1 get text id from strong

gets the text id for a string name in the text data base.

get text id from "HELP_TEXT_BLAH"

10.2.2 state of object

Returns the constant for the final state of an object. So if an object is moving to a position it returns the destination state not the current moving state. This also works for puzzle objects.

state of LostBrother

10.2.3 get object desired building

Gets the building type that the town most wants to build

MyBuilding = variable get MyTown desired building

10.2.4 get hand state

Gets the hand state.

get hand state

10.2.5 get object type

gets the object script type

get RandomThing type

10.2.6 get object sub type

Gets the object sub type

get Animal sub type

10.2.7 get object disciple type

Gets the object disciple type of a villager

get MyVillager disciple type

10.2.8 get player expression last spell cast

gets the the player last cast spell type

get player 1 last spell cast

10.2.9 get object current action

gets the creatures current action

get MyCreature current action

10.2.10 get last gesture

gets the last gesture type the player did

get last gesture

10.2.11 get last spell gesture

gets the last gesture type the player did to cast a spell

get last spell gesture

10.2.12 get key for interface action constant

get key for interface actions (KB_UP for example for move)

get key for interface action BINDABLE_ACTION_TYPE_MOVE

10.2.13 get object relationship to object

gets the relationship of one object to another, based on their players (see RELATIONSHIP in RelationshipEnum.h)

MyRelationship = get GreekTown relationship to NorseTown

10.2.14 get platoon object type

returns the type of the platoon

MyPlatoonType = get platoon MyPlatoon type

10.2.15 get platoon object plan status

returns the plan status of the platoon

MyPlatoonPlanStatus = get platoon MyPlatoon plan status 

10.2.16 get object death reason

returns the method that killed the given object

MyLittleFellaDeathReason = get MyLittleFella death reason

10.2.17 get fire archer type for tribe TRIBE_TYPE

gets the platoon type required for making fire archers in the given tribe

FiresOfHell = get fire archer type for tribe TRIBE_TYPE_GREEK

10.2.18 get object navigation state

After a call to 'move object position to position using constant navigation', you can call this to find out what state the navigating object is in.
It returns one of:
NAV_STATE_NONE - This entity is not currently navigating
NAV_STATE_NAVIGATING - This entity is navigating
NAV_STATE_SUCCEEDED - This entity has succeeded in navigating
NAV_STATE_FAILING - This entity is in the process of failing
NAV_STATE_FAILED - This entity has failed, and is not doing anything else.

get BlindMan navigation state

See also:

10.2.19 get last toolbar button clicked

returns an enum from MENU_HIGHLIGHT_ITEM. This is the last button clicked indpendent of time since it was clicked.

LastButton = get last toolbar button clicked

See also:

10.2.20 get town object method of last conversion

returns the last method of conversion for the given town (see lastcaptureenum.h)

TownConversion = get town JapTown method of last conversion

10.2.21 get town stauts

gets the towns current status

TownConversion = variable get town object tatus

10.2.22 get last town player expression method of last conversion

returns the method of conversion last used by the player

TownConversion = get last town player 0 method of last conversion

10.2.23 get last settlement player expression method of last conversion

returns the method of conversion last used by the player

TownConversion = get last town player 0 method of last conversion

This documentation generated by LHDOC, © Lionhead Studios 2000