Problems registering at AoCZone?
You can try resending activation email. If that doesnt work you can send an email here. If you forgot your password click here.
 Main Menu

 ForumsSearch »

 SY Nations Cup 2017

 Escape Gaming

 Badlands Masters

 AoC Recorded Games

 AoE2HD Recorded Games

 AoFE Recorded Games

 Major Past Tournaments

 Auto downloadedFind »

 Users currently online
Staff (1)
Members (36)
»  Alvik
»  htc
»  Jupe
»  lkhby
»  mazq
»  Piero
»  Poxo
»  Rein
»  SiFly
»  Tiwaz
Guests (103)

 AoC Clans Add yours »



Help with AI

Take part in AoFE discussions, share strategies and gaming experience
Advertisement from Google 

Help with AI

Postby  enkeli » Sun Aug 10, 2014 1:41 am

Hi, I'm working on my own mod I have not revealed anything, but I've come to a problem that I could solcionar.
It is only the AI ​​trains the basic unit are the main lines or normal lines, but I want to know how to make my AI, can train the other units.


The AI I get this.

;Training:Spearman line
(unit-type-count-total spearman-line < 10)
(can-train spearman-line)
(train spearman-line)

I wonder if there is a way to modify some file data somewhere, something to create a line that is called for example:

;Training:Spearman line
(unit-type-count-total spearman-line < 10)
(can-train spearman-line)
(train spearman-line)

;Training:Halberdier line
(unit-type-count-total Halberdier-line < 10)
(can-train spearman-line)
(train spearman-line)

;Training:Pikeman line
(unit-type-count-total Pikeman-line < 10)
(can-train spearman-line)
(train spearman-line)

If you can help me go a long way in my project, it is very urgent to me to continue, thank you very much.
Veni, Vidi, Vici.
User avatar
Posts: 3
Joined: Aug 10, 2014
Location: Finland
Age: 24

Re: Help with AI

Postby  Marathon » Sun Aug 10, 2014 10:22 am

The word "spearman-line" can be replaced by the word "spearman". However, both words can be replaced by their respective IDs. I suggest using "spearman" for both counting and training for the whole line (so the other rules for halberdiers and pikes are not needed).
There is no such thing as Halberdier-line. Also beware that the words are case-sensitive: Spearman-line does not work.

If you were careful with the unit IDs of the unit lines, they should work fine. I mean, say you made a new whole unit line called "lancers" and that this line has 2 levels. You could replace Camels with Lancers like this:
you replace "Camel-line" with "Lancer-line", Camel with Lancer and Heavy Camel with Elite Lancer. If you tell your AI to train Camels it will train Lancers.
But you can simplify things by adding constants on top of your AI:
(defconst lancer camel)
(defconst lancer-line camel-line)

They work.

If you have messed your IDs, like if you used the ID of longswordsman for the first unit of a new class, well just change it because I think it is hardcoded the fact that (train militiaman) or (unit-type-count militiaman < 10) also cover all other upgraded units. I cannot modify it, so better be careful.
Posts: 414
Joined: Jun 06, 2011

Re: Help with AI

Postby  Sky95 » Sun Aug 10, 2014 7:52 pm

this mods seems really interesting... :D
<[TyRanT]RD_ChampioN would like to be your friend. Anfrage akzeptieren>
User avatar
Posts: 1807
Joined: Mar 15, 2013
 1602 (51%)

Re: Help with AI

Postby  John the Late » Mon Aug 11, 2014 7:25 pm

It is not possible to train single units from a unit line where more than 1 unit is available.
Example: You enable archer and xbow seperately (xbow not an upgrade of archer). Both belong to archer-line. The AI will not be able to train crossbows. You have to copy the unit to a different ID, but with that many units you'll quickly hit the 900 unit mark, I'm afraid, especially as you'd be unable to use the unit-lines for more than 1 unit each.

(AIs cannot "see" or count units with IDs of 900 and higher.)
 John the Late
Posts: 561
Joined: Nov 06, 2013
Location: Germany

Re: Help with AI

Postby  Teilanan » Sat Jun 20, 2015 4:57 am

It is not difficult to understand. But if you try and focus a lot of fun.
Posts: 2
Joined: Jun 20, 2015

Return to General AoFE Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

Legend: Global moderators, News posters, Tournament moderators