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

Custom Campaign 2.2.0 for Wesnoth 1.17/1.18

Post by SigurdFireDragon »

Custom Campaign - Version 2.2.0 for Wesnoth 1.17.26 & up / 1.18
Custom Campaign - Version 2.1.0 for Wesnoth 1.16
Custom Campaign - Version 2.0.8 for Wesnoth 1.14
Custom Campaign - Version 1.2.1 for Wesnoth 1.12
Custom Campaign - Version 1.0.0 for Wesnoth 1.10.

This post contains a description of version 1.2.1 of the add-on for the stable branch of wesnoth (1.12).
For the latest development info and updates, read the most recent posts to this thread.


Add-On Server Description
Play any MP map with a persistent Army of your design. Configure each battle as you normally would in MP game creation. When you win, your Army is saved, and can be used in future battles.

To start, load the Custom Campaign Map, with an Era that you would like to import factions from. You can also create custom armies and factions using units from mainline or any add-on era.


This add-on works in MP through a scenario(map), a modification, and the magic of persistenceWML.
There are two flavors of the modification, Singleplayer (Custom Campaign) & Multiplayer (Custom Campaign MP)

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 Player' and 'Empty' sides are untouched, and any side set to 'Local Player' will be replaced with a custom faction for the computer to play.

Singleplayer Options:
Use Faction: Instead of an army for player side, chose a faction. (Not saved on victory)
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 Player' and 'Empty' sides are untouched. 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.

Features:
- Use any units to make your army, even ones from add-ons.
- Create custom factions to play against or import factions from any other era.
- Can be used with any regular mp maps, including any you create in the map editor and any maps you download. For random maps covering a wide variety of terrains, use Custom Campaign with Ultimate Random Maps.
- Powerful army editing commands let you roleplay many aspects of a typical campaign, such as having a hero, loyal units, gaining or losing the ability to recruit certain units, etc.
- Full multi-leader support. You can have any number of Leaders or Expendable Leaders. Each leader can have their own extra recruit list, as well as filter recall that can limit what troops they can recall.
- 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.)

Instructions:
If you would like to use a faction from an era to make your army from:
Select the era containing the faction(s) you want, select the Custom Campaign Scenario, and set the sides to the factions you would like to import from the selected era.
Once the Custom Campaign Scenario is started you can use any imported side to make entries for the Army or Faction lists, or you can make custom entries.
Once you have an army to play, create an mp game using one of the Custom Campaign Eras, and any map of your choice. Set a side to ‘Custom’ for the faction to allow selecting an army or faction for that side when the map is launched.

Note: 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:
Open the file and
Do a “find & replace” for:
‘Main Leader’ to ‘Commander’
&
‘troop_list’ to ‘recall_list’

Version 1.0.0 description for Wesnoth 1.10:
Spoiler:
Old First Post:
Spoiler:
Last edited by SigurdFireDragon on February 23rd, 2024, 3:22 pm, edited 25 times in total.
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
Lord-Knightmare
Discord Moderator
Posts: 2337
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: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by Lord-Knightmare »

This add-on sounds good, but as like all MP campaigns it will have the usual recall list problem. The players are gonna get the same recall in most scenarios. The experience or advancements in later scenarios seem to have vanished.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by SigurdFireDragon »

Lord-Knightmare wrote:This add-on sounds good, but as like all MP campaigns it will have the usual recall list problem. The players are gonna get the same recall in most scenarios. The experience or advancements in later scenarios seem to have vanished.
There are no recall problems in my add-on. It's only for one player at the moment.
I think my biggest problem might be in explaining it clearly.

It doesn't work like a typical campaign. (sp or mp)

Another way of explaining:

This is exactly like playing a one player vs X number of ai sides in MP with the following exceptions:

You choose the 'Custom Campaign' Era to launch any map with. At the start of the map, (after the faction selection menu) you pick from the Armies and Factions stored in userdata/persist/Sigurd_The_Dragon_Custom_Campaign.cfg

To get Armies and Factions in that file, launch the 'Custom Campaign' Map with any Era to import factions from the selected era or create your own factions.

Whenever you finish a map with your Army, it is stored into the persistent file, with all the updates and advancements that have occured. You can then use it on another map of your choice.

Hopefully, that's a better explaination.
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.
Glory_to_the_Highest
Posts: 10
Joined: June 1st, 2011, 1:32 am

Re: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by Glory_to_the_Highest »

I tried custom campaign with custom faction, and when I went to do "store side as faction" I got a lua error message. This happened twice so far. I tried to take a screen shot but for some reason it didn't work.
Glory_to_the_Highest
Posts: 10
Joined: June 1st, 2011, 1:32 am

Re: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by Glory_to_the_Highest »

Using the custom campaign map I was able to save custom armies, then play them with a random map and the custom campaign era, with the option to keep the same army each time. That basically gives me everything that I was asking for. Thanks so much!
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by SigurdFireDragon »

Lord-Knightmare wrote:This add-on sounds good, but as like all MP campaigns it will have the usual recall list problem. The players are gonna get the same recall in most scenarios. The experience or advancements in later scenarios seem to have vanished.
Interestingly, I did find a recall problem, not sure if it's the one you described. Anyway, below is a description of what occured, and my solution. (Which will be in the next version)
Spoiler:
Glory_to_the_Highest wrote:I tried custom campaign with custom faction, and when I went to do "store side as faction" I got a lua error message. This happened twice so far. I tried to take a screen shot but for some reason it didn't work.
Assuming you mean my add-on 'Custom Faction', it's not intended to work with Custom Campaign (Custom Campaign has a 'Create Faction' command which does almost all of what 'Custom Faction' does) The next version of Custom Campaign (0.8.0) will be able to do everything that Custom Faction does, more, and in a better way; so I'll be deleting Custom Faction then.

Also, I'll have a coulpe of improvements to the 'Create Faction' option in Custom Campaign that will make it eaiser to use, such as filters for the list of units to chose from. (i.e., Alignment, Level, Move, Race, Set (Core or Add-on))
Glory_to_the_Highest wrote:Using the custom campaign map I was able to save custom armies, then play them with a random map and the custom campaign era, with the option to keep the same army each time. That basically gives me everything that I was asking for. Thanks so much!
I'm glad you're enjoying it. :)
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.
Glory_to_the_Highest
Posts: 10
Joined: June 1st, 2011, 1:32 am

Re: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by Glory_to_the_Highest »

I'm not sure what happened, but now whenever I enter the custom campaign, I get a lua error. I tried uninstalling and reinstalling bfw without any change.

Ideas?
Attachments
Custom_Campaign-Auto-Save1.gz
(356.82 KiB) Downloaded 1020 times
Custom_Campaign_replay.gz
(179.5 KiB) Downloaded 1104 times
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by SigurdFireDragon »

Ssomehow your copy of userdata/persist/Sigurd_The_Dragon_Custom_Campaign.cfg
got some bad data in it. As to how that happened, I don't know.

This should fix it (It worked on the file you posted, but that's a save file.)
Open your copy of 'userdata/persist/Sigurd_The_Dragon_Custom_Campaign.cfg' with your favorite text editor and find the following block of four lines and delete it. (it should be after the 2 armies you have) See if that does it.

Code: Select all

[army]
	id=""
	victories=2
[/army]
Also, while I'm at it, the current version of Custom Campaign (0.7.5) will react poorly if you use units from an add-on and then delete that add-on while you still have those units being used in Custom Campaign's Army & Faction Lists. I'll look into making a guard against this.
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.
Glory_to_the_Highest
Posts: 10
Joined: June 1st, 2011, 1:32 am

Re: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by Glory_to_the_Highest »

Thanks.

It's working now but also having recall issues...after playing one map, the level ups weren't available in another one..
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by SigurdFireDragon »

That should be the recall problem I mention in the spoiler space above.

If you haven't played through another map with the army, the leveled up units should be in the persistent file, and you have 2 options to be able to recover them.
1. go through the file and make sure each unit in the army has a unique number for the underlying_id= field (1 and higher only, no 0 or -numbers)
2. wait till version 0.8.0 comes out, which, when used, should automatically fix it. (I'm gonna aim for sometime on Saturday, Sunday at the latest.)
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.
Glory_to_the_Highest
Posts: 10
Joined: June 1st, 2011, 1:32 am

Re: Custom Campaign 0.7.5 - Play mp maps with a Persistent A

Post by Glory_to_the_Highest »

I'm not playing friday/sat so waiting for 0.8.0 is a cinch.

Thank you so much for all the work that you're putting into this! It's awesome to me that you've translated a wish of mine into reality.

Be blessed!

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

Re: Custom Campaign 0.8.0 - Play mp maps with a Persistent A

Post by SigurdFireDragon »

Version 0.8.0 is now out for 1.9.7 BfW

Bugfixes:
The identical underyling_id= causing some units not to show on the recall list is fixed.
Also hiding of Armies & Factions that are missing files (if you used units from an add-on and then deleted the add-on). To prevent a crash when trying to view the list if files were missing.

Improvements:
New Commands: Rename Army, Rename Faction, Copy Army, Create Army from Side

The 'Custom Camaign Era' widget now comes in two flavors, '+ Default' and '+ AoH'; giving an easy way to play your chosen Army against factions from those eras.

The 'Create Faction' command renamed to 'Create Custom Faction' and given a complete overhaul from previous version. Now using a Pick Your Recruits style of selection (props to Zookeeper and Horus2 :) ). You 'recruit' your leader and recruits from the recruit list, with the twist that the chosen recruits are displayed in the recall list while you are still selecting. Unit Filters configurable by Alignment, Level, Move, Race, & Unit Set (Core & Add-on) help make picking from all avaiable unit_types managable. Selecting a recruitment_pattern for the faction has been adjusted to only present options contained in the recruits you selected.

Last Victory time is now recorded.

Planned for the future:
Race filter to show by language_name and id when 1.9.8 is out.
Improvements to selecting recruitment_pattern.
Other things as I find them.

Questions and comments welcome, espeically regarding bugs and the understandability/ease of use for the interface.
Glory_to_the_Highest wrote:Thank you so much for all the work that you're putting into this! It's awesome to me that you've translated a wish of mine into reality.
You're welcome. ^_^ It's been enjoyable working on it. ^_^
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
Lord-Knightmare
Discord Moderator
Posts: 2337
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: Custom Campaign 0.8.0 - Play mp maps with a Persistent A

Post by Lord-Knightmare »

Okay, in v0.8.0 , I'm able to create an army.
But, when I am victorious, the game shows a lua error and my recall list is not saved at all.
Which version of Wesnoth does this require?
I'm using 1.9.4
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
SigurdFireDragon
Developer
Posts: 545
Joined: January 12th, 2011, 2:18 am
Location: Pennsylvania, USA

Re: Custom Campaign 0.8.0 - Play mp maps with a Persistent A

Post by SigurdFireDragon »

It requires 1.9.7, due to at least the newly enabled lua function os.date() for recording time of victory.


Edit - that reminded me, there's something I can do with #ifver to make that more apparent. I'll put that in the next version.
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 0.8.0 - Play mp maps with a Persistent A

Post by SigurdFireDragon »

Version 0.8.2 is now on the 1.9 Add-on server. For BfW 1.9.7 and greater

Updates:
Locked down the Recruit & Recall 'OK' button, so they are non-functional when viewing an Army or Faction.
Castle hexes for the entire Custom Campaign Map, for easier right-clicking.

Some changes to Custom Faction Creation:
Recalling a unit off of the recall list no longer removes a chosen recruit. Can only delete chosen recruits with 'Dismiss Unit'
When picking recruits, the Name field for the recall list displays the usage for recruitment_pattern.
Improvements to selecting a recruitment_pattern.

Some minor Help text changes to go with the above.


Edit - 0.8.2c is current version, corrected a minor bug/change for those who managed to grab earlier versions of 0.8.2
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.
Post Reply