Is there any way to add labels to a map?
Moderator: Forum Moderators
Is there any way to add labels to a map?
I've been making some multiplayer maps (Well, I've made one so far, with multiple versions - one each for 2-7 players, and one for 9 players which isn't balanced), and I'm wondering if there's any way to label things on the map.
I haven't found any way yet. I'm using editor.exe in windows.
I'm assuming the file format supports it, though, so hopefully I can label one and then copy the labels into the map file for the others. Or I could add an 'import labels from another map...' menu option to the editor and recompile it.
I haven't found any way yet. I'm using editor.exe in windows.
I'm assuming the file format supports it, though, so hopefully I can label one and then copy the labels into the map file for the others. Or I could add an 'import labels from another map...' menu option to the editor and recompile it.
Last edited by SL on May 11th, 2005, 11:06 pm, edited 1 time in total.
- Elvish_Pillager
- Posts: 8137
- Joined: May 28th, 2004, 10:21 am
- Location: Everywhere you think, nowhere you can possibly imagine.
- Contact:
Hmm. There aren't [scenario] labels anywhere in the map file - now that I have it open in a text editor, it just looks like ASCII art.
I've attempted to change it so it's like what you wrote, but Wesnoth refuses to load it. Here's what I changed it to
These are maps for multiplayer, not for a campaign. I'm testing them with 'Multiplayer->Human vs AI'.
I've attempted to change it so it's like what you wrote, but Wesnoth refuses to load it. Here's what I changed it to
Code: Select all
[scenario]
the actual map data is here, it's 75 lines of 76 characters each.
[label]
x=5
y=5
text=spam
[/label]
[/scenario]
-
- Posts: 131
- Joined: March 1st, 2005, 9:03 pm
- Location: Uncertain Velocity: Known
Map files are just text, with one character representing one hex. What EP is referring to is a WML scenario file, which either references a separate map file or includes the map data in its map element. Never having built a multiplayer scenario, that's about the limit of my knowledge. You might look at the Wesbowl code, although it's a touch complicated. A quick buzz through the Wiki didn't turn anything up, but it's probably there somewhere.SL wrote:Hmm. There aren't [scenario] labels anywhere in the map file - now that I have it open in a text editor, it just looks like ASCII art.
Author of Wercator
It's important to understand the difference between a scenario and a map.
A map is very simply just the terrain, and yes is stored like 'ascii art'.
A scenario is played on a map, but includes details such as the units being used, whether different sides have fog/shroud, victory/loss conditions, and -- pertinent to you -- labels.
In single player/campaign Wesnoth, raw maps don't work, everything has to be a scenario.
In multiplayer Wesnoth, either a raw map or a scenario with a map can be used. If Wesnoth is given a raw map, it will build a scenario out of it internally based on what you specify as the settings.
Now that you (hopefully) understand the difference between a map and a scenario, I can tell you the possibly bad news that the official Wesnoth editor only makes maps, not scenarios. If you want to add things like labels, you have to make a scenario yourself. The good news is it's not that hard.
All you have to do is make a scenario file. I suggest copying an existing scenario file from data/scenarios/multiplayer -- perhaps IcyWaters.cfg, and put your new file in an appropriate directory (userdata/data/scenarios would be most appropraite in Windows, though you could just use data/scenarios/multiplayer).
Then edit the file and change the id, name, and most importantly, the map_data attributes to point to your map. You can change other things too if you want.
Then you can add [label] tags as Elvish Pillager suggests to place labels.
And FYI, yes, I personally do think a scenario editor rather than a simple map editor would be nice, but it'd also be quite difficult to write a good one....hence there being none yet.
David
A map is very simply just the terrain, and yes is stored like 'ascii art'.
A scenario is played on a map, but includes details such as the units being used, whether different sides have fog/shroud, victory/loss conditions, and -- pertinent to you -- labels.
In single player/campaign Wesnoth, raw maps don't work, everything has to be a scenario.
In multiplayer Wesnoth, either a raw map or a scenario with a map can be used. If Wesnoth is given a raw map, it will build a scenario out of it internally based on what you specify as the settings.
Now that you (hopefully) understand the difference between a map and a scenario, I can tell you the possibly bad news that the official Wesnoth editor only makes maps, not scenarios. If you want to add things like labels, you have to make a scenario yourself. The good news is it's not that hard.
All you have to do is make a scenario file. I suggest copying an existing scenario file from data/scenarios/multiplayer -- perhaps IcyWaters.cfg, and put your new file in an appropriate directory (userdata/data/scenarios would be most appropraite in Windows, though you could just use data/scenarios/multiplayer).
Then edit the file and change the id, name, and most importantly, the map_data attributes to point to your map. You can change other things too if you want.
Then you can add [label] tags as Elvish Pillager suggests to place labels.
And FYI, yes, I personally do think a scenario editor rather than a simple map editor would be nice, but it'd also be quite difficult to write a good one....hence there being none yet.
David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming