So, I'm trying to send some chats to player. I copied and pasted the tribute algorithm from CPSB.doc
The other thing is more of a noob question. I want the AI to build some lumber/mining camps or mills, near the corresponding resources. How is it done?
Even with this rule
The only thing I modified was checking if the player was allied before asking for tribute. Now, what happens is that chats get sent, but I only hear the chat sound, I don't see the sent text. So, What am I missing?; Schedule 15 minute timer for the first time
(defrule
(true)
=>
(enable-timer 2 900)
(disable-self))
; Every 15 minutes ask for tribute and wait 5 minutes to get it.
; Restart 15 minute timer.
(defrule
(timer-triggered 2)
=>
(disable-timer 2)
(enable-timer 2 900)
(chat-to-player 1 "Give me 500 gold in the next 5 minutes.")
(clear-tribute-memory 1 gold)
(enable-timer 1 300))
; Tribute not received in time, declare player 1 to be an enemy.
; No need to ask for tribute again - disable both timers.
(defrule
(timer-triggered 1)
=>
(disable-timer 1)
(disable-timer 2)
(chat-to-player 1 "Time is up. We are enemies now")
(set-stance 1 enemy))
; Tribute received in time. Disable the 5 minute timer
(defrule
(players-tribute-memory 1 gold greater-or-equal 500)
=>
(disable-timer 1)
(clear-tribute-memory 1 gold)
(chat-to-player 1 "Thanks"))
The other thing is more of a noob question. I want the AI to build some lumber/mining camps or mills, near the corresponding resources. How is it done?
Even with this rule
nothing happens and villagers walk a lot to mine gold and stone. Any help?(defrule
(resource-found stone) ;
(can-build mining-camp)
=>
(build mining-camp)
)