Aggressive unit?
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.
- Acho161293
- Posts: 32
- Joined: January 29th, 2020, 10:54 am
- Location: indonesian
- Contact:
Aggressive unit?
I made a scenario. and in that scenario on each side there is no leader. I bring up the units at each turn. but on the alliance side. they don't want to move to attack. how to get them all to be able to attack aggressively??
Re: Aggressive unit?
You can add this piece of code into the side you wish to attack aggressively:
This piece of code has been crafted by artisticdude.
If you need further information, just check https://wiki.wesnoth.org/AiWML.
Code: Select all
[ai]
agression=1
caution=0
village_value=0.0
grouping=no
simple_targeting=yes
{AI_SIMPLE_ALWAYS_ASPECT combat_ignore_bad_movements yes}
{AI_SIMPLE_ALWAYS_ASPECT combat_ignore_bad_combat yes}
{AI_SIMPLE_ALWAYS_ASPECT aggression 1.0}
{AI_SIMPLE_ALWAYS_ASPECT caution 0}
[/ai]
This piece of code has been crafted by artisticdude.
If you need further information, just check https://wiki.wesnoth.org/AiWML.
The future belongs to those, who believe in the beauty of their dreams.
Developer of: Trapped, Five Fates, Strange Legacy, Epical, UR Epic Era
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses, Dwarf Dwarfson Dwarvenminer
Developer of: Trapped, Five Fates, Strange Legacy, Epical, UR Epic Era
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses, Dwarf Dwarfson Dwarvenminer
- Acho161293
- Posts: 32
- Joined: January 29th, 2020, 10:54 am
- Location: indonesian
- Contact:
Re: Aggressive unit?
I will try it. ThanksHeindal wrote: ↑March 13th, 2020, 6:06 pm You can add this piece of code into the side you wish to attack aggressively:
Code: Select all
[ai] agression=1 caution=0 village_value=0.0 grouping=no simple_targeting=yes {AI_SIMPLE_ALWAYS_ASPECT combat_ignore_bad_movements yes} {AI_SIMPLE_ALWAYS_ASPECT combat_ignore_bad_combat yes} {AI_SIMPLE_ALWAYS_ASPECT aggression 1.0} {AI_SIMPLE_ALWAYS_ASPECT caution 0} [/ai]
This piece of code has been crafted by artisticdude.
If you need further information, just check https://wiki.wesnoth.org/AiWML.
Re: Aggressive unit?
small typo. Type in
aggression=1
instead of agression=1
- Acho161293
- Posts: 32
- Joined: January 29th, 2020, 10:54 am
- Location: indonesian
- Contact:
Re: Aggressive unit?
it's appropriate, I tried it but there was no change in my unit.
Thanks.
Re: Aggressive unit?
Do they make any moves or stay at their starting positions? Check that you haveAcho161293 wrote: ↑March 2nd, 2020, 11:38 pm I made a scenario. and in that scenario on each side there is no leader. I bring up the units at each turn. but on the alliance side. they don't want to move to attack. how to get them all to be able to attack aggressively??
controller=ai
inside of the side
tag. If that doesn't help post the whole code of the side
tag.Author of SP scenario Dragon Fight and SP campaign Captured by a Nightmare.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
- Acho161293
- Posts: 32
- Joined: January 29th, 2020, 10:54 am
- Location: indonesian
- Contact:
Re: Aggressive unit?
thank you for your answer. at this moment my scenario has gone well. I added the target unit and it worked and made my unit move from its place.
I tried to put this down...
Code: Select all
[ai]
[goal]
[criteria] #NOTE: this is a SUF, because we're targeting a unit
side=2
[/criteria]
value=5
[/goal]
[/ai]
Re: Aggressive unit?
Oh, that makes sense. Usually AI moves units in direction to enemy leader or villages. As you said there is no leaders.
Author of SP scenario Dragon Fight and SP campaign Captured by a Nightmare.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.