[SOLVED] Problem with weapon 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.
- Nyanyanyan
- Posts: 73
- Joined: May 11th, 2018, 10:40 pm
[SOLVED] Problem with weapon special
I'm trying to make a pretty straightforward weapon special. It's basically supposed to be the bloodlust ability from https://wiki.wesnoth.org/WML_Abilities#Bloodlust as a weapon special. To implement this I tried
But upon launching the Era it tells me that this macro wasn't found. It's in the ability.cfg of that era which has a lot of working abilities and specials in it.
Any idea why this is happening or anything else that might be wrong with "my" code?
Thanks in advance.
Code: Select all
#define WEAPON_SPECIAL_DOD
[dummy]
id=dod
name= _ "dance of death"
description=_"Dance of Death"
[/dummy]
[/specials]
[/attack]
[event]
name=die
first_time_only=no
[filter_second]
special=dod
[/filter_second]
{MODIFY_UNIT x,y=$x2,$y2 moves 1}
{MODIFY_UNIT x,y=$x2,$y2 attacks_left 1}
[/event]
[+attack]
[+specials]
#enddef
Any idea why this is happening or anything else that might be wrong with "my" code?
Thanks in advance.
Last edited by Nyanyanyan on October 22nd, 2018, 11:50 am, edited 1 time in total.
Author of Age of Lords and the Revolution and Civil War and Expendable Leaders 2 multiplayer mods.
Re: Problem with weapon special
There may be a way to make that work given the setup you did, but I would do it a different way. Remove the weapon special, then add the following event to the unit:
If this is not working try removing filters entirely and just allowing all units to have this ability to see if that even works. I have always just done events instead of using weapon specials. For example:
Code: Select all
[event]
name=die
first_time_only=no
[filter_second]
id=PUT_UNIT_ID_HERE
[/filter_second]
{MODIFY_UNIT x,y=$x2,$y2 moves 1}
{MODIFY_UNIT x,y=$x2,$y2 attacks_left 1}
[/event]
Code: Select all
[event]
name=attacker_hits
first_time_only=no
[filter_attack]
name=Theft
[/filter_attack]
[store_unit]
[filter]
x,y=$x1,$y1
[/filter]
variable=unit_att_with_charm
mode=append
[/store_unit]
[set_variable]
name=unit_att_with_charm.variables.charm_has_worked
value=yes
[/set_variable]
[unstore_unit]
variable=unit_att_with_charm
[/unstore_unit]
{CLEAR_VARIABLE unit_att_with_charm}
[/event]
Creator of 120+ units Lord of the Rings era and campaign now outdated & lost.
Creator of WWII Battleground Europe mod with 120+ units most with custom wml and animations. Every variable is mathematically derived based on WWII stats such as historical cost & mm armour.
Creator of WWII Battleground Europe mod with 120+ units most with custom wml and animations. Every variable is mathematically derived based on WWII stats such as historical cost & mm armour.
- Nyanyanyan
- Posts: 73
- Joined: May 11th, 2018, 10:40 pm
Re: Problem with weapon special
The thing is that I want the special to be recognized as an actual weapon special since this is for an era not a campaign so it's important people know the abilities of units and I may apply it to more than one unit which would make everything pretty messy for those unit codes.Kharn wrote: ↑October 21st, 2018, 11:45 pm There may be a way to make that work given the setup you did, but I would do it a different way. Remove the weapon special, then add the following event to the unit:
If this is not working try removing filters entirely and just allowing all units to have this ability to see if that even works. I have always just done events instead of using weapon specials. For example:Code: Select all
[event] name=die first_time_only=no [filter_second] id=PUT_UNIT_ID_HERE [/filter_second] {MODIFY_UNIT x,y=$x2,$y2 moves 1} {MODIFY_UNIT x,y=$x2,$y2 attacks_left 1} [/event]
Code: Select all
[event] name=attacker_hits first_time_only=no [filter_attack] name=Theft [/filter_attack] [store_unit] [filter] x,y=$x1,$y1 [/filter] variable=unit_att_with_charm mode=append [/store_unit] [set_variable] name=unit_att_with_charm.variables.charm_has_worked value=yes [/set_variable] [unstore_unit] variable=unit_att_with_charm [/unstore_unit] {CLEAR_VARIABLE unit_att_with_charm} [/event]
Anyway, my real concern for now isn't that my ability isn't running as intended, it really is that my special isn't even recognized.
Thanks for reply though.
Author of Age of Lords and the Revolution and Civil War and Expendable Leaders 2 multiplayer mods.
- Nyanyanyan
- Posts: 73
- Joined: May 11th, 2018, 10:40 pm
Re: Problem with weapon special
Apparently the problem was that I somehow deleted the previous #enddef so yeah, it had nothing to do with the code.
Author of Age of Lords and the Revolution and Civil War and Expendable Leaders 2 multiplayer mods.