difficulties with [target]
Moderator: Forum Moderators
difficulties with [target]
I've noticed that the ai no longer seems to behave the way it used to wrt the target tag. I'm trying to make allied units follow the player leader around and protect him (as in Home of the North Elves). But the allies resolutely ignore the player and zip off to fight the enemies.
Here's the relevant side definition:
This is with current CVS, and (I think) 0.7.9. I have tried putting target both in and outside the ai tag. The members of side 3 start off well out of range of any enemies. I suspect it might have something to do with this side being leaderless. This type of code worked back in 0.7.7.
Anyone else seen this problem? Does it afflict HotNE?
Here's the relevant side definition:
Code: Select all
[side]
type=Ghost
side=3
canrecruit=0
controller=ai
team_name=goodies
no_leader=yes
[ai]
village_value=0
[target] # try to get to Delfador and protect him
description=Delfador
value=100
[/target]
[/ai]
[unit]
description=Roland
type=Ghost
side=3
x=34
y=18
[/unit]
[/side]
Anyone else seen this problem? Does it afflict HotNE?
Re: difficulties with [target]
More on this problem... I've found that the problem goes away when leader_value is set to zero for the allies. At least that's a workaround. This behaviour is there in 0.7.10, and current 0.7.11-CVS.jp30 wrote:I've noticed that the ai no longer seems to behave the way it used to wrt the target tag.
I'm confused about what leader_value does. According to the Wiki, it controls how hard the AI tries to protect its own leader, but on line 144 of ai_move.cpp it seems to influence how hard the AI tries to attack enemy leaders.