myAi
- the1unknown
- Yogi
- Posts: 344
- Joined: Sat Jul 21, 2018 3:27 am
Re: myAi
thank you all, I will try to use (attack-now) cautiously
"you don't have to be great to start, but you have to start to be great" -the villager
- the1unknown
- Yogi
- Posts: 344
- Joined: Sat Jul 21, 2018 3:27 am
Re: myAi
After 6 months of ai scripting I finally understand (defconst and (goals
during this time I tried so hard to learn and understand them, but I failed. I quitted ai scripting few times because of this
here's my first goal
anyway .. not big deal, but I felt I had to share this
during this time I tried so hard to learn and understand them, but I failed. I quitted ai scripting few times because of this
here's my first goal
Code: Select all
(defconst SLING 137)
(defrule (true)
=> (set-goal SLING 0)(disable-self))
(defrule (goal SLING 1) (wood-amount >= 60)
=> (tribute-to-player any-ally wood 10) )
(defrule (goal SLING 1) (food-amount >= 70)
=> (tribute-to-player any-ally food 10) )
(defrule (taunt-detected any-ally 38) (building-type-count market >= 1)
=> (chat-to-allies "Okey, i will sling you !") (chat-local-to-self "Sling script loaded") (set-goal SLING 1)(acknowledge-taunt this-any-ally 38) )
"you don't have to be great to start, but you have to start to be great" -the villager
-
- Waheguru
- Posts: 5891
- Joined: Fri Jan 16, 2009 8:36 pm
Re: myAi
Yes, it's a bit awkward at first (the ES term "goal" probably makes it more confusing lol), nice work