Store_unit not working in 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.
Store_unit not working in weapon special
Hello, I am new to the forum and was trying to create an ability that would "burn units". The ability shows up but does nothing. I don't have a lot of WML experience but here is my code:
I simplified it down to the level of just reducing the HP to one, I haven't gotten around to implementing any of the resistance checks and damage. I would appreciate any help.
Code: Select all
#define WEAPON_SPECIAL_BURN ATTACK
[dummy]
id=burn
name= _ "Burn"
name_inactive= _ "Burn"
description= _ "When an enemy is burned they will lose hp depending on their fire resistance until they stay in a water or a village for a turn. Burning can't be healed by a healer."
[/dummy]
[/specials]
[event]
name=attacker_hits
first_time_only=no
[special_filter]
weapon={ATTACK}
[/special_filter]
[store_unit]
variable=burned
kill=yes
[filter_second]
description=$second_unit
[/filter_second]
[/store_unit]
[set_variable]
name=burned.hitpoints
value=1
[/set_variable]
[unstore_unit]
variable=burned
text= _ "3"
red, green, blue=250,0,0
[/unstore_unit]
[/event]
[+specials]
#enddef
Re: Store_unit not working in weapon special
Code: Select all
[filter_second]
description=$second_unit
[/filter_second]
I think maybe you meant this:
Code: Select all
[filter]
description=$second_unit.description
[/filter]
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: Store_unit not working in weapon special
Thank you for your help Sapient, but it didn't work. I even tried taking out all of the filters, still only the description shows up.
If this is unclear I want to have a equivalent of the dehydration in UtBS in a ability. Currently I am trying to just get something that will set the enemies hp to 1. Then I will build up from there.
-Cuervo
If this is unclear I want to have a equivalent of the dehydration in UtBS in a ability. Currently I am trying to just get something that will set the enemies hp to 1. Then I will build up from there.
-Cuervo
Re: Store_unit not working in weapon special
You're making the [event] end up inside [attack].
Re: Store_unit not working in weapon special
zookeeper is right; you should define the event separately using a different macro name and then include it inside the unit type definition (not inside the attack definition).
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: Store_unit not working in weapon special
Thanks Zookeeper and Sapient. I did need to move the events outside of the [attack] but I also needed to use second_unit instead of secondary_unit. But now I have another question. Is it possible to only have the event trigger after the attack is done and after the attach hits? I couldn't find this. I do have the development version too i that function is only included there. Thanks
-Cuervo
-Cuervo
- krotop
- 2009 Map Contest Winner
- Posts: 433
- Joined: June 8th, 2006, 3:05 pm
- Location: Bordeaux, France
Re: Store_unit not working in weapon special
Probably you would want to make that in 2 steps.
1. use an attack event to categorize a unit as 'affected by burn'
2. use a turn refresh event that does damage if a unit is affected by burn and not in water, or 'uncategorize' units affected by burn but are in water.
1. use an attack event to categorize a unit as 'affected by burn'
2. use a turn refresh event that does damage if a unit is affected by burn and not in water, or 'uncategorize' units affected by burn but are in water.
Don't trust me, I'm just average player.
***
Game feedback for the Nightmares of Meloen
Art feedback by mystic x the unknown
***
Game feedback for the Nightmares of Meloen
Art feedback by mystic x the unknown
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Store_unit not working in weapon special
Cuervo wrote:Is it possible to only have the event trigger after the attack is done and after the attach hits?
Code: Select all
[event]
name=attacker_hits
...
[event]
name=attack_end
...
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Store_unit not working in weapon special
Thanks for your help, I am very appreciative . I was stuck on that for a log time and it turned out to be somewhat trivial, but I learning. Thanks very much.
-Cuervo
-Cuervo