Boss_3.2.1 an infantry Ai.

Upload your latest creations here.
Please note that by posting comments to posts in this forum you forfeit your personal copyright on whatever you post. AI Scripters reserves the right to re-use objective comments in script reviews without requiring the posting author's permission. Credit, where appropriate will be given in such cases.
User avatar
Promiskuitiv
Waheguru
Posts: 1364
Joined: Thu Nov 10, 2011 1:07 pm

Re: Boss 1.42, an infantry Ai.

Post by Promiskuitiv »

lws735 wrote:Thanks cakemaphoneige, in Boss 1.42, i added in some retreat rules.
Up1.3 have too many military tactics.
I am shocked in a test of boss against the horde,whose scaut-knight surround my TC run and run fifty circels at least and many infantry soldiers of boss run after him for a long time, maybe boss should train some knight too. :head
Oh The Horde does that to scout you and see what you are doing.
The userpatch indeed gives you many new possibilities for AI scripting, just take your time discovering them - no need for haste. :)

lws735
Forumer
Posts: 30
Joined: Fri Jun 29, 2012 4:28 pm

Re: Boss_1.43, an infantry Ai.

Post by lws735 »

I add below rule in my AI,and run game display error: "Error 2005:invalid identifier projectile-town-center"

(defrule
(up-projectile-detected projectile-town-center < 2000)
=>
(up-retreat-to barracks c: skirmisher-line)
(up-retreat-to barracks c: archer-line)
)

Why?

User avatar
Alevo1
Guru
Posts: 835
Joined: Thu Aug 04, 2011 10:10 am
Location: England

Re: Boss_1.43, an infantry Ai.

Post by Alevo1 »

lws735 wrote:I add below rule in my AI,and run game display error: "Error 2005:invalid identifier projectile-town-center"

(defrule
(up-projectile-detected projectile-town-center < 2000)
=>
(up-retreat-to barracks c: skirmisher-line)
(up-retreat-to barracks c: archer-line)
)

Why?
First of all, I'd suggest using something more like this (taken from Nightmare) for retreating.

Code: Select all

(defrule
 (not(goal retreat-goal yes))
 (current-age < castle-age)
 (up-projectile-detected projectile-town-center c:< 2000)
 (goal attack-goal yes)
=>
 (up-retreat-to town-center c: all-units-class)
 (set-goal retreat-goal yes)
 (enable-timer retreat-timer 12)
)
(defrule
   (timer-triggered retreat-timer)
   (goal retreat-goal yes)
=>
   (set-goal retreat-goal no)
   (disable-timer retreat-timer)
   (up-reset-unit c: all-units-class)
)
Do you have all of the up constants defined in your script before that rule?
In my rule, instead of the "<" I use "c:<", maybe that is the difference

scripter64
Waheguru
Posts: 5891
Joined: Fri Jan 16, 2009 8:36 pm

Re: Boss_1.45, an infantry Ai.

Post by scripter64 »

It's probably just missing defconsts from UserPatchConst.per. The < and c:< are identical :)

lws735
Forumer
Posts: 30
Joined: Fri Jun 29, 2012 4:28 pm

Re: Boss_1.45, an infantry Ai.

Post by lws735 »

Thanks scripter64 , i will try it .
Another question ,which rule control a scout-soldier to hit a boar and drag the boar to my Ai's TC? I know barbarian can do this very well. :P

User avatar
Alevo1
Guru
Posts: 835
Joined: Thu Aug 04, 2011 10:10 am
Location: England

Re: Boss_1.45, an infantry Ai.

Post by Alevo1 »

lws[quote][/quote]735 wrote:Thanks scripter64 , i will try it .
Another question ,which rule control a scout-soldier to hit a boar and drag the boar to my Ai's TC? I know barbarian can do this very well. :P
It involves many rules using DUC.

lws735
Forumer
Posts: 30
Joined: Fri Jun 29, 2012 4:28 pm

Re: Boss_1.46, an infantry Ai.

Post by lws735 »

what is DUC? :unsure:

User avatar
UnfairestEel
Waheguru
Posts: 1835
Joined: Sat Jul 30, 2011 4:31 pm

Re: Boss_1.46, an infantry Ai.

Post by UnfairestEel »

Direct Unit Commands. Go to this link:
http://userpatch.aiscripters.net/reference.html

We need a manual to explain it but you can search for important terms like:
up-find-local
up-find-remote
up-reset-search
up-reset-filters
up-set-target-object
up-get-object-data
up-get-point
up-set-target-point
up-filter-distance
up-target-objects

there are more as well...

Also you might want to learn to use goals, a really good guide is: http://aok.heavengames.com/blacksmith/s ... BhaSI7fX0=
Knowledge is Time.
This simple fact can be derived from these beliefs:
Time is Money.
Money is Power.
Knowledge is Power.
Therefore, Knowledge is Time.
Q.E.D.

lws735
Forumer
Posts: 30
Joined: Fri Jun 29, 2012 4:28 pm

Re: Boss_1.83, an infantry Ai.

Post by lws735 »

Thanks UnfairestEel.
In despite of I don't understand what you said,but it seems you are very smart.
:P
Last edited by lws735 on Tue Sep 10, 2013 8:34 pm, edited 1 time in total.

User avatar
Promiskuitiv
Waheguru
Posts: 1364
Joined: Thu Nov 10, 2011 1:07 pm

Re: Boss_1.83, an infantry Ai.

Post by Promiskuitiv »

Oh it takes time to get used to the new stuff, it was like that for everyone here who's using DUC etc now. :)

Post Reply