WML - modify unit, so it have different damage type and slows
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.
WML - modify unit, so it have different damage type and slows
Hello,
I have a hero units, and I wish to make it so that unit (drake fighter) have cold attack and it can slow other units when melee fighting. I do not want to change ranged attack. How can I do it? Also i wish this to work, when hero advances to better unit. Here is what I have so far:
[unit]
type=Drake Fighter
id=Kazin
name= _ "Kazin"
side=1
x=28
y=31
experience=25
{IS_HERO}
[modifications]
{TRAIT_LOYAL}
{TRAIT_STRONG}
{TRAIT_RESILIENT}
[/modifications]
[/unit]
Also i am sure that more examples in pages like this will be super helpful: https://wiki.wesnoth.org/UnitTypeWML
I have a hero units, and I wish to make it so that unit (drake fighter) have cold attack and it can slow other units when melee fighting. I do not want to change ranged attack. How can I do it? Also i wish this to work, when hero advances to better unit. Here is what I have so far:
[unit]
type=Drake Fighter
id=Kazin
name= _ "Kazin"
side=1
x=28
y=31
experience=25
{IS_HERO}
[modifications]
{TRAIT_LOYAL}
{TRAIT_STRONG}
{TRAIT_RESILIENT}
[/modifications]
[/unit]
Also i am sure that more examples in pages like this will be super helpful: https://wiki.wesnoth.org/UnitTypeWML
Creator of Greenie knižnica and Greenie Linux and Wesnoth unofficial LiveCD; Slovak/Czech translator and creator of many campaigns. Everything is here on one place.
Re: WML - modify unit, so it have different damage type and slows
Add [object] with [effect] apply_to=attack to this unit.
Re: WML - modify unit, so it have different damage type and slows
i believe i found what was looking for here... https://wiki.wesnoth.org/index.php?titl ... §ion=5
[attack]
type=cold
[/attack]
{WEAPON_SPECIAL_SLOW}
is this okay, or going the wrong way again? not on pc with wesnoth so cannot run it...
[attack]
type=cold
[/attack]
{WEAPON_SPECIAL_SLOW}
is this okay, or going the wrong way again? not on pc with wesnoth so cannot run it...
Creator of Greenie knižnica and Greenie Linux and Wesnoth unofficial LiveCD; Slovak/Czech translator and creator of many campaigns. Everything is here on one place.
Re: WML - modify unit, so it have different damage type and slows
thanks. still not very good with syntax. can you pls re-write that unit with this?
Creator of Greenie knižnica and Greenie Linux and Wesnoth unofficial LiveCD; Slovak/Czech translator and creator of many campaigns. Everything is here on one place.
Re: WML - modify unit, so it have different damage type and slows
it looks like HTTT helps - sort of. still not working, donno why. Moremirmu the white mage have the same as I need, so i will just make small changes so cold is okay. but how to add slowing effect, like elvish shaman have?
This is my code and it have no effect
This is my code and it have no effect
Code: Select all
[modifications]
{TRAIT_STRONG}
{TRAIT_RESILIENT}
[object]
[effect]
apply_to=attack
range=melee
set_type=cold
[/effect]
[specials]
{WEAPON_SPECIAL_SLOW}
[/specials]
[/object]
[/modifications]
Last edited by Ravana on March 9th, 2021, 8:01 pm, edited 1 time in total.
Reason: [code]
Reason: [code]
Creator of Greenie knižnica and Greenie Linux and Wesnoth unofficial LiveCD; Slovak/Czech translator and creator of many campaigns. Everything is here on one place.
Re: WML - modify unit, so it have different damage type and slows
[object][specials] has no specific meaning. Functionality of object needs to be in [effect], with proper apply_to.
- MoonyDragon
- Posts: 149
- Joined: November 29th, 2017, 5:46 pm
Re: WML - modify unit, so it have different damage type and slows
The 'WML Reference' is generally clear enough on the tags and keys that can be used inside one another. I first went to SingleUnitWML, found the [modifications] tag, then jumped to DirectActionsWML for [object] and finally looked up EffectWML, where all your questions about 'apply_to=attack' are explained.
At last, the result:
At last, the result:
Code: Select all
[object]
[effect]
apply_to=attack
range=melee
set_type=cold
[set_specials]
{WEAPON_SPECIAL_SLOW}
[/set_specials]
[/effect]
[/object]
Default L0 Era - Level 1 leaders with level 0 recruits!
Re: WML - modify unit, so it have different damage type and slows
trying... but still no luck. I even copy+paste Moremirmu from HTTT, but even he does not work. his melee attack have different icon, but his attack is still the original one (impact in this instance)
testing on wesnoth 1.5.9.
testing on wesnoth 1.5.9.
Creator of Greenie knižnica and Greenie Linux and Wesnoth unofficial LiveCD; Slovak/Czech translator and creator of many campaigns. Everything is here on one place.
- Lord-Knightmare
- Discord Moderator
- Posts: 2364
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: WML - modify unit, so it have different damage type and slows
This should do the trick.
Code: Select all
[unit]
type=Drake Fighter
id=Kazin
name= _ "Kazin"
side=1
x=28
y=31
experience=25
{IS_HERO}
[modifications]
{TRAIT_LOYAL}
{TRAIT_STRONG}
{TRAIT_RESILIENT}
[object]
id="cold_melee_buff"
silent=yes
duration=forever
[effect]
apply_to=attack
set_type="cold"
[set_specials]
mode=append
{WEAPON_SPECIAL_SLOW}
[/set_specials]
[/effect]
[/object]
[/modifications]
[/unit]
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Re: WML - modify unit, so it have different damage type and slows
well... this is very strange. moremirmu works. he is a white mage and now he have arcane attack. i coppied EVERYTHING to my drake fighter hero, but he is still using blade attack. no idea why. I also looked at HTTT files and there are no modifications to moremirmu outside of this file. so... absolutly lost
why does it work on 1 unit and not on another unit?
why does it work on 1 unit and not on another unit?
Creator of Greenie knižnica and Greenie Linux and Wesnoth unofficial LiveCD; Slovak/Czech translator and creator of many campaigns. Everything is here on one place.
Re: WML - modify unit, so it have different damage type and slows
Thanks Lord, tested. but not working game bug? i will try it on other versions of Wesnoth...
Creator of Greenie knižnica and Greenie Linux and Wesnoth unofficial LiveCD; Slovak/Czech translator and creator of many campaigns. Everything is here on one place.
Re: WML - modify unit, so it have different damage type and slows
on 1.14 it works like a charm, on 1.15.9 it does not work.
so, many of you helped me and i am very glad, but it looks like there is a bug in 1.15... going to test on 1.5.10...
so, many of you helped me and i am very glad, but it looks like there is a bug in 1.15... going to test on 1.5.10...
Creator of Greenie knižnica and Greenie Linux and Wesnoth unofficial LiveCD; Slovak/Czech translator and creator of many campaigns. Everything is here on one place.
Re: WML - modify unit, so it have different damage type and slows
so...
1.14.15 - okay
1.15.9 - not working, bugs
1.15.10 - okay
thanks everyone a lot
1.14.15 - okay
1.15.9 - not working, bugs
1.15.10 - okay
thanks everyone a lot
Creator of Greenie knižnica and Greenie Linux and Wesnoth unofficial LiveCD; Slovak/Czech translator and creator of many campaigns. Everything is here on one place.
- MoonyDragon
- Posts: 149
- Joined: November 29th, 2017, 5:46 pm
Re: WML - modify unit, so it have different damage type and slows
I just tested your campaign on 1.15.9 and my code worked flawlessly. Is it possible that you are forgot to restart wesnoth (F5) after making your changes?
Code: Select all
[unit]
type=Drake Fighter
id=Kazin
name= _"Kazin"
side=1
x,y=28,31
experience=25
[modifications]
[object]
[effect]
apply_to=attack
range=melee
set_type=cold
[set_specials]
{WEAPON_SPECIAL_SLOW}
[/set_specials]
[/effect]
[/object]
{TRAIT_LOYAL}
{TRAIT_STRONG}
{TRAIT_RESILIENT}
[/modifications]
{IS_HERO}
[/unit]
Default L0 Era - Level 1 leaders with level 0 recruits!
- Lord-Knightmare
- Discord Moderator
- Posts: 2364
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: WML - modify unit, so it have different damage type and slows
Is it possible that you are forgot to restart wesnoth (F5) after making your changes?
1.15.9 had a bug with the1.15.9 - not working, bugs
{IS_HERO}
/{IS_LOYAL}
macros. The solution (for 1.15.9's bug) is shown in Moony Dragon's code where the {IS_HERO} has been moved to after the [/modifications]
.Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium