Help with setting up first map with WML .cfg file.

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

Moderator: Forum Moderators

Post Reply
DroidFreak
Posts: 1
Joined: December 8th, 2014, 7:58 am

Help with setting up first map with WML .cfg file.

Post by DroidFreak »

So, I made a custom map and I want to change the map settings, which led me down the rabbit hole of WML, and now I can't even get the .cfg file to recognize the map at all. Hopefully one of you who knows what you're doing can help me out. Here's the situation:

1) The map file is ...Wesnoth1.10/editor/maps/3_rivers_starry_edge (the default spot where the map editor saves it)
2) The config file is ...Wesnoth1.10/editor/maps/3 rivers.cfg
3) The text of the config file is:

#textdomain wesnoth-multiplayer

[multiplayer]
id=multiplayer_3_rivers_starry_edge
name= _ "Three Rivers"
map_data="{~editor/maps/3_rivers_starry_edge}"
description= _ "On a disc floating in space, 3 armies fight across all sorts of terrain to claim victory."
random_start_time="yes"

{DEFAULT_SCHEDULE}
{DEFAULT_MUSIC_PLAYLIST}

[side]
side=1
canrecruit=yes
controller=human
gold=100
team_name=northwest
user_team_name= _ "teamname^Northwest"
fog=no
[/side]
[side]
side=2
canrecruit=yes
controller=human
village_gold=3
gold=100
team_name=east
user_team_name= _ "teamname^East"
fog=no
[/side]
[side]
side=3
canrecruit=yes
controller=human
gold=100
team_name=southwest
user_team_name= _ "teamname^Southwest"
fog=no
[/side]

[/multiplayer]

4) When I try to use the map, the description is "Error" and hovering over the area where the preview would be gives the tooltip "Map has header but no usage". The map definitely has a usage tag and works as a standalone map, so I assume the problem is with "3 rivers.cfg" but I can't figure out what it is with such an unhelpful error message. I can't get any form of it to work.
Korben
Posts: 22
Joined: April 14th, 2012, 11:41 pm

Re: Help with setting up first map with WML .cfg file.

Post by Korben »

I might be wrong, but don´t go custom maps in the add-on file?
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Re: Help with setting up first map with WML .cfg file.

Post by tekelili »

From PreprocessorRef
The exact location in which the path will be resolved will depend on its prefix:

{path}: If path isn't a known macro (see below), the game will assume it's a relative path to a file in the main game data/ directory and include it.
{~path}: As above, but instead of the game data directory, the path is resolved relative to the user data/ directory, where user made add-ons can normally be found.
{./path}: The path is resolved relative to the location of the current file containing this inclusion.
I think your use of "~" is wrong having files in editor
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Help with setting up first map with WML .cfg file.

Post by Ravana »

Putting files according to addon format might be easier, you can check any map pack for example.
Post Reply