Question about AI tag
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Question about AI tag
Question: Is there any way to change:
from:
[ai]
passive_leader=yes
[/ai]
to:
[ai]
passive_leader=no
[/ai]
in the middle of a scenario?
The situation is this:
During the scenario, if a side's leader dies, a new leader is assigned with store_unit and setting canrecruit to 1. Easy enough. The problem is, the new leader will sit like an idiot, even 1 step away from a keep, and not do anything at all.
The best I've come up with is using the leader_goal to send the new leader to the home base but that doesn't exactly do what I had in mind either. The new leader will run 50 steps, past two keeps, without even thinking of recruiting.
Any ideas would be most appreciated.
from:
[ai]
passive_leader=yes
[/ai]
to:
[ai]
passive_leader=no
[/ai]
in the middle of a scenario?
The situation is this:
During the scenario, if a side's leader dies, a new leader is assigned with store_unit and setting canrecruit to 1. Easy enough. The problem is, the new leader will sit like an idiot, even 1 step away from a keep, and not do anything at all.
The best I've come up with is using the leader_goal to send the new leader to the home base but that doesn't exactly do what I had in mind either. The new leader will run 50 steps, past two keeps, without even thinking of recruiting.
Any ideas would be most appreciated.
You could have a name=side turn event that triggers every time the ai's side is about to act. There, just set the moves variable of the first leader to 0, if he's still alive. He would try to act like any sensible ai leader, except that he has no movement points on his turn. Or alternatively, you could just have an empty side in the beginning to which all the ai's units are flipped to when the leader is killed. Then just put whatever ai behaviour you want into that side, which is effectively "activated" only when the leader is killed and a new one is promoted because before that, there will be no units on that side.
Both of zookeeper's solutions are the ones I would have said, in any case...
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm