How Do I Change Map Default Settings?

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

Post Reply
KingJohnVI
Posts: 30
Joined: July 18th, 2011, 2:02 am

How Do I Change Map Default Settings?

Post by KingJohnVI »

I created a map that I want to have, by default, use starting Gold = 300 and gold per village = 3. When "use map settings" is selected, however, it currently defaults to 100 and 2. How can I alter the map so that it will use the correct defaults? Thanks for your help.
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: How Do I Change Map Default Settings?

Post by Velensk »

You make those kind of modifications in the .cfg file that goes along with the map. If the map doesn't have one it defaults.
"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."
KingJohnVI
Posts: 30
Joined: July 18th, 2011, 2:02 am

Re: How Do I Change Map Default Settings?

Post by KingJohnVI »

Ah so I need to make a .cfg file. Thanks very much!
KingJohnVI
Posts: 30
Joined: July 18th, 2011, 2:02 am

Re: How Do I Change Map Default Settings?

Post by KingJohnVI »

EDIT 2: Problem solved, but see the last line below... A very odd solution.

Ok, So I made a .cfg file but the map is giving me an error when I try to load it for multiplayer; any help would be greatly appreciated.

What I am trying to do is make a .cfg file for a map I made called 18th Century Weldyn Channel. The file name for this map is 2p_Weldyn_Channel_18th_C.map, and the config file is named 2p_Weldyn_Channel_18th_C.cfg. I need the .cfg file to change starting gold to 300 and village gold to 3 by default. The following very short file is all the text directly from notepad:

-------------------------------------------
#textdomain wesnoth-multiplayer

[multiplayer]
id=multiplayer_Weldyn_Channel_18th_C
name= _ "2p - 18th Century Weldyn Channel"
map_data="{multiplayer/maps/2p_Weldyn_Channel_18th_C.map}"
description= _ "This vital supply route has played a key role in many of Wesnoth's greatest battles."
random_start_time="no"

{DEFAULT_SCHEDULE}
{DEFAULT_MUSIC_PLAYLIST}

[side]
[ai]
villages_per_scout=14
[/ai]
side=1
canrecruit=yes
controller=human
village_gold=3
gold=300
team_name=north
user_team_name= _ "teamname^North"
fog=yes
[/side]
[side]
[ai]
villages_per_scout=14
[/ai]
side=2
canrecruit=yes
controller=human
village_gold=3
gold=300
team_name=south
user_team_name= _ "teamname^South"
fog=yes
[/side]
[/multiplayer]
-----------------------------------------------------------

What have I done wrong? Thanks very much for your help.
- King John VI

Edit: The files are located in the same directories as normal multiplayer maps, i.e. /multiplayer/maps for the .map file and /multiplayer/scenarios for the .cfg file. Could that be part of the issue? Should they be located elsewhere? Do I need to place them in other locations?

Edit 2: Ok so I solved the problem, but it seems like a very odd solution... I removed the .map from the .map file, making it simply 2p_Weldyn_Channel_18th_C with no extension, and changed the map data line to read: map_data="{multiplayer/maps/2p_Weldyn_Channel_18th_C}" again, simply removing the extension, and the whole thing now functions correctly. Is that... normal?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: How Do I Change Map Default Settings?

Post by zookeeper »

KingJohnVI wrote:Edit 2: Ok so I solved the problem, but it seems like a very odd solution... I removed the .map from the .map file, making it simply 2p_Weldyn_Channel_18th_C with no extension, and changed the map data line to read: map_data="{multiplayer/maps/2p_Weldyn_Channel_18th_C}" again, simply removing the extension, and the whole thing now functions correctly. Is that... normal?
No, and the likeliest explanation is that it wasn't originally named 2p_Weldyn_Channel_18th_C.map as you thought, but rather, for example, 2p_Weldyn_Channel_18th_C.map.txt.

You could name your map 2p_Weldyn_Channel_18th_C.foo.map.1.bar and the game wouldn't care at all, as long its the same name as the one in the include path.
Post Reply