Is there a command that forces a unit to level up?

The place to post your WML questions and answers.

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.
Post Reply
User avatar
LordAwsomeness
Posts: 203
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Is there a command that forces a unit to level up?

Post by LordAwsomeness »

Hi, does anyone know of a command that will go under the command syntax that will force a unit to level up to either its next level, or force it to level up to another type? I was thinking maybe store_unit could do this when i unstored_unit, but I have not tried yet. If you reply, please quote my text so i can receive a notification for this. Thanks!!

Code: Select all

[command]
{WML}
[/command]
- 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
User avatar
WhiteWolf
Forum Moderator
Posts: 769
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Is there a command that forces a unit to level up?

Post by WhiteWolf »

LordAwsomeness wrote: May 9th, 2018, 6:25 pm If you reply, please quote my text so i can receive a notification for this. Thanks!!
You could manually set the unit's experience to its max experience. It'll level up when unstored.

Code: Select all

[store_unit]
    [filter]
        your unit
    [/filter]
    variable=adv
    kill=yes
[/store_unit]
{VARIABLE adv.experience $adv.max_experience}
[unstore_unit]
	variable=adv
[/unstore_unit]
For forcing it to level to another type, I recommend [transform_unit]: https://wiki.wesnoth.org/DirectActionsW ... rm_unit.5D
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
User avatar
LordAwsomeness
Posts: 203
Joined: August 12th, 2013, 2:20 pm
Location: U.S.A.

Re: Is there a command that forces a unit to level up?

Post by LordAwsomeness »

WhiteWolf wrote: May 9th, 2018, 6:45 pm
You could manually set the unit's experience to its max experience. It'll level up when unstored.

Code: Select all

[store_unit]
    [filter]
        your unit
    [/filter]
    variable=adv
    kill=yes
[/store_unit]
{VARIABLE adv.experience $adv.max_experience}
[unstore_unit]
	variable=adv
[/unstore_unit]
For forcing it to level to another type, I recommend [transform_unit]: https://wiki.wesnoth.org/DirectActionsW ... rm_unit.5D
Thanks!
- 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
Post Reply