XP Bank (MP/SP modification for 1.12-1.18)

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

User avatar
ForestDragon
Posts: 1766
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

XP Bank (MP/SP modification for 1.12-1.18)

Post by ForestDragon »

hi, so, i made this mod a while ago, but it didn't work. Now it does, and i released it as an addon, here is the description.

Need to urgently level up a unit? some high level unit of yours stole the otherwise useful XP? have a lot of units with small amount of exp? a unit with a lot XP is about to die? well, you came to the right place! this mod provides players a rightclick option to store any units' EXP, and then transfer it to any other one through a somewhat bank-like system, negating all the problems listed above.

feel free to post suggestions, and bug reports

EDIT: there is also a signleplayer version of the mod now, it's in the addon group called 'Other'
Last edited by ForestDragon on February 27th, 2024, 2:34 pm, edited 3 times in total.
User avatar
Vyncyn
Forum Regular
Posts: 514
Joined: April 6th, 2013, 5:51 pm

Re: XP Bank (MP modification for 1.12)

Post by Vyncyn »

Pretty cool. It changes the game a lot and creates the need for new strategies. What would be nice is a button to drain all exp from every unit quickly instead of having to deposit from each unit individually.
User avatar
ForestDragon
Posts: 1766
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: XP Bank (MP modification for 1.12)

Post by ForestDragon »

Vyncyn wrote:Pretty cool. It changes the game a lot and creates the need for new strategies. What would be nice is a button to drain all exp from every unit quickly instead of having to deposit from each unit individually.
it would be, but i just don't know how to code that in.
User avatar
The_Gnat
Posts: 2215
Joined: October 10th, 2016, 3:06 am
Contact:

Re: XP Bank (MP modification for 1.12)

Post by The_Gnat »

Hi Forest Dragon, you probably could 'deposite all' by creating a fourth option and storing all units of the side and then:

Code: Select all

[sound]
      name=magic-faeriefire-miss.ogg
[/sound]

{FOREACH stored_unit i}
      
       [set_variable]
            name=exp_stored_[$side_number]
            add=$stored_unit[$i].experience
       [/set_variable]     
 
       [modify_unit]
             [filter]
                  id=$stored_unit[$i].id
             [/filter]
             experience=0
       [/modify_unit]

      #OR

      {VARIABLE_OP $stored_unit[$i].experience value 0}

      [unstore_unit]
             id=$stored_unit[$i].id
      [/unstore_unit]
{NEXT i}
I haven't tested this code but it should work (unless i made a silly syntax error ;) )

(also nice mod, i like things like this which change the dynamic of wesnoth)
User avatar
Vyncyn
Forum Regular
Posts: 514
Joined: April 6th, 2013, 5:51 pm

Re: XP Bank (MP modification for 1.12)

Post by Vyncyn »

Damn, I wish I had seen Gnats code sooner; would have saved me some time. I made this code

Code: Select all

						[option]
					message=  {MENU_IMG_TXT "items/holy-water.png~BLIT(halo/elven/shaman-heal-halo-4.png)" "Deposit All"}
					[command]
						[store_unit]
							[filter]
								side=$side_number
							[/filter]
							variable=exp_drained_unit
						[/store_unit]
						{FOREACH exp_drained_unit i}
						[set_variable]
							 name=exp_stored_[$side_number]
							 add="$exp_drained_unit[$i].experience"
						[/set_variable]
						{VARIABLE exp_drained_unit[$i].experience 0}
						[unstore_unit]
							variable=exp_drained_unit[$i]
							find_vacant=no
						[/unstore_unit]
						{NEXT i}
						{CLEAR_VARIABLE exp_drained_unit}
					[/command]
				[/option]
I already tested it and it seems to work. just add it as a fourth option.
User avatar
ForestDragon
Posts: 1766
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: XP Bank (MP modification for 1.12)

Post by ForestDragon »

thanks, guys! i uplodead the version 1.1.0 with this new option
User avatar
Eagle_11
Posts: 759
Joined: November 20th, 2013, 12:20 pm

Re: XP Bank (MP modification for 1.12)

Post by Eagle_11 »

Hmm, suppose could be used to let strong fighters feed frail mages all their exp prior to dying.
User avatar
ForestDragon
Posts: 1766
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: XP Bank (MP modification for 1.12)

Post by ForestDragon »

hi guys! so, today i decided to release an update for this mod (the version is 1.1.1), here is the changelog:
1.i gave the xp bank menu a portrait (it's the tomb guardian from DM. since it borrows the image from a default campaign, it is still 'user-without-the-addon'-friendly). 2.'Deposit All' option now uses a repeated version of the sound used by the 'Deposit from this unit' menu. (aka the faerie fire sound) just a small decorative tweak
3.the ''invalid WML' message shouldn't show up now.

basically a patch/decorative type of update
User avatar
ForestDragon
Posts: 1766
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: XP Bank (MP modification for 1.12)

Post by ForestDragon »

hi, i know that it might seem weird to release 2 updates in 1 day, but here we go, 1.2.0 is out! this time i added an option to send stored xp to allies (via a right-click option on the ally leader) this will hopefully make the mod more teamwork-friendly
User avatar
The_Gnat
Posts: 2215
Joined: October 10th, 2016, 3:06 am
Contact:

Re: XP Bank (MP modification for 1.12)

Post by The_Gnat »

Awesome i was going to suggest that :D
User avatar
Paulomat4
Moderator Emeritus
Posts: 730
Joined: October 16th, 2012, 3:32 pm
Location: Wesmere library, probably summoning Zhangor

Re: XP Bank (MP modification for 1.12)

Post by Paulomat4 »

Hey, I didn't try this out yet, but wqhat do you think about porting it to 1.13 and making it a single-player modification as well? I'm sure It would reach out to a lot more of people then, those who play only campaigns at least when 1.14 is released :)
Creator of Dawn of Thunder and Global Unitmarkers

"I thought Naga's used semi-automatic crossbows with incendiary thermite arrows . . . my beliefs that this race is awesome are now shattered." - Evil Earl
User avatar
ForestDragon
Posts: 1766
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: XP Bank (MP modification for 1.12)

Post by ForestDragon »

Paulomat4 wrote:Hey, I didn't try this out yet, but wqhat do you think about porting it to 1.13 and making it a single-player modification as well? I'm sure It would reach out to a lot more of people then, those who play only campaigns at least when 1.14 is released :)
about single-player: yes, i want to, but that would require large changes to the code

well, i don't have the 1.13 version of wesnoth, but if you do, could you port it for me?
User avatar
ForestDragon
Posts: 1766
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: XP Bank (MP modification for 1.12)

Post by ForestDragon »

1.2.1 update is out! small change: when sending xp to someone, only the sender and the reciever see the message. just a small new change.
User avatar
The_Gnat
Posts: 2215
Joined: October 10th, 2016, 3:06 am
Contact:

Re: XP Bank (MP modification for 1.12)

Post by The_Gnat »

Hi forest dragon i just made a quick mod for myself, this (appears) to work for singleplayer campaigns, i would suggest testing it though ;)

Basically i created a fake unit that loads events for campaigns only in the main.cfg file.

(note this doesn't have the newest update you made)
Attachments
XP_Bank.zip
(12.07 KiB) Downloaded 713 times
User avatar
ForestDragon
Posts: 1766
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: XP Bank (MP modification for 1.12)

Post by ForestDragon »

thanks! i will build on from what you made.

btw, i don't think the single-player edition will have xp sending
Post Reply