Adding units to AI recall lists
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.
Adding units to AI recall lists
I've been trying to add level 2 units to AI players' recall lists, because I feel this is slightly fairer than giving them unlimited recruits of level 2 units. However, although I can successfully add units to a human player's recall list, the AI players don't seem to show any signs of recalling these units.
Does the AI program support recalling powerful units? If so, can anyone point me to a scenario where this has been done successfully?
Does the AI program support recalling powerful units? If so, can anyone point me to a scenario where this has been done successfully?
Re: Adding units to AI recall lists
I don't think the AI knows how to recall units. I think I remember trying something like this long ago, and the AI just simply wouldn't recall.Chris NS wrote:Does the AI program support recalling powerful units? If so, can anyone point me to a scenario where this has been done successfully?
Alternative solution: give the AI a limited number of lvl2 recruits. For example, every other turn allow the recruit of lvl2 units ([allow_recruit]), and make a recruit event that triggers when such a unit is recruited, and remove the lvl2 recruits in that event ([disallow_recruit]). You'll end up with the AI capable of recruiting one lvl2 unit every other turn. Tweak the values a bit (like max one lvl2 unit every turn, or two units every three turns, or whatever) and you should be able to end up with a nice mixed recruit pattern, so the AI mostly recruits lvl1 units but occasionally gets a lvl2 unit.
I don't think the ai can recall, as the ai players normaly just appear in one scenario and then not again.
However, I have a solution how you can make that the ai does only can have two of a certain unit type.
Though it might not work because of the filter. If not, try storing the unit and check its variables (type,side)
However, I have a solution how you can make that the ai does only can have two of a certain unit type.
Code: Select all
#define LIMIT_RECRUIT TYPE SIDE LIMIT
[event]
name=prestart
{VARIABLE recruits.{TYPE} 0}
[event]
name=recruit
first_time_only=no
[filter]
side={SIDE}
type={TYPE}
[/filter]
{VARIABLE_OP (recruits.{TYPE} add 1}
[if]
[variable]
name=recruits.{TYPE}
numerical_equals={LIMIT}
[/variable]
[then]
[disallow_recruit]
side={SIDE}
type={TYPE}
[disallow_recruit]
[/then]
[/if]
[/event]
#enddef
First read, then think. Read again, think again. And then post!