AMLA code not quite working
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.
- LordAwsomeness
- Posts: 203
- Joined: August 12th, 2013, 2:20 pm
- Location: U.S.A.
AMLA code not quite working
Hi so im experimenting with some AMLA coding and im having some issues. Currently im trying to use a variable to increase the unit's current hp as an alternative to full healing. unfortunately the variable AMLA is not working. it shows up fine in the inspect window so I know that the code is fine.
Here's the code:
here's essentially what the code is supposed to do:
Here's the code:
Code: Select all
#define LA_AMLA_BUFF
[advancement]
strict_amla=yes
max_times=100
id=la_amla_buff
description= _ "Max HP bonus +4, Max XP +10%"
image="icons/amla-default.png"
[effect]
apply_to=hitpoints
increase_total=4
increase=$la_hero[$unit.side].amla.hp_recovery
violate_maximum=no
# heal_full=yes
[/effect]
[effect]
apply_to=max_experience
increase=10%
[/effect]
[effect]
apply_to=status
remove=poisoned
[/effect]
[effect]
apply_to=status
remove=slowed
[/effect]
[/advancement]
#enddef
Code: Select all
#define LA_AMLA_BUFF
[advancement]
strict_amla=yes
max_times=100
id=la_amla_buff
description= _ "Max HP bonus +4, Max XP +10%"
image="icons/amla-default.png"
[effect]
apply_to=hitpoints
increase_total=4
increase=16
violate_maximum=no
# heal_full=yes
[/effect]
[effect]
apply_to=max_experience
increase=10%
[/effect]
[effect]
apply_to=status
remove=poisoned
[/effect]
[effect]
apply_to=status
remove=slowed
[/effect]
[/advancement]
#enddef
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
Re: AMLA code not quite working
I guess that the $unit variable is not available in this context. It's only available in [event]s
$side_number should work, though that fits only offensively.
$side_number should work, though that fits only offensively.
Try out the dark board theme.
- LordAwsomeness
- Posts: 203
- Joined: August 12th, 2013, 2:20 pm
- Location: U.S.A.
Re: AMLA code not quite working
Isn't post_advance an event though?
I figured $unit.side would be better since you can level up when its not your turn
EDIT:
I just created an object effect in a post_advance event and made the modifications that I wanted to there. Thank you for your help though! Problem is now solved!
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
Re: AMLA code not quite working
It is, but the [advancement] doesn't happen in an event.
But you can save the value of $unit.side in a pre advancement event to another variable, and clear it in post advancement.
If that it the problem.
Definitely.LordAwsomeness wrote: ↑February 12th, 2020, 3:15 am I figured $unit.side would be better since you can level up when its not your turn
Try out the dark board theme.
- LordAwsomeness
- Posts: 203
- Joined: August 12th, 2013, 2:20 pm
- Location: U.S.A.
Re: AMLA code not quite working
Just edited my last post. Put it in an object in a post_advance event and it worked perfectly. Thank you for your help!
- Been playing Wesnoth since 2004 and the 1.0.x versions.
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA
- Creator of Undead Invasion MP Scenario Pack.
- Creator of Valeria MP Adventure
- Creator of LA_RPG ERA