New Ability
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.
New Ability
Actually, I'm trying to do something for Wesnoth by myself after playing it a long time.
Here is my Question: I want to make warmachines with incresed chance to hit and incresed damage if the opponent is in a castle or a village.
I copied the ability marksman and want to add a filter with the specific location of the opponent, but i dont know how to do that
Here is my Question: I want to make warmachines with incresed chance to hit and incresed damage if the opponent is in a castle or a village.
I copied the ability marksman and want to add a filter with the specific location of the opponent, but i dont know how to do that
#define WEAPON_SPECIAL_CATAPULT
[chance_to_hit]
id=catapult
name= _ "catapult"
description= _ "Catapult:
In castles or villages, this attack has at least 80% chance to hit."
value=80
cumulative=yes
active_on=offense
# [filter]
#if enemy on castle or village
# [/filter]
[/chance_to_hit]
[filter_opponent]? http://www.wesnoth.org/wiki/AbilitiesWML.
Code: Select all
[filter_opponent]
[filter_location]
terrain=*^V*,C*
[/filter_location]
[/filter_opponent]
It still doesnt works
it shoud be loaded by the campaign

its in a utils folder#define WEAPON_SPECIAL_CATAPULT
[chance_to_hit]
id=catapult
name= _ "catapult"
description= _ "Catapult:
In castles or villages, this attack has at least 80% chance to hit."
value=80
cumulative=yes
active_on=offense
[filter_opponent]
[filter_location]
terrain=*^V*,C*
[/filter_location]
[/filter_opponent]
[/chance_to_hit]
#enddef
it shoud be loaded by the campaign
#ifdef CAMPAIGN_ELVISH_WAR
[+units]
{~campaigns/Elvish_War/units}
[/units]
[binary_path]
path="data/campaigns/Elvish_War"
[/binary_path]
{@campaigns/Elvish_War/scenarios}
{@campaigns/Elvish_War/utils}
#endif
So it should work, but there is no mark on the unit for the ability, there is no remark about an errror, I dont know whats the problem[/quote][attack]
name=ballista
description=_"ballista"
type=pierce
[specials]
{WEAPON_SPECIAL_CATAPULT}
[/specials]
range=ranged
damage=9
number=3
icon=attacks/javelin-orcish.png
[/attack]
Always include macro definitions before the point at which they're used. Now you're including the units first, then the macros, which means that when the game preprocesses the units, it doesn't yet know that those macros exist, and therefore they are not substituted with anything.Sir Iwein wrote:its in a utils folder
it shoud be loaded by the campaign