Im new to ai scripting, i havent done one yet but im getting there, the only thing stopping me is the absolute confusion the ai guide puts you in.
What im trying to do is make farmertrons attack strategies better for personal use, but i cant seem to be able to incorporate any more commands into the script without it having a fit. I have been onto aiscripters and looked through there definitions of what all the strategic numbers do, and some of them(if i can actually get them to work) if put onto farmertrons script would make him alot more powerfull. Here is( well i think it is anyway) the part in farmertrons military script where he is comanded to attack:
(defrule
(unit-type-count-total militiaman-line >= 25)
(research-completed ri-two-handed-swordsman)
(goal GOAL-START-THE-IMPERIAL-ARMY 1)
=>
;(taunt 14)
(chat-to-all "ATTACK!!!")
(attack-now)
(enable-timer TIMER-ATTACK 45)
(set-strategic-number sn-number-defend-groups 0)
(set-strategic-number sn-percent-attack-soldiers 100)
(disable-self)
)
(defrule
(timer-triggered TIMER-ATTACK)
=>
;(taunt 23)
(chat-to-all "KEEP ATTACKING!!!")
(attack-now)
(disable-timer TIMER-ATTACK)
(enable-timer TIMER-ATTACK 45)
(set-strategic-number sn-number-defend-groups 0)
(set-strategic-number sn-percent-attack-soldiers 100)
)
if anyone has the script maybe they could correct me if im wrong, but the strategic numbers im trying to put into it are:
(set-strategic-numbers sn-minimum-attack-group-size => 80)(maybe 100 im not sure)
(set-strategic-numbers sn-special-attack-type2 (to get him to attack castles im pretty sure you put 82 after this as the castle code, again im not sure)
These 2 rules^^^ i want to put into the first defrule in the script above, so that his first attack is huge and is aimed at castles, then he goes to his normal attacks.
(set-strategic-numbers sn-attack-intelligence 1)
(set-strategic-numbers sn-attack-coordination 2)
This part would either be good in the second defrule or in another that says when his army gets below 15 or 10 or somthing, he stops and puts it back up to around 80-90 before sending more out, and them being more intelligent(hence, why i want them in that one)
I hope someone understands what im getting at. The guides with ai scripting are extremely hard to understand, they have no examples of how to use all of the actions/commands/facts etc. and you are left to figure it out yourself through trial/error, confusion and boredom.
Maybe someone knows of another guide that explains in detail how to make a script?
Thankyou in advance for any help.
What im trying to do is make farmertrons attack strategies better for personal use, but i cant seem to be able to incorporate any more commands into the script without it having a fit. I have been onto aiscripters and looked through there definitions of what all the strategic numbers do, and some of them(if i can actually get them to work) if put onto farmertrons script would make him alot more powerfull. Here is( well i think it is anyway) the part in farmertrons military script where he is comanded to attack:
(defrule
(unit-type-count-total militiaman-line >
(research-completed ri-two-handed-swordsman)
(goal GOAL-START-THE-IMPERIAL-ARMY 1)
=>
;(taunt 14)
(chat-to-all "ATTACK!!!")
(attack-now)
(enable-timer TIMER-ATTACK 45)
(set-strategic-number sn-number-defend-groups 0)
(set-strategic-number sn-percent-attack-soldiers 100)
(disable-self)
)
(defrule
(timer-triggered TIMER-ATTACK)
=>
;(taunt 23)
(chat-to-all "KEEP ATTACKING!!!")
(attack-now)
(disable-timer TIMER-ATTACK)
(enable-timer TIMER-ATTACK 45)
(set-strategic-number sn-number-defend-groups 0)
(set-strategic-number sn-percent-attack-soldiers 100)
)
if anyone has the script maybe they could correct me if im wrong, but the strategic numbers im trying to put into it are:
(set-strategic-numbers sn-minimum-attack-group-size =>
(set-strategic-numbers sn-special-attack-type2 (to get him to attack castles im pretty sure you put 82 after this as the castle code, again im not sure)
These 2 rules^^^ i want to put into the first defrule in the script above, so that his first attack is huge and is aimed at castles, then he goes to his normal attacks.
(set-strategic-numbers sn-attack-intelligence 1)
(set-strategic-numbers sn-attack-coordination 2)
This part would either be good in the second defrule or in another that says when his army gets below 15 or 10 or somthing, he stops and puts it back up to around 80-90 before sending more out, and them being more intelligent(hence, why i want them in that one)
I hope someone understands what im getting at. The guides with ai scripting are extremely hard to understand, they have no examples of how to use all of the actions/commands/facts etc. and you are left to figure it out yourself through trial/error, confusion and boredom.
Maybe someone knows of another guide that explains in detail how to make a script?
Thankyou in advance for any help.