Can't get AI to construct new units.

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.
Post Reply
User avatar
Kyran
Posts: 499
Joined: Sat Dec 31, 2011 5:19 pm
Location: Australia
Contact:

Can't get AI to construct new units.

Post by Kyran »

I'm having difficulty getting the AI to construct new units.

I've put the following command under DefineAiHelper() in ai.lua, but it doesn't do anything. Is there anything I'm missing?

Code: Select all

{"build", "unit-caanoo-pioneer", "unit-human-barracks", "unit-caanoo-townhall", "unit-farm"},
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm

Re: Can't get AI to construct new units.

Post by jarod42 »

In fact, DefineAiHelper is just used for 'equivalent type' (paladin is a sort of knight).
Build/train/repair/upgrade/research are automatically filled with 'buttons' (as human does normally to do the action).

I will fix comment and some game data scripts soon.
Last edited by jarod42 on Wed Jan 23, 2013 9:51 pm, edited 1 time in total.
Reason: Fix typo
User avatar
Kyran
Posts: 499
Joined: Sat Dec 31, 2011 5:19 pm
Location: Australia
Contact:

Re: Can't get AI to construct new units.

Post by Kyran »

I have unit-caanoo-pioneer which can build a unit-caanoo-townhall on a unit-buildpoint-townhall, but the AI never builds it (AiNeed("unit-caanoo-townhall"), AiSet("unit-caanoo-townhall", 1)).

The player can build it no problem. There must be something I'm missing.
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
User avatar
Kyran
Posts: 499
Joined: Sat Dec 31, 2011 5:19 pm
Location: Australia
Contact:

Re: Can't get AI to construct new units.

Post by Kyran »

I worked it out. It seems the buttons must be defined along with the rest of the buttons, rather then just slapped on at the end of the lua scripts.
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm

Re: Can't get AI to construct new units.

Post by jarod42 »

Currently, the Build/../research link is filled _by_ the call to DefineAiHelper, but use as I said buttons definition.

So DefineAiHelper should be called after defining the buttons.
Sumer
Posts: 1
Joined: Fri Mar 27, 2015 11:24 pm

Re: Can't get AI to construct new units.

Post by Sumer »

launchpad is better for bug reporting, as tracking is easier.
Cut down your exam stress by using our latest Testking ccna practice exam dumps exam by using our high quality testking toefl test prep resources. We offer up-to-dated http:calarts.edu dumps with definite guarantee of network+ training success
Post Reply