Age Of Kings Land Scenario Guide

Continued from Part 4: A.I.

To build units use these:

Can-build
Can-train
Building-type-count
Unit-type-count
Building-available
Unit-available
Can-afford-unit
Can-afford-building

You don't need to use the can-afford-******, just use the can-build and can-train. Example:
(can-train man-at-arms)
(unit-type-count man-at-arms <= 10)
……………….do stuff

Try this: can-build-archer-line. This will build a line of archers or whatever you want. Need gates and walls? Use these:

Can-build-wall
Can-build-gate
Build-wall
Build-gate

(defrule
(can-build-wall 1 stone-wall-line)
=>
(build-wall 1 stone-wall-line)
)

How about gates?

(defrule
(can-build-gate 1)
(building-type-count gate < 4)
=>
(build-gate 1)
)

This will build 4 gates. Wondering about unique units? Try these:

My-unique-unit
My-unique-unit-upgrade
My-elite-unique-unit
My-unique-unit-line

Researching technology. Extremely important for any A.I.

(defrule
(can-research ri-chain-mail)
=>
(research ri-chain-mail)
(disable-self)
)

Always disable once a technology has been researched. Want to display messages on the screen? Use  (chat-local-to-self "building-archer") or whatever     
previous                                                    next page

Part 1: Placing Units and Terrain
Part 2: Scenarios
Part 3: Triggers
Part 4: A.I.
Part 5: Tricks