duplicate ai goals

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
vghetto
Posts: 103
Joined: November 2nd, 2019, 5:12 pm

duplicate ai goals

Post by vghetto »

Hi,

If a goal is defined for a side, then it will appear twice in the debug game inspector. anyone knows why?
And will this affect modify_ai action=delete goal?

Edit: How do I delete a goal anyway, what is the correct path?

I have [goal] name=protect_unit and the following didn't work.

Code: Select all

[modify_ai]
    side=8
    action=delete
    path=goal[protect_unit]
[/modify_ai]
Edit2: forgot to add id=protect_unit. that fixed it.
Last edited by vghetto on February 4th, 2020, 6:51 am, edited 1 time in total.

vghetto
Posts: 103
Joined: November 2nd, 2019, 5:12 pm

Re: duplicate ai goals

Post by vghetto »

I was working on my code and a modify_ai call straightened it out and removed the duplicates.
This might be a bug in wesnoth. You can try to reproduce it with Heir To the Throne. Start the first scenario on the hard difficulty and check the orcs goal. This is wesnoth 1.14.9 debian sid package.
httt.png

mattsc
Posts: 1152
Joined: October 13th, 2010, 6:14 pm
Location: Hidden on the hex behind Fred

Re: duplicate ai goals

Post by mattsc »

Thanks for reporting this. I have confirmed that this happens for me as well in 1.14.11+dev (but not in 1.15.2+dev).

I also confirmed that the goal is actually duplicated, as opposed to simply being shown twice in the inspector. It seems to be present twice in the AI configuration table already, rather than the goal being created twice from a single config entry. It does not happen if a scenario is started as a test scenario. I also noticed that the cpp engine appears twice in the inspector as well, which might or might not be related.

I don't know what is causing this yet, and I do not have time to investigate right now. I'm just writing the above down in case somebody else might know what may be causing this. If not, I'll investigate more at some point.

vghetto
Posts: 103
Joined: November 2nd, 2019, 5:12 pm

Re: duplicate ai goals

Post by vghetto »

I noticed that the goals get duplicated if they were defined inside the [side] tags. They won't get duplicated if defined via [modify_ai]

Post Reply