Links
  • Home - AI SCripters homepage
  • Reference - AI Scripters reference library
  • Forums - discussion forums for all aspects of AI Scripting.
  • Tournaments - Tournament news

AI Actions
xxxxxxxxxxxxxxxxxxxxxxxxxx

Action

Std AI uses

In Parser

In AoK

Description

do-nothing

 

y

y

does nothing at all. It is primarily used as a stub for testing purposes. Note that every rule needs at least one action.

acknowledge-event <event-type> <event-id>

 

y

y

acknowledges a received event by resetting the associated flag.

acknowledge-taunt <player-number> <taunt-id>

y

y

y

acknowledges the taunt (resets the flag). Like other event systems in the AI, taunt detection requests explicit acknowledgement. The action allows “any”/”every” wildcard parameters for the <player-number>. It also allows the use of rule variables for the <player-number>.

attack-now

y

y

y

action forces attack with currently available attack units. Units are designated as attack units by using sn-percent-attack-soldiers or sn-percent-attack-boats.

build <building>

y

y

y

action builds the given building. The action allows the use of building line wildcard parameters for the <building>.

build-forward <building>

y

y

y

builds given building close to enemy. The action allows the use of building line wildcard parameters for the <building>.

build-gate <perimeter>

y

y

y

builds a gate as part of the given perimeter wall.

build-wall <perimeter> <wall-type>

y

y

y

builds a wall line of the given wall type at the given perimeter. The action allows the use of wall line wildcard parameters for the <wall-type>.

buy-commodity <commodity>

y

y

y

buys one lot of the given commodity.

cc-add-resource <resource-type> <amount>

y

y

y

a cheating action that adds the given resource amount to the computer player. It is to be used in scenarios to avoid late game oddities such as computer player villagers going all over the map while looking for the last pile of gold.

chat-local <string>

 

y

y

displays the given string as a local chat message.

chat-local-using-id <string-id>

 

y

y

displays a string, defined by a string id, as a local chat message. Ensemble Studios use only.

chat-local-using-range <string-id-start> <string-id-range>

 

y

y

displays a random string as a local chat message. The random string is defined by a string id randomly picked out of a given string id range. Ensemble Studios use only.

chat-local-to-self <string>

y

y

y

displays a given string as local chat message. The message is displayed only if the user is the same player as the computer player sending the message. For debugging purposes only.

chat-to-all <string>

 

y

y

sends a given string as a chat message to all players

chat-to-all-using-id <string-id>

y

y

y

action sends a string, defined by a string id, as a chat message to all players. Ensemble Studios use only.

chat-to-all-using-range <string-id-start> <string-id-range>

y

y

y

sends a random string as chat message to all players. The random string is defined by a string id randomly picked out of a given string id range. Ensemble Studios use only. Example: (chat-to-all-using-range 5020 5) will send a random localized message with a string id between 5020 and 5024.

chat-to-allies <string>

 

y

y

action sends a given string as a chat message to allies.

chat-to-allies-using-id <string-id>

 

y

y

sends a string, defined by a string id, as a chat message to allied players. Ensemble Studios use only.

chat-to-allies-using-range <string-id-start> <string-id-range>

 

y

y

action sends a random string as a chat message to allied players. The random string is defined by a string id randomly picked out of a given string id range. Ensemble Studios use only.

chat-to-enemies <string>

 

y

y

sends a given string as a chat message to enemies and neutral players.

chat-to-enemies-using-id <string-id>

 

y

y

sends a string, defined by a string id, as a chat message to enemies and neutral players. Ensemble Studios use only.

chat-to-enemies-using-range <string-id-start> <string-id-range>

 

y

y

sends a random string as a chat message to enemies and neutral players. The random string is defined by a string id randomly picked out of a given string id range. Ensemble Studios use only.

chat-to-player <player-number> <string>

y

y

y

sends a given string as a chat message to a given player. The action allows “any”/”every” wildcard parameters for the <player-number>. It also allows the use of rule variables for the <player-number>.

chat-to-player-using-id <player-number> <string-id>

y

y

y

sends a string, defined by a string id, as a chat message to a given player. The action allows “any”/”every” wildcard parameters for the <player-number>. It also allows the use of rule variables for the <player-number>. Ensemble Studios use only.

chat-to-player-using-range <player-number> <string-id-start> <string-id-range>

 

y

y

action sends a random string as a chat message to enemies and neutral players. The random string is defined by a string id randomly picked out of a given string id range. The action allows “any”/”every” wildcard parameters for the <player-number>. It also allows the use of rule variables for the <player-number>. Ensemble Studios use only.

chat-trace <value>

 

y

y

displays the given value as a chat message. Used purely for testing to check when a rule gets executed.

clear-tribute-memory <player-number> <resource-type>

y

y

y

action clears the given player's tribute memory. Only tribute memory for the given resource type is cleared. The action allows “any”/”every” wildcard parameters for the <player-number>. It also allows the use of rule variables for the <player-number>.

delete-building <building>

y

y

y

action deletes exactly one building of a given type.

delete-unit <unit>

y

y

y

deletes exactly one unit of a given type.

disable-rule

 

y

y

I doubt this works - I could never get it to work in aok.

disable-self

y

y

y

disables the rule that it is part of. Since disabling takes effect in the next execution pass, other actions in the same rule are still executed once.

disable-timer <timer-id>

y

y

y

disables the given timer.

enable-rule

 

y

y

I doubt this works - I could never get it to work in aok.

enable-timer <timer-id>

y

y

y

enables the given timer and sets it to the given time interval.

enable-wall-placement <perimeter>

y

y

y

action enables wall placement for the given perimeter. Enabled wall placement causes the rest of the placement code to do some planning and place all structures at least one tile away from the future wall lines. If you are planning to build a wall, you have to explicitly define which perimeter wall you plan to use when the game starts. This is a one-time action and should be used during the initial setup.

generate-random-number <value>

y

y

y

action generates a player-specific integer random number within given range (1 to <value>). The number is stored and its value can be tested. Subsequent executions of this action generate new random numbers that replace existing ones.

log <string>

 

y

y

writes the given string to a log file. Used purely for testing purposes. Works only if logging is enabled.

log-trace <value>

 

y

y

writes the given value to a log file. Used purely for testing to check when a rule gets executed. Works only if logging is enabled.

release-escrow <resource-type>

y

y

y

action releases the computer player's escrow for a given resource type.

research <research-item>

y

y

y

researches the given item. To prevent cheating, this action uses the same criteria as the can-research fact to make sure the item can be researched.

research <age>

y

y

y

researches the next age.

resign

y

y

y

causes the computer player to resign.

sell-commodity <commodity>

y

y

y

action sells one lot of a given commodity.

set-author-email <string>

 

y

y

Only purpose appears to be documentation. The game does not use it for anything.

set-author-name <string>

 

y

y

Only purpose appears to be documentation. The game does not use it for anything.

set-author-version <string>

 

y

y

Only purpose appears to be documentation. The game does not use it for anything.

set-difficulty-parameter <difficulty-parameter> <value>

y

y

y

sets a given difficulty parameter to a given value.

set-doctrine <value>

 

y

y

action sets the doctrine to the given value.

set-escrow-percentage <resource-type> <value>

y

y

y

sets the computer player's escrow percentage for a given resource type. Given values have to be in the range 0-100.

set-goal <goal-id> <value>

y

y

y

action sets a given goal to a given value.

set-shared-goal <shared-goal-id> <value>

 

y

y

sets a given shared goal (a goal that is shared among computer players) to a given value. To be used only when all computer players are on the same team.

set-signal <signal-id>

 

y

y

action sets a given signal that can be checked by the trigger system.

set-stance <player-number> <diplomatic-stance>

y

y

y

action sets the stance toward a given player. The action allows “any”/”every” wildcard parameters for the <player-number>. It also allows the use of rule variables for the <player-number>.

set-strategic-number <strategic-number> <value>

y

y

y

Sets a given strategic number to a given value. Click here for information on strategic numbers.

spy

y

y

y

executes a spy command.

taunt <value>

 

y

y

triggers the taunt associated with the given value.

taunt-using-range <taunt-start> <taunt-range>

 

y

y

triggers a random taunt that is picked from a given taunt range. Example: (taunt-using-range 50 10) will use a random taunt between 50 and 59.

trace-fact

 

y

 

Never found a way to get this to work. Probably only for debugging purposes originally.

train <unit>

y

y

y

trains the given unit. To prevent cheating, this action uses the same criteria as the can-train fact to make sure the unit can be trained. The fact allows the use of unit line wildcard parameters for the <unit>.

tribute-to-player <player-number> <resource-type> <value>

y

y

y

action tributes the given amount of the given resource type to the player defined by the player-number parameter. Implementation specifics: If the computer player does not have a Market no tribute is given. In the case when the value parameter specifies an amount larger than available, only the available resources of the given type are tributed. If, for example, there is only 60 food and the tribute action specifies 100 food, only 60 food will be tributed. The tribute action is ignored when there are no resources of the given type. Tribute fees are paid and deducted from the tribute amount (if applicable). The action allows “any”/”every” wildcard parameters for the <player-number>. It also allows the use of rule variables for the <player-number>.

Last modified 14 August 2007
(c) Steven Berry 2007. All rights reserved.