Unit XP-bar color-setting with custom AMLA's

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
WhiteWolf
Forum Moderator
Posts: 769
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Unit XP-bar color-setting with custom AMLA's

Post by WhiteWolf »

Hello,

I am using some custom AMLA's in my campaign, very similarly to how it's done UtBS.
a few examples:
It functions well, however, all max-level units still have blue XP-bar. This is the same in UtBS as I checked.
However, I would like to indicate that the units are already max level and will only do AMLA's by using the standard purple XP-bar. In the wiki it doesn't say anything about this, and setting strict_amla=yes doesn't help. The default AMLA code doesn't have any extra setting that would imply the colour of the XP-bar.
So what makes it purple, and how do I get it to stay purple?

Thanks,
WhiteWolf
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
Ravana
Forum Moderator
Posts: 2997
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Unit XP-bar color-setting with custom AMLA's

Post by Ravana »

I guess it depends on existence of advance_to in that unit.
User avatar
WhiteWolf
Forum Moderator
Posts: 769
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Unit XP-bar color-setting with custom AMLA's

Post by WhiteWolf »

As far as I know, it doesn't. For example, if you set advances_to=null, but omit {AMLA_DEFAULT} from a unit, the bar will be blue.
Also, judging from UtBS, Quenoth Youth has advances_to=null in its code, so it's definitely not that. :(
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
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: Unit XP-bar color-setting with custom AMLA's

Post by enclave »

sorry for not being much helpful but im sure it's achievable somehow.. you just have to play around with variables REALLY a lot.. look [unit] tag and [unit_type] tags, all possible things to do with experience, amla and advancements..

my memory is crap, so i cant tell how, but im 99% certain i could do purple bars..
looking at some of my old code i found this: {VARIABLE new_unit_advancement[0].modifications.advance.strict_amla no}
i dont remember what exactly i was trying to achieve (could be the opposite of yours.. to remove purple bars from unit and give it blue one, i dont remember). So try to set advance_to=null (maybe nill), OR advances_to... strict_amla - YES
(I have no idea now why i used strict amla in MODIFICATIONS as my example shows.. browse some wiki help, maybe u find something uselful...)

there is a chance that you need to add modification to unit like so (just in your case strict_amla i assume would be YES):

Code: Select all

[modifications]
[advance]
id="ogre_leader_advancement"
description="Can advance into Ogre Leader"
strict_amla=no
always_display=true
require_amla=blabla
[/advance]
[/modifications]
or

Code: Select all

[modifications]
[advancement]
id="ogre_leader_advancement"
description="Can advance into Ogre Leader"
strict_amla=no
always_display=true
require_amla=blabla
[/advancement]
[/modifications]
but i can't tell if it's going to do anything for sure.. you have to try it..

best way is to use command line during local game, type there "debug" and then type "inspect" in command line as well (:debug :inspect), double dots open command line. In the inspection you can observe every unit array and see what variables you could modify (with [store_unit], [unstore_unit], or possibly [unit_type], [unit], depends on how you code your amlas etc), not all variables will be modifiable unfortunately.. but most will.

sorry for not telling you how exactly to solve your problem, because I do NOT know.. but just giving you some ideas if you despearate and nobody else able to solve your problem atm.
User avatar
Ravana
Forum Moderator
Posts: 2997
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Unit XP-bar color-setting with custom AMLA's

Post by Ravana »

There is major_amla https://github.com/wesnoth/wesnoth/comm ... t-26715656. Not sure how it works, but if it does something useful, you could add it to wiki.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2357
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: Unit XP-bar color-setting with custom AMLA's

Post by Lord-Knightmare »

I solved this problem two years ago. All you have to do is add {AMLA_DEFAULT} to your list of AMLA choices.
Spoiler:
It appears on the list, you can select it if you want...
It appears on the list, you can select it if you want...
XP bar after all buff AMLAs, the XP bar stays purple
XP bar after all buff AMLAs, the XP bar stays purple
Base Unit
Base Unit
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
WhiteWolf
Forum Moderator
Posts: 769
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Unit XP-bar color-setting with custom AMLA's

Post by WhiteWolf »

Lord-Knightmare wrote: January 20th, 2019, 1:13 pm I solved this problem two years ago. All you have to do is add {AMLA_DEFAULT} to your list of AMLA choices.
That's fine, but that's precisely what I wish to avoid, because I am not increasing the max XP with these. The default is there, but it has require_amla on all the custom ones.

enclave: I already tried most of those before posting :)
So, results: strict_amla and advances_to does nothing concerning this issue. major_amla does :) Apparently it defaults to yes, and if there is more than one [advancement] available with it, then the bar is blue. Setting them all to major_amla=no solves the issue and the bar is purple. I'll add this to the wiki then.

Thanks everyone :)
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
Lord-Knightmare
Discord Moderator
Posts: 2357
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: Unit XP-bar color-setting with custom AMLA's

Post by Lord-Knightmare »

because I am not increasing the max XP with these
If that's the case why not use just a customised {AMLA_DEFAULT_UMC} that does not cause an increase in maximum XP?
If that is used, then the max_experience amount never increases pass the defined value in the unit.cfg file but just resets to zero after every upgrade.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Unit XP-bar color-setting with custom AMLA's

Post by gfgtdf »

WhiteWolf wrote: January 20th, 2019, 5:22 pm Setting them all to major_amla=no solves the issue and the bar is purple. I'll add this to the wiki then.
your wiki entry is not 100% currect though, it defaults to 'no'. If it ppears to true in the code you pasted above, then it's likeley that you acceindly wrote major_amla=yes somehere before, for exampel in the {HEAL_EFFECTS} macro.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
WhiteWolf
Forum Moderator
Posts: 769
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Unit XP-bar color-setting with custom AMLA's

Post by WhiteWolf »

Lord-Knightmare wrote: January 20th, 2019, 7:18 pm
because I am not increasing the max XP with these
If that's the case why not use just a customised {AMLA_DEFAULT_UMC} that does not cause an increase in maximum XP?
If that is used, then the max_experience amount never increases pass the defined value in the unit.cfg file but just resets to zero after every upgrade.
I wasn't precise enough - I only want to enable the default AMLA specifically after a unit completed its custom AMLA's and not before. For story reasons as well. :)
gfgtdf wrote: January 20th, 2019, 8:16 pm your wiki entry is not 100% currect though, it defaults to 'no'. If it ppears to true in the code you pasted above, then it's likeley that you acceindly wrote major_amla=yes somehere before, for exampel in the {HEAL_EFFECTS} macro.
And indeed I did :doh: Corrected that, sorry.
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
Post Reply