Cancelling [avoid] in the side [ai].
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.
Cancelling [avoid] in the side [ai].
According to wiki, new [avoid] input should replace the previous one. It did not work on my case. Could you please help me understand how it works? Is is possible to retract the [avoid] without this facet/path thing?
The initial setup:
Later in the scenario:
It doesn't seem to work, i.e., units are still avoiding the initially defined area at the top.
The initial setup:
Code: Select all
[ai]
aggression=1
grouping=no
[avoid]
x=20-49
y=7-25
[/avoid]
[goal]
name=target_location
[criteria]
x=32,33,34
y=16-17,16-18,16-17
[/criteria]
value=5
[/goal]
[/ai]
Code: Select all
[modify_ai]
side=2
[ai]
aggression=1
grouping=no
[avoid]
x=29,30-31
y=1-4,1-14
[/avoid]
[goal]
name=target_location
[criteria]
x=32,33,34
y=16-17,16-18,16-17
[/criteria]
value=5
[/goal]
[/ai]
[/modify_ai]
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Cancelling [avoid] in the side [ai].
I don't think so, but you can just change it to something unreachable anyway like 0,0 or 99,99.
You are using the format for [modify_side] inside a [modify_ai] tag. Changing it to [modify_side] should fix the problem.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Cancelling [avoid] in the side [ai].
Yes, it worked. Thank you.
- Celtic_Minstrel
- Developer
- Posts: 2207
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Cancelling [avoid] in the side [ai].
It's totally possible to remove an arbitrary `[avoid]`.beetlenaut wrote: ↑May 29th, 2023, 8:18 pmI don't think so, but you can just change it to something unreachable anyway like 0,0 or 99,99.
Code: Select all
[modify_ai]
action=delete
path=aspect[avoid].facet[0]
[/modify_ai]
*
to remove all of them. The only problem with this approach is that there's no way to specifically remove the last one – you need to know exactly how many there are if you want to do that.The second way is by ID. If you define your `[avoid]` a bit differently:
Code: Select all
[avoid]
id=my_avoid
[value]
# put your filter here
[/value]
[/avoid]
Code: Select all
[modify_ai]
action=delete
path=aspect[avoid].facet[my_avoid]
[/modify_ai]
Code: Select all
[avoid]
# some filter
[/avoid]
[avoid]
time_of_day=twilight
[value]
# some other filter
[/value]
[/avoid]
Code: Select all
[ai]
[avoid]
# some filter
[/avoid]
[/ai]
[ai]
time_of_day=twilight
[avoid]
# some other filter
[/avoid]
[/ai]