Custom Campaign 2.2.0 for Wesnoth 1.17/1.18

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

Post Reply
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 1.1.0 for Wesnoth 1.11

Post by SigurdFireDragon »

Version 1.1.0 is now up. :)

New in version 1.1.0 for Wesnoth 1.11/1.12
Custom Campaign is now an mp modification, with two flavors, Singleplayer & Multiplayer

Singleplayer Description:
For one player. This modification allows you to play any mp map and era with a persistent army that is saved after each victory.
Create an army in the '1p - Custom Campaign' scenario. When this mod is active, the player's side is replaced with a custom army or faction,
computer sides are untouched, and any side set to empty can be replaced with a custom faction for the computer to play.

Intelligent objectives handling: If a scenario has custom objectives, Custom Campaign will not overwrite them with its own, to improve compatibility with Survival Scenarios, such as Dark Forcast. (Note that defeat on death of leaders or heroes will still be applicable.)

Singleplayer Options:
Use Faction: Instead of an army for player side, chose a faction. (Not saved on victory)
(This is just a relocation of a previous menu option)
Survival Scenario: On a regular map with a turn limit, this makes a victory condition of surviving until the end of turns.
Enemy Waves: If selected, enemy sides get the starting gold amount added every 'Wave Frequency' turns.
Wave Frequency: How often enemy sides get the starting gold amount added, if 'Enemy Waves' is selected.

Multiplayer Description:
Multiplayer version. This modification allows you to play any mp map and era with a persistent army that is saved after each victory.
Create an army in the '1p - Custom Campaign' scenario. When this mod is active, each player's side is replaced with a custom army from their own list.
Computer sides must have 'Don't choose an army' selected by the game host. Also, each player must have at least one army to choose from. In addition, a player's army is only saved on victory if the Commander is still present.
Note that Leader & Hero death does not cause defeat in mp version

It should work for any combination of players/ai/teams
I’m assuming co-op would be the most common use, though one can do pvp as well.

Army Setup Map ‘1p – Custom Campaign’:
Added new commands of Copy & Transfer Unit under Edit Recall List
Created Heroes are now automatically given the loyal trait.
Code prevents giving Leaders the loyal trait.

Text & Underlying Code Changes To Match Current Conventions:
The most significant one is the persistent data file from version 1.0.0 is not compatible with 1.1.0. If anyone wants to import their persistent cfg, the following can be done to convert it:
Do a “find & replace” for:
‘Main Leader’ to ‘Commander’
‘troop_list’ to ‘recall_list’
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 1.1.1 for Wesnoth 1.11/12

Post by SigurdFireDragon »

Version 1.1.1 is now up. :) It requires Wesnoth 1.11.10 or greater.

Change log summary:
You can now select a flag for your army.
Commander is now counted as one of the units in the army's unit count.
New lua based menu for selecting army when playing a game.
RC/CC compatibility tweaks.

Full change log:
Spoiler:
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
cahavathra
Posts: 6
Joined: July 10th, 2014, 3:52 pm

Re: Custom Campaign 1.1.1 for Wesnoth 1.11/12

Post by cahavathra »

Found a bug/problem with Custom Campaign. Setting a side to empty does not allow me to choose a custom faction for the computer, contrary to what it says in the description.
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 1.1.1 for Wesnoth 1.11/12

Post by SigurdFireDragon »

Thanks for reporting the bug.

I verified the bug on BfW 1.11.15 & CC 1.1.1

It's occurred due to the changes that made prestart event synced in BfW 1.11.13. This change killed [message]/[option] in that event, which the faction select menu uses. The proper fix requires me to rewrite that menu to be lua show dialog based. It should be easy enough, as I can copy from the army select menu. Hopefully, I should have a updated version posted in a few days.
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 1.2.0 for Wesnoth 1.11/12

Post by SigurdFireDragon »

Version 1.2.0 is up for BfW 1.11/12 :)

Changes/Bug fixes
Fix bug preventing selecting of custom factions for player or computer sides in 1p version of mod.
In fixing the bug, changed how a custom faction is assigned to a computer side. Instead of selecting 'Empty' for the side, any sides set to 'Local Player' will be replaced by a chosen custom faction and set to computer controlled. 'Computer Player' and 'Empty' sides are left untouched.

The 1p modification description has been updated appropriately.

To accommodate the above, the 1p mod requirement of 'only one human side' is changed to 'only one named human side' (i.e., anything set to 'Local Player' is an unnamed human side). Also code has been added to make sure the one player version of the mod will only run on a local game.

If you are defeated in a scenario that has fog or shroud, the map will not be revealed, to match how a single player campaign handles the situation.
Version:/Author: in description to better match convention.
Hide null sides from status table in "1p - Custom Campaign" scenario.

Commit Log:
Spoiler:
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
Spirit_of_Currents
Posts: 160
Joined: April 26th, 2014, 4:44 pm

Re: Custom Campaign 1.2.0 for Wesnoth 1.11/12

Post by Spirit_of_Currents »

I can't see it possible to have custom, computer-controlled factions to play against with another person.
There are very much electrical currents in my brain.
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 1.2.0 for Wesnoth 1.11/12

Post by SigurdFireDragon »

Spirit_of_Currents wrote:I can't see it possible to have custom, computer-controlled factions to play against with another person.
It is possible, I added that feature in Custom Campaign 1.1.0 for Wesnoth 1.11/1.12.

Are you using an earlier version of Custom Campaign and/or Wesnoth?


EDIT: My apologies, it is not possible to have a custom, computer-controlled faction to play against multiple human players, it's only available in the single player implementation of Custom Campaign. The multiplayer version only allows a faction from any era as the computer opponent(s).

I may add it eventually, but I have no plans to do so at the current time.
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
User avatar
GoblinCorpse
Posts: 3
Joined: April 25th, 2015, 10:39 pm

Re: Custom Campaign 1.2.0 for Wesnoth 1.11/12

Post by GoblinCorpse »

I'm having trouble creating a leader or custom walking corpse/soulless. The walking corpse unit from Era of MAgic (at least I think it's from that because it contains WC variations for all its units) works fine, but if I try to use a vanilla WC as a leader it gives this error.

<Lua error> attempt to compare two userdata values
stack traceback:
[c]: in function 'sort'
...ames\Wesnoth1.12\data\add-ons/Custom_Campaign/lua/cc.lua:2829: in function 'get_variation_choice'
...ames\Wesnoth1.12\data\add-ons/Custom_Campaign/lua/cc.lua:2894: in function 'customize_unit'
...ames\Wesnoth1.12\dataadd-ons/Custom_Campaign/lua/cc.lua:1683: in function 'edit_leader_end'
[string "cc.edit_leader_end('custom_army', 0)"]:1 in function 'bytecode'
...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:277: in function 'cmd'
...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:320: in function <...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:284>


Attempting to create a customized recall unit creates a similar error:

<Lua error> attempt to compare two userdata values
stack traceback:
[c]: in function 'sort'
...ames\Wesnoth1.12\data\add-ons/Custom_Campaign/lua/cc.lua:2829: in function 'get_variation_choice'
...ames\Wesnoth1.12\data\add-ons/Custom_Campaign/lua/cc.lua:2894: in function 'customize_unit'
...ames\Wesnoth1.12\dataadd-ons/Custom_Campaign/lua/cc.lua:2912: in function 'add_unit_to_recall_list'
[string "cc.add_unit_to_recall_list()"]:1 in function 'bytecode'
...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:277: in function 'cmd'
...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:320: in function <...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:284>


As a side note, when I use the single player version to play against an ai controlling a custom army, if I leave a local player in the game it gives the same message you would usually get if you had no armies at all saved. The workaround I've been using is to use the multiplayer version then droid the other side(s) after selecting their army for them. Oh and there seems to be an issue with your army not being saved at the end of a battle if your recall is set to recall more units than the army currently has available for recall at the start of the battle.
a765431
Posts: 2
Joined: June 13th, 2012, 12:09 pm

Re: Custom Campaign 1.2.0 for Wesnoth 1.11/12

Post by a765431 »

I open the army list. then Wesnoth gives this error.

Code: Select all

error scripting/lua: ... 1.12.2\userdata\data\add-ons/Custom_Campaign/lua/cc.lua:512: attempt to index local 'u' (a nil value)
stack traceback:
	... 1.12.2\userdata\data\add-ons/Custom_Campaign/lua/cc.lua:512: in function 'army_display_list'
	... 1.12.2\userdata\data\add-ons/Custom_Campaign/lua/cc.lua:1308: in function <... 1.12.2\userdata\data\add-ons/Custom_Campaign/lua/cc.lua:1305>
	(...tail calls...)
	[string " cc.main_menu() "]:1: in function 'bytecode'
	...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:277: in function 'cmd'
	...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:320: in function <...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:284>
someone help?
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 1.2.0 for Wesnoth 1.11/12

Post by SigurdFireDragon »

Thanks for the bug reports GoblinCorpse & a765431. I will look into them and hopefully have fixes for them within the next week or two.
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 1.2.1 for Wesnoth 1.12

Post by SigurdFireDragon »

Version 1.2.1 is up.

Fixes for bugs reported by GoblinCorpse
Fixed bug preventing customized / leader walking corpse/soulless on recall list.
Fixed bug where army not saved if starting recall > number of units currently on recall list.
GoblinCorpse wrote: As a side note, when I use the single player version to play against an ai controlling a custom army, if I leave a local player in the game it gives the same message you would usually get if you had no armies at all saved. The workaround I've been using is to use the multiplayer version then droid the other side(s) after selecting their army for them.
It sounds like you're trying to use a custom army (which has a recall list) and not a custom faction (does not have a recall list) for the AI to play against a Human. If that's the case, the message for no factions is slightly different than the message for no armies. Also, my add-on was only intended to let a custom faction, or a faction selected directly from an era be used as a computer opponent. As such, I may add the ability for a computer to play an army in the future. But there's no plans at the moment.

If you're trying to do something else, can you explain it differently?

a765431 wrote:I open the army list. then Wesnoth gives this error.

Code: Select all

error scripting/lua: ... 1.12.2\userdata\data\add-ons/Custom_Campaign/lua/cc.lua:512: attempt to index local 'u' (a nil value)
stack traceback:
	... 1.12.2\userdata\data\add-ons/Custom_Campaign/lua/cc.lua:512: in function 'army_display_list'
	... 1.12.2\userdata\data\add-ons/Custom_Campaign/lua/cc.lua:1308: in function <... 1.12.2\userdata\data\add-ons/Custom_Campaign/lua/cc.lua:1305>
	(...tail calls...)
	[string " cc.main_menu() "]:1: in function 'bytecode'
	...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:277: in function 'cmd'
	...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:320: in function <...es (x86)/Battle for Wesnoth 1.12.2\data\lua/wml-tags.lua:284>
someone help?
I'm gonna need more info to be able to help you out.
Have you already created armies?
If so, do any of the armies use units from an add-on?
If so, can you provide the name of the add-on, and if it has updated/changed?
Once again, if so, can you provide as many details as possible?

My guess at this point is that my code to account for add-on changes has missed something, but I'll need more details to be sure.
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
a765431
Posts: 2
Joined: June 13th, 2012, 12:09 pm

Re: Custom Campaign 1.2.1 for Wesnoth 1.12

Post by a765431 »

Have you already created armies?
in 1.10.7.
do any of the armies use units from an add-on?
Era of Myths.
i think is too old with 1.12...
maybe... [sniff] maybe...
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 1.1.0 for Wesnoth 1.11

Post by SigurdFireDragon »

It sounds like you are trying to use your persistent data file from Custom Campaign in BfW 1.10 series in 1.12. If that's the case, you'll need to convert the data file to work with CC in BfW 1.12.

The file can be found at userdata/persist/SigurdFireDragon_Custom_Campaign.cfg
Below are the conversion instructions
SigurdFireDragon wrote:Version 1.1.0 is now up. :)
...
Text & Underlying Code Changes To Match Current Conventions:
The most significant one is the persistent data file from version 1.0.0 is not compatible with 1.1.0. If anyone wants to import their persistent cfg, the following can be done to convert it:
Do a “find & replace” for:
‘Main Leader’ to ‘Commander’
‘troop_list’ to ‘recall_list’
If the above is what was needed, your army with Era of Myths units should still work, as I think they haven't had any changes from their 1.10 to 1.12 versions that would get past my compatibility code.
Co-Author of Winds of Fate
My Add-ons: Random Campaign, Custom Campaign, Ultimate Random Maps, Era of Legends, Gui Debug Tools
Erfworld: The comic that lead me to find Wesnoth.
Fairfir
Posts: 1
Joined: May 5th, 2015, 11:04 pm

Re: Custom Campaign 1.2.1 for Wesnoth 1.12

Post by Fairfir »

Does anyone play the MP version of this mod? I'm looking for an opponent who has an army. My army is currently composed with Ageless Era and War of Legends units. It's primarily a Loyalists like faction. Anyone game?
LordVandor
Posts: 13
Joined: August 13th, 2015, 12:00 am

Re: Custom Campaign 1.2.1 for Wesnoth 1.12

Post by LordVandor »

Hi :) This mod is awesome. I'm using it pretty much for everything I do,rpg maps,survival maps,etc...
I also made a lot of factions,like Bandits,Chaos, etc. , and I love it!
But there's something missing...
I can pretty much modify any unit,right?
But that's only for the traits,the name,and the role...
What about making the money system you see in the campaigns, to have money you spend in a shop in the 1p Custom Campaign scenario?
This way I could buy new weapons,or improve the ones I already have...I could make something like Fire Emblem or even better!
What do you think about it? I'd like it so much!
Post Reply