[BfW 1.13] Removing all advancements & experience

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.

[BfW 1.13] Removing all advancements & experience

Postby doofus-01 » August 12th, 2017, 1:52 pm

(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 326 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
User avatar
doofus-01
Art Contributor
 
Posts: 3540
Joined: January 6th, 2008, 9:27 pm
Location: USA ...

Re: [BfW 1.13] Removing all advancements & experience

Postby gfgtdf » August 12th, 2017, 2:58 pm

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.
gfgtdf
Developer
 
Posts: 900
Joined: February 10th, 2013, 2:25 pm

Re: [BfW 1.13] Removing all advancements & experience

Postby zookeeper » August 12th, 2017, 3:17 pm

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.
User avatar
zookeeper
WML Wizard
 
Posts: 9604
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: [BfW 1.13] Removing all advancements & experience

Postby gfgtdf » August 12th, 2017, 3:45 pm

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.
gfgtdf
Developer
 
Posts: 900
Joined: February 10th, 2013, 2:25 pm

Re: [BfW 1.13] Removing all advancements & experience

Postby doofus-01 » August 12th, 2017, 5:04 pm

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
User avatar
doofus-01
Art Contributor
 
Posts: 3540
Joined: January 6th, 2008, 9:27 pm
Location: USA ...

Re: [BfW 1.13] Removing all advancements & experience

Postby gfgtdf » August 12th, 2017, 7:59 pm

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.
gfgtdf
Developer
 
Posts: 900
Joined: February 10th, 2013, 2:25 pm

Re: [BfW 1.13] Removing all advancements & experience

Postby doofus-01 » August 20th, 2017, 1:15 pm

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
User avatar
doofus-01
Art Contributor
 
Posts: 3540
Joined: January 6th, 2008, 9:27 pm
Location: USA ...

Re: [BfW 1.13] Removing all advancements & experience

Postby enclave » October 6th, 2017, 1:45 am

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: 532
Joined: December 15th, 2007, 8:52 am


Return to WML Workshop

Who is online

Users browsing this forum: Yandex [Bot] and 2 guests