Question about AI tag

The place to post your WML questions and answers.

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.
Post Reply
dvlenk6
Posts: 20
Joined: December 19th, 2005, 3:30 pm
Location: Pennsylvania

Question about AI tag

Post by dvlenk6 »

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.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

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.
dvlenk6
Posts: 20
Joined: December 19th, 2005, 3:30 pm
Location: Pennsylvania

Post by dvlenk6 »

Thanks zookeeper. That first one is it. Dah!

I'm glad that guy with the 'I hate stupid people' signature didn't see this one. I guess he probably will.

Thanks again.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Yeah, you'll definitely want to watch out for turin. :wink:
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

:P

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
Post Reply