Can someone tell me what i did wrong?
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.
-
- Posts: 16
- Joined: June 1st, 2013, 1:21 am
Can someone tell me what i did wrong?
Neither of these will work. I am using stable version(10.6)
Code: Select all
#define ABILITY_ZZ_EXPERIENCED
[dummy]
id=zzexperienced
name= _ "experienced"
description= _ "When advancing, this unit will 10 experience points."
[/dummy]
[/abilities]
[event]
first_time_only=no
name=post advance
[filter_second]
side=$side_number
ability=zzexperienced
[/filter_second]
[set_variable]
name=second_unit.experience
add=10
[/set_variable]
[/event]
[+abilities]
#enddef
Code: Select all
#define ABILITY_ZZ_EXPERIENCED
[dummy]
id=zzexperienced
name= _ "experienced"
description= _ "When advancing, this unit will 10 experience points."
[/dummy]
[/abilities]
[event]
first_time_only=no
name=post advance
[filter]
side=$side_number
ability=id=zzexperienced
[/filter]
[set_variable]
name=unit.experience
add=10
[/set_variable]
[/event]
[+abilities]
#enddef
Re: Can someone tell me what i did wrong?
After modifying a stored unit with [set_variable], you have to unstore it to make the changes come into effect.
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
-
- Posts: 16
- Joined: June 1st, 2013, 1:21 am
Re: Can someone tell me what i did wrong?
Even after unstoring, that did not work. I even try storing the unit at that location, change exp and unstore again, still don't work.
Re: Can someone tell me what i did wrong?
I reread your code, and noticed a few things that I seem to have missed the last time:
The first one doesn't work because you're refering to the secondary unit which doesn't really exist in an advance event. It should be
The second one doesn't work because of
The first one doesn't work because you're refering to the secondary unit which doesn't really exist in an advance event. It should be
[filter]
and unit.experience
.The second one doesn't work because of
ability=id=zzexperienced
in the filter, that id=
really shouldn't be in there, ability=zzexperienced
was correct.Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
-
- Posts: 16
- Joined: June 1st, 2013, 1:21 am
Re: Can someone tell me what i did wrong?
Well after bunch of messing around, i got it working, so thank you.