Is there any way to add labels to a map?

General feedback and discussion of the game.

Moderator: Forum Moderators

Post Reply
SL
Posts: 70
Joined: May 8th, 2005, 1:15 am

Is there any way to add labels to a map?

Post by SL »

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. :P
Last edited by SL on May 11th, 2005, 11:06 pm, edited 1 time in total.
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

[scenario]
...
[label]
x=
y=
text=
[/label]
...
[/scenario]
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
SL
Posts: 70
Joined: May 8th, 2005, 1:15 am

Post by SL »

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

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]
These are maps for multiplayer, not for a campaign. I'm testing them with 'Multiplayer->Human vs AI'.
stillnotelf
Posts: 131
Joined: March 1st, 2005, 9:03 pm
Location: Uncertain Velocity: Known

Post by stillnotelf »

Perhaps with "quotation marks" around the spam?
Usque adeone mori miserum est? After all, there's always a continue...
Quensul
Art Contributor
Posts: 303
Joined: January 2nd, 2005, 1:06 am
Location: Pittsburgh, PA

Post by Quensul »

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.
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.
Author of Wercator
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

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
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Post Reply