Multiplayer Campaigns HOWTO
Moderator: Forum Moderators
I just added a page on multiplayer campaigns to the wiki, using the information from here, along with stuff I gleaned from Elf War and An Unnatural Winter. If anyone wants to proofread it, it could probably use some fine tuning.
Excellent! I'll promise to read and edit it from time to time.
We could also add a section for WML that's useful for MP Campaign purposes, such as: difficulty settings, campaign-specific factions/leaders, victory conditions etc.
Also it should probably link to MP campaign content - but how? I'll have to get more familiar with the wiki structure for campaigns to get an idea.
We could also add a section for WML that's useful for MP Campaign purposes, such as: difficulty settings, campaign-specific factions/leaders, victory conditions etc.
Also it should probably link to MP campaign content - but how? I'll have to get more familiar with the wiki structure for campaigns to get an idea.
Try some Multiplayer Scenarios / Campaigns
I put in a replace-the-leader macro, and everything else (except for difficulty) is pretty self-explanatory.Rhuvaen wrote:We could also add a section for WML that's useful for MP Campaign purposes, such as: difficulty settings, campaign-specific factions/leaders, victory conditions etc.
As far as difficulty settings go, I haven't found a solution that I like. I don't think [if] goes in a [side] tag (it didn't work in [message]), so I'd have to move everything to prestart for all scenarios. And then the number of [if]/[then]/[else] I'd have to use would be ridiculous. I tried tinkering with macros, but they're really not suited to that kind of thing (does that ENDIF need a [/then] or a [/else], etc). I suppose I could ignore [else], and just use 3 separate [if]s.
It just occurred to me that I might use seperate include files to make life easier. I could put something like this in my scenario:
Code: Select all
{@campaigns/My_Campaign/scenarios/scen2.$difficulty}
Code: Select all
#Something with gold[0]
{VARIABLE gold[1] 150}
{VARIABLE gold[2] 200}
...
[side]
type=Draug
recruit=Deathblade,Revenant,Bone Shooter
...
[/side]
Mind if I expand it a bit? For instance, in Unnatural Winter I have a macro that replaces the leader type if it doesn't match the race and alignment (so the human players can choose any non-chaotic human leaders). It also keeps the player's names (which I think is fun in MP).NeoPhile wrote:I put in a replace-the-leader macro, and everything else (except for difficulty) is pretty self-explanatory.
Also I could see some typical difficulty settings (like setting an XP modifier for all units, or changing terrain in some places), and the side adjustment stuff. I'm not sure if everything is self-explanatory

Also, we need to have a whole section on ideas on what MP Campaigns are... they sort of breach the scope of single-player (cooperative, competitive, tournament-style, rpg?).
I wanted to have three separate but cummulative ifs for four difficulty levels (pseudocode):NeoPhile wrote:As far as difficulty settings go, I haven't found a solution that I like. I don't think [if] goes in a [side] tag (it didn't work in [message]), so I'd have to move everything to prestart for all scenarios. And then the number of [if]/[then]/[else] I'd have to use would be ridiculous. I tried tinkering with macros, but they're really not suited to that kind of thing (does that ENDIF need a [/then] or a [/else], etc). I suppose I could ignore [else], and just use 3 separate [if]s.
Code: Select all
if diff > easy then ... (change some things)
if diff > normal then ... (change some more)
if diff > challenging then ... (the ultimate change)
You couldn't use it like that, instead you would adjust the next_scenario in the preceding one:NeoPhile wrote:It just occurred to me that I might use seperate include files to make life easier. I could put something like this in my scenario:
Code: Select all
{@campaigns/My_Campaign/scenarios/scen2.$difficulty}
Code: Select all
[endlevel]
result=victory
next_scenario=scen2_$difficulty
[/endlevel]

Try some Multiplayer Scenarios / Campaigns
Knock yourself out! It's a wiki, it'd be stupid for me to claim ownership or control over it. I like the changes you made already, BTW.Rhuvaen wrote:Mind if I expand it a bit? For instance, in Unnatural Winter I have a macro that replaces the leader type if it doesn't match the race and alignment (so the human players can choose any non-chaotic human leaders). It also keeps the player's names (which I think is fun in MP).
My initial thought was to keep things basic. If anyone wanted to do something fancy, like conditional leader replacement, or difficulty levels, they could browse the WML pages to figure it out, or ask on the forum. That's how scenario/campaign/multiplayer seems to be set up, and it makes sense to me.
Yeah, I figured as much. If diff = easy makes more sense than if diff > easy to me. Your if's are guaranteed to not interfere with each other that way, even without elseif's.Rhuvaen wrote:I wanted to have three separate but cummulative ifs for four difficulty levels (pseudocode):I think that'd be neat enough really. It just somehow didn't work out like that (because I was changing units the ifs ended up being mutually exclusive)Code: Select all
if diff > easy then ... (change some things) if diff > normal then ... (change some more) if diff > challenging then ... (the ultimate change)
That's disappointing. Most of the WML will not change between difficulties, so you have to worry about keeping multiple files in sync with that route. Unless scen2_$difficulty actually worked something like this:Rhuvaen wrote:You couldn't use it like that, instead you would adjust the next_scenario in the preceding one:Code: Select all
[endlevel] result=victory next_scenario=scen2_$difficulty [/endlevel]
Code: Select all
{@campaigns/My_Campaign/scenarios/scen2_header}
[event]
name=prestart
{@campaigns/My_Campaign/scenarios/scen2_prestart}
(possible setup here)
[/event]
{@campaigns/My_Campaign/scenarios/scen2_events}
[side]...[/side]
[side]...[/side]
...
{@campaigns/My_Campaign/scenarios/scen2_footer}
Code: Select all
[endlevel]
result=victory
next_scenario=scen2_$difficulty
[/endlevel]
Code: Select all
{VARIABLE_OP scen_2 format scen2_$difficulty}
[endlevel]
result=victory
next_scenario=$scen_2
[/endlevel]
First read, then think. Read again, think again. And then post!
Not really, no. MP campaigns are a new feature, so there hasn't been much time to make them. That said, you could try my version of Elf War, which has 10 playable scenarios (which is all of them). I've made some updates since then, and I plan to throw it on the campaign server sometime. I need to playtest it once more, and try to contact the original creator first though.Sombra wrote:hi for the lazy and uncreative ones . Are there any MP finished campaigns right now?
Just for the record, the [story] tag has been proved not to work in network games - only the host will see the story parts. 

Try some Multiplayer Scenarios / Campaigns
problem with experience/gold
Hi!
I've been playing with my wife with your Elf War MP and I have a problem.
When we finish the first scenario, on the second one only the first player retains the experienced soldiers for recall and also the money from the first scenario. But the other player begins the second scenario with 100 gold and no experienced elfs at all.
Is this a bug of the campaign or it's a bug of the wesnoth itself?
thanks in advance and congratulations for the campaign and for the game to all developers or campaign makers.
Sergi
I've been playing with my wife with your Elf War MP and I have a problem.
When we finish the first scenario, on the second one only the first player retains the experienced soldiers for recall and also the money from the first scenario. But the other player begins the second scenario with 100 gold and no experienced elfs at all.
Is this a bug of the campaign or it's a bug of the wesnoth itself?
thanks in advance and congratulations for the campaign and for the game to all developers or campaign makers.
Sergi
Re: problem with experience/gold
Hi, this is the MP Campaigns HOWTO thread. Your post would fit better in the Elf War Conversion thread.sergi34 wrote:I've been playing with my wife with your Elf War MP and I have a problem.
I don't know if neophile is still around, if not I might have a look at Elf War and see if I can fix this. Where did you download Elf War from (forum/campaign server...)?
Thanks for reporting this.

Try some Multiplayer Scenarios / Campaigns
I post this message on reply to this on the other forum:
http://www.wesnoth.org/forum/posting.ph ... ly&t=11349
I've managed to fix the problem with the second player on the second scenario that he cannot recall units. The problem was with the save_id that was not the same.
But the problem with the gold is not solved. I've been surfing with source code and trying to recompile again with some changes and I've seen the problem.
it's on the file playsingle_controller.cpp
on the function play_scenario, the code:
for(std::vector<team>::iterator i=teams_.begin(); i!=teams_.end(); ++i) {
if (!i->is_persistent())
continue;
//stuff for carry gold to next scenario
........
}
I've seen that it considers the second player as not being persistent, so the gold and bonus gold is not carried to the next scenario.
But I haven't managed to know why does this happen.
I downloaded the multiplayer campagin EW_multi from this same forum as a zip file EW.zip
thanks!
Sergi
http://www.wesnoth.org/forum/posting.ph ... ly&t=11349
I've managed to fix the problem with the second player on the second scenario that he cannot recall units. The problem was with the save_id that was not the same.
But the problem with the gold is not solved. I've been surfing with source code and trying to recompile again with some changes and I've seen the problem.
it's on the file playsingle_controller.cpp
on the function play_scenario, the code:
for(std::vector<team>::iterator i=teams_.begin(); i!=teams_.end(); ++i) {
if (!i->is_persistent())
continue;
//stuff for carry gold to next scenario
........
}
I've seen that it considers the second player as not being persistent, so the gold and bonus gold is not carried to the next scenario.
But I haven't managed to know why does this happen.
I downloaded the multiplayer campagin EW_multi from this same forum as a zip file EW.zip
thanks!
Sergi
I'm not sure, but it sounds like this could be solved by just putting persistent=1 (or whatever it was) into the other players' side definitions in MP campaigns. I don't think we should have sides other than side 1 be persistent by default.sergi34 wrote:But the problem with the gold is not solved. I've been surfing with source code and trying to recompile again with some changes and I've seen the problem.
it's on the file playsingle_controller.cpp
on the function play_scenario, the code:
for(std::vector<team>::iterator i=teams_.begin(); i!=teams_.end(); ++i) {
if (!i->is_persistent())
continue;
//stuff for carry gold to next scenario
........
}
I've seen that it considers the second player as not being persistent, so the gold and bonus gold is not carried to the next scenario.
But I haven't managed to know why does this happen.