How can I remove the ai_special=guardian?
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.
- SL-KoL-yaN
- Posts: 12
- Joined: October 10th, 2013, 10:01 am
How can I remove the ai_special=guardian?
Few hours ago i had a trouble. I need modify unit with ai_special=guardian ability to unit without it. I try transform unit to new type, try modify unit to ai_special=no. But it doesn't removed.
WML-code:
General fragment in code of scenario:
Macros of unit modification:
Code of ai's options:
Questions:
0. Why removing ai_special with [modify_unit] do not working?
1.How can i remove ai_special from unit?
2.Ai_special can be only "guardian". Where i can find code of this speciality?
3. How i can create my ai_special?
P.S: Counter of variables and my macros for modification completely tested and work. But ai_special work after modification of unit.
WML-code:
General fragment in code of scenario:
Code: Select all
[event]
name=attack
first_time_only=no
[filter]
side=1
[/filter]
[filter_second]
side=2
[/filter_second]
[set_variable]
name=target_activated
add=1
[/set_variable]
[if]
[variable]
name=target_activated
equals=1
[/variable]
[then]
[message]
speaker=Alan
message= _ "..."
[/message]
[message]
speaker=Harg
message= _ "..."
[/message]
[/then]
[else]
[/else]
[/if]
[if]
[variable]
name=target_activated
equals=3
[/variable]
[then]
[message]
speaker=unit
message= _ "..."
[/message]
[/then]
[else]
[/else]
[/if]
[if]
[variable]
name=target_activated
equals=7
[/variable]
[then]
{MODIFY_UNIT
(
id=gob
)
(
ai_special=no
)
}
[modify_ai]
side=2
action=add
path=aspect[aggression].facet[]
[facet]
value=0.55
[/facet]
action=delete
path=aspect[caution].facet[]
[facet]
value=1.0
[/facet]
[/modify_ai]
[objectives]
summary= _ "New objectives"
[objective]
description= _ "Retereat for river"
condition=win
[/objective]
[objective]
description= _ "Death of Alan"
condition=lose
[/objective]
{TURNS_RUN_OUT}
[gold_carryover]
bonus=yes
carryover_percentage=80
[/gold_carryover]
[/objectives]
[message]
speaker=unit
message= _ "..."
[/message]
[message]
speaker=Harg
message= _ "..."
[/message]
[message]
speaker=Alan
message= _ "..."
[/message]
[message]
speaker=Alan
message= _ "..."
[/message]
[/then]
[else]
[/else]
[/if]
[/event]
Code: Select all
#define MODIFY_UNIT FILTER_WML UPGRADE
[modify_unit]
[filter]
{FILTER_WML}
[/filter]
{UPGRADE}
[/modify_unit]
#enddef
Code: Select all
[ai]
aggression=0.45
caution=0.10
village_value=0.0
[/ai]
0. Why removing ai_special with [modify_unit] do not working?
1.How can i remove ai_special from unit?
2.Ai_special can be only "guardian". Where i can find code of this speciality?
3. How i can create my ai_special?
P.S: Counter of variables and my macros for modification completely tested and work. But ai_special work after modification of unit.
Last edited by SL-KoL-yaN on June 13th, 2014, 8:08 am, edited 1 time in total.
Re: How can I remove the ai_special=guardian?
To un-guardian a unit, you also need to clear its status.guardian key. So, in your case, this should do the job:
P.S. See how nice
Code: Select all
{MODIFY_UNIT id=gob (
ai_special=no
[status]
guardian=no
[/status]
)}
Code: Select all
tags are? Please use them. :eng:
- SL-KoL-yaN
- Posts: 12
- Joined: October 10th, 2013, 10:01 am
How can I create new ai_special?
Thanks for help!
But can you answer another question:
how can i create new my ai_special?

But can you answer another question:
how can i create new my ai_special?
Re: How can I remove the ai_special=guardian?
You can't; guardianing is the only use the feature has. There has simply never been any other specials added, and nowadays if you want to give units special AI behavior it'd be done via Micro AIs anyway, so ai_special is pretty much just a historical relic (although a very often used one).
- SL-KoL-yaN
- Posts: 12
- Joined: October 10th, 2013, 10:01 am
Re: How can I remove the ai_special=guardian?
Thanks for help