[BfW 1.13] Removing all advancements & experience

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
doofus-01
Art Director
Posts: 4122
Joined: January 6th, 2008, 9:27 pm
Location: USA

[BfW 1.13] Removing all advancements & experience

Post by doofus-01 »

(This is in reference to applying [effect]s to a unit to modify any defeated opponent unit, mimicking plague, but not converting the opponent into a predefined [unit_type].)
Zap-Zarap, in another thread, wrote:Khthon, ... one small esthetic detail i dislike a little bit,are the blueish color of the thralls and their huge 1000xp-bar, that somehow hurt my eyes and make playing them a little bit less enjoyable.
I agree that the huge XP bars don't look so great, but I wanted to make it clear that the unit cannot advance. It seems that applying an [object] that replaces AMLAs and advancement types with dummies, then remove the dummies with [effect]apply_to=new_advancement/remove_advancement, does get rid of advancements, and the XP bars and advancement animation/events are gone (the XP is still displayed in the side-panel, see attached image).
That's great, but is that expected behaviour and will it be preserved in future BfW versions?

Is there a better way to remove the experience mechanics and all related visual cues from the unit (not [unit_type], must be on the fly)?

Thanks.
Attachments
no_advances.jpg
no_advances.jpg (35.53 KiB) Viewed 3516 times
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: [BfW 1.13] Removing all advancements & experience

Post by gfgtdf »

I'd say that it's at least inconsistent that the max_experience is shown in the right side panel but not in other places if the unit has no possible advancements, (iirc unit recall list for example doesn't show the max_expeirience in that case). So i think it's be better to change it, mostlikeley by not showing max_experience in the the right-side-panel.

Also i don't understand why you need 2 objects to remove advancements, couldn't you just use remove_advancement without replacing the advancemnts with dummies first?
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
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: [BfW 1.13] Removing all advancements & experience

Post by zookeeper »

As an implementation idea, maybe the best way to let WML signal that the unit's XP should be ignored (bars, side panel, etc) would be to allow setting max_experience to -1.

Currently, EffectWML doesn't allow one to set the unit's max_experience (only increase/decrease), so a way to do that (apply_to,set=max_experience,-1) might need to be added. Not sure if it's currently missing due to some specific reason such as how multiplayer XP modifiers are implemented, though.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: [BfW 1.13] Removing all advancements & experience

Post by gfgtdf »

zookeeper wrote:As an implementation idea, maybe the best way to let WML signal that the unit's XP should be ignored (bars, side panel, etc) would be to allow setting max_experience to -1.
The problem i see is that itprobably incompatible with other effects the change the unit expierience, lets say you have an [object] that gives a unit for exampel mor damage but at the cost of increasing max expierience by 2 then a unit which previosly had -1 maxxp woudl then have 1 maxxp

zookeeper wrote:Currently, EffectWML doesn't allow one to set the unit's max_experience (only increase/decrease), so a way to do that (apply_to,set=max_experience,-1) might need to be added.
It can, see https://github.com/wesnoth/wesnoth/blob ... .cpp#L1953

zookeeper wrote:Not sure if it's currently missing due to some specific reason such as how multiplayer XP modifiers are implemented, though.
There are some issues related to effects and xp_midfers already (unrelated to set=), see https://github.com/wesnoth/wesnoth/issues/1796
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
doofus-01
Art Director
Posts: 4122
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: [BfW 1.13] Removing all advancements & experience

Post by doofus-01 »

gfgtdf wrote:Also i don't understand why you need 2 objects to remove advancements, couldn't you just use remove_advancement without replacing the advancemnts with dummies first?
How would one do that? Just using an empty "types" key, or leaving those keys out altogether, in a remove_advancement effect doesn't do anything. I suppose one could query and store the advancement/advances_to data, but that seems worse than just overwriting with a dummy and removing the dummy. Just using something like "type=$unit.advances_to" might work, but then empty tags, and maybe keys, have a nasty habit of disappearing lately, so I don't want to rely on that.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: [BfW 1.13] Removing all advancements & experience

Post by gfgtdf »

i admit that i didn't read the descpition of effect. What you desribed just sounded quite hacky to me, but it's probably the only way currently, maybe i'll file a featurerequest.
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
doofus-01
Art Director
Posts: 4122
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: [BfW 1.13] Removing all advancements & experience

Post by doofus-01 »

gfgtdf wrote:
zookeeper wrote:As an implementation idea, maybe the best way to let WML signal that the unit's XP should be ignored (bars, side panel, etc) would be to allow setting max_experience to -1.
The problem i see is that itprobably incompatible with other effects the change the unit expierience, lets say you have an [object] that gives a unit for exampel mor damage but at the cost of increasing max expierience by 2 then a unit which previosly had -1 maxxp woudl then have 1 maxxp
Would just having any negative value cause the XP to be ignored work? Set it to -1000 to avoid modifiers doing what you describe. There would still be potential for mischief, but it could be corrected by the author and there would be no magic value to know about.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: [BfW 1.13] Removing all advancements & experience

Post by enclave »

Hi, sorry, I have a question related to xp bars too, I hope I can ask it here...
I seem to want same thing as doofus-01, I just want to get rid of xp bar shown on unit or to be able to modify it, how do I do that?
Ideally modify the xp bar to my needs without affecting unit advancement.. so for example it would show 23/5 on side panel, white bar on a unit, but unit would not advance to anything, no amla! nothing??
I don't care at all what will be displayed in the side panel.. 99/23 or whatever..

Hmm looks like I need either or.. so 2-3 questions..
1) How to make unit not advance or AMLA? make xp bar show white and side panel show 23/5 . Unit not gain health, advance events ignored?
2) How to modify xp bar on unit to show something different than unit.max_experience ?
3) How to make xp bar on unit disappear at all?

doofus-01 could you paste your code with hack please.. would really save me a lot of time googling wiki, would appreciate it a lot!
Thanks all!

PS. silly me.. I'm on 1.12 wesnoth.. can anything be done or no? :(
PPS. can not find xp bar image.. says energy="misc/bar-energy.png" but in core/images/misc there is no "bar-energy.png" is it not in core? or hidden?
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: [BfW 1.13] Removing all advancements & experience

Post by enclave »

Answer to my questions:

1) To get rid of xp bar you can do the following:

Code: Select all

[store_unit]
[filter]
x=10
y=20
[/filter]
variable=hc_recruited_unit
[/store_unit]
{VARIABLE hc_recruited_unit.advances_to null}
[unstore_unit]
variable=hc_recruited_unit
[/unstore_unit]
This way xp bar does NOT show at all. Unit has 8/5 xp and does NOT advance, you do NOT get any options to advance. Advance is not happening at all.

But if you store unstore unit again it comes back to normal state, it gains "advances_to=.." from space or God, not sure where exactly from.
strict_amla doesn't seem to have any affect.

No idea how to make custom xp bar apart from using BLIT depending on xp number.. too complicated to be bothered, but could be done in conjunction with "advances_to=null" and lua theme.items


I just used the default way for custom advencements and standard proper xp bar. Just modify unit in "advance" event, changing xp to below maximum_experience will cancel the advancement. It will still blink as if unit has advanced to something, but you can control the rest.
Last edited by Pentarctagon on January 12th, 2018, 11:50 pm, edited 1 time in total.
Reason: Fixed WML formatting
Post Reply