How to remove a unit type's attack special
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.
How to remove a unit type's attack special
I have a unit that uses [base_unit] to extend the Spearman. I would like to remove the first strike attack special for my unit.
I'm having a hard time figuring out how to use remove_specials. The examples in the forum all use [effect] but I have so far been unable to figure out the correct syntax to make it work in this case. And I didn't find any uses of it in the core WML code, for obvious reasons.
Here is my code:
I have also tried the following:
And the following:
Does anyone know how this should be used?
I'm having a hard time figuring out how to use remove_specials. The examples in the forum all use [effect] but I have so far been unable to figure out the correct syntax to make it work in this case. And I didn't find any uses of it in the core WML code, for obvious reasons.
Here is my code:
Code: Select all
[unit_type]
[base_unit]
id=Spearman
[/base_unit]
...
[attack]
name=spear
description=_"spear"
type=pierce
range=melee
damage=6
number=2
icon=attacks/spear.png
[/attack]
...
[effect]
apply_to=attack
remove_specials=firststrike
[/effect]
[/unit_type]
Code: Select all
[unit_type]
[base_unit]
id=Spearman
[/base_unit]
...
[attack]
name=spear
description=_"spear"
type=pierce
range=melee
damage=6
number=2
icon=attacks/spear.png
[/attack]
...
[effect]
apply_to=attack
[attack]
[filter]
name=spear
[/filter]
[/attack]
remove_specials=firststrike
[/effect]
[/unit_type]
Code: Select all
[unit_type]
[base_unit]
id=Spearman
[/base_unit]
...
[attack]
name=spear
description=_"spear"
type=pierce
range=melee
damage=6
number=2
icon=attacks/spear.png
[effect]
[attack]
remove_specials=firststrike
[/attack]
[/effect]
[/attack]
...
[/unit_type]
Re: How to remove a unit type's attack special
I understand documentation that special should have __remove=yes.UnitTypeWML for that unit is copied into this one, as if by [set_variables]mode=merge
[effect] is not recognized subtag of [unit_type].
Re: How to remove a unit type's attack special
Thank you Ravana! Can I ask where you found this in the documentation?
For anyone else who finds this thread, the working solution was:
For anyone else who finds this thread, the working solution was:
Code: Select all
[unit_type]
[base_unit]
id=Spearman
[/base_unit]
...
[attack]
name=spear
description=_"spear"
type=pierce
range=melee
damage=6
number=2
icon=attacks/spear.png
[specials]
__remove=yes
[/specials]
[/attack]
...
[/unit_type]
Re: How to remove a unit type's attack special
https://wiki.wesnoth.org/UnitTypeWML#Other_tags
> UnitTypeWML for that unit is copied into this one, as if by [set_variables]mode=merge
>> https://wiki.wesnoth.org/InternalAction ... riables.5D
>>> __remove=yes: When used in a subtag, causes the corresponding subtag in name to be deleted rather than merged. Deletion happens after any other subtags have been merged.
> UnitTypeWML for that unit is copied into this one, as if by [set_variables]mode=merge
>> https://wiki.wesnoth.org/InternalAction ... riables.5D
>>> __remove=yes: When used in a subtag, causes the corresponding subtag in name to be deleted rather than merged. Deletion happens after any other subtags have been merged.
Re: How to remove a unit type's attack special
Got it, thanks!