Noob questions at creating multiplayer map

The place to post your WML questions and answers.

Moderator: Forum Moderators

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.
User avatar
Slann
Posts: 66
Joined: March 2nd, 2008, 3:47 pm

Noob questions at creating multiplayer map

Post by Slann »

Hi everyone. I have some experience at developling. Recently i decided to go deep on WML, so i began to program my own multiplayer map, taking into account some maps that i played before.

As there are no tutorials, only the wml reference page, i make some mistakes and i need help for fixing my mistakes.

This is what i have at the moment.
Spoiler:
When i play this map, i get this error.

Image

Then, when i pass for side 2's turn, it gives the "lose game" message.
Anonymissimus
Inactive Developer
Posts: 2460
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Noob questions at creating multiplayer map

Post by Anonymissimus »

Based on the lua error message you got and the tag it relates to I'm guessing that comma-separated list for [objectives]side= is not allowed.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
Slann
Posts: 66
Joined: March 2nd, 2008, 3:47 pm

Re: Noob questions at creating multiplayer map

Post by Slann »

Thank you. I noticed that correct tag was "side_for" and not side. And side_for is used for [messages], not by objetives. Is there a way to show differents objetives to each team?

And still, each time i pass turn, the game finish as i lose it.
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Noob questions at creating multiplayer map

Post by monochromatic »

turns="unlimited" -> turns=-1
User avatar
Slann
Posts: 66
Joined: March 2nd, 2008, 3:47 pm

Re: Noob questions at creating multiplayer map

Post by Slann »

Doesnt work. Also tried with
turns=-1
turn_at=1

But nothing :doh: .
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Noob questions at creating multiplayer map

Post by monochromatic »

Also, side[0].canrecruit must be set to yes. That's why. Also with turns=-1.
User avatar
Slann
Posts: 66
Joined: March 2nd, 2008, 3:47 pm

Re: Noob questions at creating multiplayer map

Post by Slann »

<3 now i can continua. Thank you sir.

On a different topic, I want to set time map to night each time. But i cannot do this (I know there is a tag called [time], but even comparing to others map).
knight_ruben
Posts: 6
Joined: April 8th, 2008, 8:20 am

Re: Noob questions at creating multiplayer map

Post by knight_ruben »

Slann wrote:<3 now i can continua. Thank you sir.

On a different topic, I want to set time map to night each time. But i cannot do this (I know there is a tag called [time], but even comparing to others map).
it is explained here: http://wiki.wesnoth.org/BuildingScenariosSimple

Now my noob question

I just read alot on the code of wesnoth because Im trying to make an SX. Can anybody tell me where I could find finished code on some SX maps as examples?

thanks alot, Ruben
alluton
Posts: 420
Joined: June 26th, 2010, 6:49 pm
Location: Finland

Re: Noob questions at creating multiplayer map

Post by alluton »

shoudent you do event that:
[objectives]
side=2
[objective]
description= _ "Enter the Central Palace"
condition=win
[/objective]
[objective]
description= _ "Death of Aerius"
condition=lose
[/objective]

{TURNS_RUN_OUT}
[/objectives]

but then also this: [event]
name=last breath
[filter]
id=thief
[/filter]
[message]
speaker=unit
message= _ "i lost!"
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]


you only got objectives but add the last code i post also that game knows also that if thief dies he loses.
"This game cured me of my real life addiction."
-Flameslash
Anonymissimus
Inactive Developer
Posts: 2460
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Noob questions at creating multiplayer map

Post by Anonymissimus »

alluton wrote:you only got objectives but add the last code i post also that game knows also that if thief dies he loses.
Generally speaking, yes. One should put according code ([event]s) which implement the defeat/loss conditions shown.
However, the engine checks for whether a side has left a leader alive and if not, ends the game with loss for that side. It may not happem immediately however.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Noob questions at creating multiplayer map

Post by monochromatic »

Slann wrote:On a different topic, I want to set time map to night each time. But i cannot do this (I know there is a tag called [time], but even comparing to others map).
{DEFAULT_SCHEDULE} :arrow: {FIRST_WATCH}
User avatar
Slann
Posts: 66
Joined: March 2nd, 2008, 3:47 pm

Re: Noob questions at creating multiplayer map

Post by Slann »

monochromatic wrote:
Slann wrote:On a different topic, I want to set time map to night each time. But i cannot do this (I know there is a tag called [time], but even comparing to others map).
{DEFAULT_SCHEDULE} :arrow: {FIRST_WATCH}
Aah thanks man, i got it.

EDIT: some more question. I want to specify which unit does a side start with. So, for example, set side 1 leader to be a Bandit. And i want to disable the posibility of recruit. How can i do this ?
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Noob questions at creating multiplayer map

Post by monochromatic »

Slann wrote:EDIT: some more question. I want to specify which unit does a side start with. So, for example, set side 1 leader to be a Bandit. And i want to disable the posibility of recruit. How can i do this ?
side.canrecruit=yes side.type= (omit side.recruit). SideWML
User avatar
Slann
Posts: 66
Joined: March 2nd, 2008, 3:47 pm

Re: Noob questions at creating multiplayer map

Post by Slann »

Thanks again Sir ^_^ . I hope im not abusing your confidence, but i need an example for switch conditional. I have this but doesnt work
Spoiler:
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Noob questions at creating multiplayer map

Post by monochromatic »

[switch] structure:

Code: Select all

[switch]
    variable=VARIABLE_NAME
    [case]
        value=POSSIBLE_VALUE
        [command]
            ActionWML
        [/command]
    [/case]
[/switch]
Post Reply