Editing MP maps from Editor

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

Moderator: Forum Moderators

Post Reply
BrandonD
Posts: 19
Joined: July 28th, 2009, 7:32 pm

Editing MP maps from Editor

Post by BrandonD »

Hi I don't know if I'm asking this question in the proper area of the forum, but here goes:

What I'm basically interested in doing is designing your standard MP map in the Wesnoth map editor, and then manually using WML to make some simple additional edits such as placing items or random monsters into the map.

I've been reading up on WML and scenario editing for a few hours now, and since I'm not exactly a programmer but just a huge fan of the game, I think there are some basic concepts I'm not quite grasping.

Anyway, that's basically my situation, I'd be very thankful if anyone could help me out in any way.

Other details: I'm running version 1.6.4 on Snow Leopard.
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: Editing MP maps from Editor

Post by Velensk »

Easiest way is to see how it has already been done

In order to get a good idea of how to associate maps with .cfg's and get them into the game by downloading a map-pack then looking at how it is organized by finding the wesnoth folder in your Application support folder (in library).

In order to see how objects/units are put into the map look at some mainline scenarios that work in similar fashion. Wilderlands is a good example of how to do wandering monsters but for items you'd have to look at a scenario in a campaign. In order to get at the core wesnoth data right click on the wesnoth application and select 'view package contents'.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
BrandonD
Posts: 19
Joined: July 28th, 2009, 7:32 pm

Re: Editing MP maps from Editor

Post by BrandonD »

Velensk wrote:Easiest way is to see how it has already been done...
Thanks for the advice, I really appreciate it!

My first mission is just to write a scenario that will add 6 monsters at various spots on my map. I'm still running into some problems though, here's where I am so far:

I went and had a look at the Wildlands cfg file, and made a modified version of that file for my own map (which is titled "Brandon3").

In the .cfg file I added a 'Player 7' with 6 monsters at various spots on the map. I made the Player 7 unable to recruit, because I just want it to be those 6 monsters. At least, this is what I was shooting for with the code.

Here is the cfg file I made:
#textdomain wesnoth-multiplayer

[multiplayer]
id=Brandon3
name= _ "Brandon3"
description= _ "A large map divided into quadrants, and swarming with creatures."
map_data="{multiplayer/maps/Brandon3}"

{DEFAULT_SCHEDULE}
{DEFAULT_MUSIC_PLAYLIST}

[side]
[ai]
villages_per_scout=12
[/ai]
side=1
canrecruit=yes
fog=yes
[/side]
[side]
[ai]
villages_per_scout=12
[/ai]
side=2
canrecruit=yes
fog=yes
[/side]
[side]
[ai]
villages_per_scout=12
[/ai]
side=3
canrecruit=yes
fog=yes
[/side]
[side]
[ai]
villages_per_scout=12
[/ai]
side=4
canrecruit=yes
fog=yes
[/side]
[side]
[ai]
villages_per_scout=12
[/ai]
side=5
canrecruit=yes
fog=yes
[/side]

[side]
[ai]
villages_per_scout=12
[/ai]
side=6
canrecruit=yes
fog=yes
[/side]
[side]
[ai]
villages_per_scout=12
[/ai]
side=7
canrecruit=no
fog=yes
[/side]

[event]
name=prestart
[if]
[have_unit]
side=7
[/have_unit]
[then]
[kill]
animate=no
fire_event=no
side=7
[/kill]
{MPWILD_UNIT 45 20 (Sea Serpent)}
{MPWILD_UNIT 45 40 (Yeti)}
{MPWILD_UNIT 2 40 (Skeletal Dragon)}
{MPWILD_UNIT 2 20 (Giant Scorpion)}
{MPWILD_UNIT 25 5 (Giant Spider)}
{MPWILD_UNIT 25 45 (Ogre)}

[set_recruit]
side=5
type=""
[/set_recruit]
[/then]
[/if]
[/event]
Please let me know if this code makes sense for the result I'm shooting for.

Another thing I'm confused about: I did notice that the user-created maps appear to be stored in a different area - the preferences folder - while the downloaded MP maps are stored in the Wesnoth package contents. In the package contents there's an area for maps which is where the files ending in .map are, and there's a scenario folder which is where the files ending in .cfg are. However, in the preferences folder there is only an area for maps, I did not see a scenario folder.

If I do end up writing a correct .cfg file, where do I place it? Do I simply place it in the scenario folder, even though the map is not stored in the same area as the other maps?

Thanks again for any help that can be offered :)
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: Editing MP maps from Editor

Post by Velensk »

I haven't looked at your code but it looks about right (though I can see that it is missing the [/multiplayer]). If you want it to be easier to read put it in the 'code' tags instead of 'quote' tags.

As for the other thing: that is why I recommended downloading a map-pack to see how it is organized (the download will include by the .cfg and the map, if you structure your map the way the add-on structures itself it should work). You can include the content inside the wesnoth package itself however if you do that it will not be subject to the add-on handling system (which will make it impossible to distribute).
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
User avatar
Reepurr
Posts: 1088
Joined: August 29th, 2010, 5:38 pm

Re: Editing MP maps from Editor

Post by Reepurr »

First of all, are you sure that the {MPWILD_UNIT} is actually defined in the core macros? Otherwise it won't work and you have to use something like {UNIT (Whatever) x y ()}.

Secondly, maybe you want the 6 monsters to only be played by AI? Use

Code: Select all

   [side] 
   side=7
   canrecruit=yes
   controller=ai
fog=yes
no_leader=yes
allow_player=no
   [/side]
"What do you mean, "a dwarvish dragonguard with marksman is overpowered"?"

Story of a Drake Outcast | The Nonsense Era
Played HttT-Underground Channels? Thought it was rubbish? Help us develop it here!
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Editing MP maps from Editor

Post by monochromatic »

Reepurr wrote:

Code: Select all

   [side] 
   side=7
   canrecruit=yes # Get rid of this.
   controller=ai
fog=yes
no_leader=yes
allow_player=no
   [/side]
Except you shouldn't write that since there is no leader.
BrandonD
Posts: 19
Joined: July 28th, 2009, 7:32 pm

Re: Editing MP maps from Editor

Post by BrandonD »

Thanks everyone, I altered my code based upon your recommendations, here's what I've got as of now:

Code: Select all


#textdomain wesnoth-multiplayer

[multiplayer]
    id=Brandon3
    name= _ "Brandon3"
    description= _ "A large map divided into quadrants, and swarming with creatures."
    map_data="{multiplayer/maps/Brandon3}"

    {DEFAULT_SCHEDULE}
    {DEFAULT_MUSIC_PLAYLIST}

    [side]
        [ai]
 	 villages_per_scout=12
        [/ai]
        side=1
        canrecruit=yes
        fog=yes
    [/side]
    [side]
        [ai]
 	 villages_per_scout=12
        [/ai]
        side=2
        canrecruit=yes
        fog=yes
    [/side]
    [side]
        [ai]
 	 villages_per_scout=12
        [/ai]
        side=3
        canrecruit=yes
        fog=yes
    [/side]
    [side]
        [ai]
 	 villages_per_scout=12
        [/ai]
        side=4
        canrecruit=yes
        fog=yes
    [/side]
    [side]
        [ai]
 	 villages_per_scout=12
        [/ai]
        side=5
        canrecruit=yes
        fog=yes
    [/side]

    [side]
        [ai]
 	 villages_per_scout=12
        [/ai]
        side=6
        canrecruit=yes
        fog=yes
    [/side]
    [side]
        [ai]
 	 villages_per_scout=12
        [/ai]
        side=7
        no_leader=yes
        allow_player=no
        fog=yes
    [/side]

    [event]
        name=prestart
        [if]
            [have_unit]
                side=7
            [/have_unit]
            [then]
                [kill]
                    animate=no
                    fire_event=no
                    side=7
                [/kill]
                {UNIT 45 20 (Sea Serpent)}
                {UNIT 45 40 (Yeti)}
                {UNIT 2 40 (Skeletal Dragon)}
                {UNIT 2 20 (Giant Scorpion)}
                {UNIT 25 5 (Giant Spider)}
                {UNIT 25 45 (Ogre)}

                [set_recruit]
                    side=7
                    type=""
                [/set_recruit]
            [/then]
        [/if]
    [/event]
    [/multiplayer]

It still won't play however. First I moved the map to the "maps" folder in the wesnoth package contents and I added .map just so that it looked like the other maps in there. I then added the above code as a .cfg file in the scenarios folder. But my map would not show up for some reason.

I also tried removing the .map tag but this did not work, then I tried just leaving the map file in its original location. But none of these seemed to work correctly. When I leave the map file in its original location it just plays as an ordinary map and ignores the cfg file.

I can't seem to figure out the correct place to put these files. The map and scenario folders I'm mentioning above are the ones that contain the maps that were included with the game, I can't seem to find the folder that contains the multiplayer scenarios that I've downloaded from the main server.
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: Editing MP maps from Editor

Post by Velensk »

In my first post I told you where to find that folder but here it is again and more precisely. Look in Libraries/Application Support/Wesnoth 1.8 (or whatever)/data/add-ons/

If you put the .cfg file there and include in it a correct directory to the map it should find it.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
BrandonD
Posts: 19
Joined: July 28th, 2009, 7:32 pm

Re: Editing MP maps from Editor

Post by BrandonD »

Velensk wrote:In my first post I told you where to find that folder but here it is again and more precisely. Look in Libraries/Application Support/Wesnoth 1.8 (or whatever)/data/add-ons/

If you put the .cfg file there and include in it a correct directory to the map it should find it.
Thanks again for your help, sorry I'm having such a tough time with this simple step but there isn't any type of Wesnoth folder in my Library/Application Support folder (I don't have a 'Libraries' folder on the top level, just a 'Library' folder). I don't know why this is, I'm running version 1.6.4 I don't know if that version stores things differently?
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: Editing MP maps from Editor

Post by Velensk »

If you are running Snow Leopard, that is where it will be.

Be sure that you are looking in the Library in your user folder and not the general computer hard drives library.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
User avatar
Reepurr
Posts: 1088
Joined: August 29th, 2010, 5:38 pm

Re: Editing MP maps from Editor

Post by Reepurr »

BrandonD wrote:1.6.4 I don't know if that version stores things differently?
Uh huh.
You want Library/Preferences/Wesnoth 1.6/data/campaigns.
"What do you mean, "a dwarvish dragonguard with marksman is overpowered"?"

Story of a Drake Outcast | The Nonsense Era
Played HttT-Underground Channels? Thought it was rubbish? Help us develop it here!
Post Reply