I need help too!

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Retlin
Posts: 40
Joined: February 2nd, 2006, 1:47 am

I need help too!

Post by Retlin »

Ok, maybe im just retarted, but i looked over the FAQ and stuff, but i can not uderstand the stuff about making a multiplayer map and getting more options. I have tried to do what I thought it said, but I get no more options, and I was wondering how you make people. Is it on the MapEditor? or the CAMPGEN. If its on the CAMPGEN, can someone tell me where to put it so I can use it. Thanks guys!
There are two types of people in this world, those who can count, and those who can't.

There is no limitation to your procrastination.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

What options are you thinking of? Do you mean adding units to a map?
Hope springs eternal.
Wesnoth acronym guide.
Retlin
Posts: 40
Joined: February 2nd, 2006, 1:47 am

Post by Retlin »

Yes, that is one of them. It also said something about experience. I basically want to be able to add units though. I think that will suffice for now. Can you tell me what to do?
There are two types of people in this world, those who can count, and those who can't.

There is no limitation to your procrastination.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Yes, but it's not trivial. Making maps is easy. Adding stuff is much harder. Neither the map editor or campgen is appropriate for what you want to do.

You need to use WML to create a map scenario file. Here is an example. It's the scenario code for Blitz:

Code: Select all

[multiplayer]
	id=multiplayer_Blitz
	name= _ "2p - Blitz"
	map_data="{maps/multiplayer/2p_Blitz}"
	description= _ "A duel map for super fast play. Recommended setting of 2 gold per village."

	{DEFAULT_SCHEDULE}

	[side]
	side=1
	canrecruit=1
	controller=human
	team_name=north
	[/side]
	[side]
	side=2
	canrecruit=1
	controller=human
	team_name=south
	[/side]

[/multiplayer]
It comes straight from wesnoth/data/scenarios/multiplayer/2p_Blitz.cfg.

So, let's say you created a map in the map editor, and the file looks like a normal map file - a rectangle of letters. For example:

Code: Select all

hgffhmfghgggkcckhfhmm
ggtghggggCCCkckfmhwfh
fgggmfgrrC1Ckckfmgfvm
hmgggrrghgCkr\gggggfh
fhgrrgggfkkccgrrgvggm
mvrggvghtkcggwwwrrgrr
hgrfghfkfkcgwwYwhmrtg
ffrfhkccccZcgwwmfrrgg
mhrmmccGccscggwwhkrrh
fkrhhccRGGccccgmfk|cr
kcrfggkkfRGRkkkggfrcr
rcrkgmkckcGGfRkcgmrkk
rr|kfwggccccGGcchfrhm
hgrrhfwwgcscccckmhrff
gtrfmwwwggZkckchffrgh
grrrhwYwwgckfhfvggrvf
rggvrrwggccktggggrrhh
fhgggmr\ckkgmggrrgfmf
htghfhgcrCCCfrrgggggf
mhfmfkkckC2Crggftgggg
ffwfkccckgCggfmhhfghm
In order to put things on the map, you need to create a scenario file like the one I posted at the top. I will now merge the map data with the scenario file. Note the location of the quotation marks in map_data:

Code: Select all

[multiplayer]
	id=multiplayer_retlin
	name= _ "Retlin's Awesome Map"
	map_data="hgffhmfghgggkcckhfhmm
ggtghggggCCCkckfmhwfh
fgggmfgrrC1Ckckfmgfvm
hmgggrrghgCkr\gggggfh
fhgrrgggfkkccgrrgvggm
mvrggvghtkcggwwwrrgrr
hgrfghfkfkcgwwYwhmrtg
ffrfhkccccZcgwwmfrrgg
mhrmmccGccscggwwhkrrh
fkrhhccRGGccccgmfk|cr
kcrfggkkfRGRkkkggfrcr
rcrkgmkckcGGfRkcgmrkk
rr|kfwggccccGGcchfrhm
hgrrhfwwgcscccckmhrff
gtrfmwwwggZkckchffrgh
grrrhwYwwgckfhfvggrvf
rggvrrwggccktggggrrhh
fhgggmr\ckkgmggrrgfmf
htghfhgcrCCCfrrgggggf
mhfmfkkckC2Crggftgggg
ffwfkccckgCggfmhhfghm"
	description= _ "A duel map for super fast play. Recommended setting of 2 gold per village."

	{DEFAULT_SCHEDULE}

	[side]
	side=1
	canrecruit=1
	controller=human
	team_name=north
	[/side]
	[side]
	side=2
	canrecruit=1
	controller=human
	team_name=south
	[/side]

[/multiplayer]
If you save that as a .cfg file in your userdata/data/campaigns directory, it will show up on the list of maps you can play in multiplayer.

The hard part is past us. Understanding how information is stored and the various forms map data can take are key steps. The game recognizes both types of files - the pure map data only, i.e. the rectangle of characters in the text file, as well as the map data wrapped in [multiplayer] tags to create a scenario file.
Hope springs eternal.
Wesnoth acronym guide.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Here's part 2. Now that you have a functioning scenario file for your multiplayer map, you can use WML to add anything you want to it. The WML to add a unit to the map looks like this:

Code: Select all

[event]
name=prestart

[unit]
type=Spearman
x,y=10,10
side=1
[/unit]
[/event]
Most actions should be placed inside an event. There is a long list of things you can do inside events, and [unit] creates a unit.

Now all you have to do is stick the WML anywhere inside the scenario file.

Code: Select all

[multiplayer]
	id=multiplayer_retlin
	name= _ "Retlin's Awesome Map"
	map_data="hgffhmfghgggkcckhfhmm
ggtghggggCCCkckfmhwfh
fgggmfgrrC1Ckckfmgfvm
hmgggrrghgCkr\gggggfh
fhgrrgggfkkccgrrgvggm
mvrggvghtkcggwwwrrgrr
hgrfghfkfkcgwwYwhmrtg
ffrfhkccccZcgwwmfrrgg
mhrmmccGccscggwwhkrrh
fkrhhccRGGccccgmfk|cr
kcrfggkkfRGRkkkggfrcr
rcrkgmkckcGGfRkcgmrkk
rr|kfwggccccGGcchfrhm
hgrrhfwwgcscccckmhrff
gtrfmwwwggZkckchffrgh
grrrhwYwwgckfhfvggrvf
rggvrrwggccktggggrrhh
fhgggmr\ckkgmggrrgfmf
htghfhgcrCCCfrrgggggf
mhfmfkkckC2Crggftgggg
ffwfkccckgCggfmhhfghm"
	description= _ "A duel map for super fast play. Recommended setting of 2 gold per village."

	{DEFAULT_SCHEDULE}

	[side]
	side=1
	canrecruit=1
	controller=human
	team_name=north
	[/side]
	[side]
	side=2
	canrecruit=1
	controller=human
	team_name=south
	[/side]

[event]
name=prestart

[unit]
type=Spearman
x,y=10,10
side=1
[/unit]
[/event]

[/multiplayer]
That should do it. Good luck.
Hope springs eternal.
Wesnoth acronym guide.
Retlin
Posts: 40
Joined: February 2nd, 2006, 1:47 am

Post by Retlin »

ok, cool, but where do i get WML?
There are two types of people in this world, those who can count, and those who can't.

There is no limitation to your procrastination.
Retlin
Posts: 40
Joined: February 2nd, 2006, 1:47 am

Post by Retlin »

ok. How do you open it? I found, on my comp, a bunch of WML files, but couldnt open them. Do I make a text document and then put the code in it?
There are two types of people in this world, those who can count, and those who can't.

There is no limitation to your procrastination.
Jose Luis
Posts: 36
Joined: October 31st, 2005, 12:19 pm

Post by Jose Luis »

Retlin wrote:ok. How do you open it? I found, on my comp, a bunch of WML files, but couldnt open them. Do I make a text document and then put the code in it?
Exactly. Any text editor is ok (but many people here uses emacs)
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

You can open them if you tell your computer to ignore the file extension. Nearly all the files you will encounter are ascii text with a .cfg extension instead of a .txt extension.
Hope springs eternal.
Wesnoth acronym guide.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

I just want to add that I learned all my WML knowledge from scenario files and I think it´s
the best way to download the "Generic Campaign" (no gameplay value) and look at its
cfg files. It gives a good starting help. The wiki is more useful as a quick help to all tags. :wink:
First read, then think. Read again, think again. And then post!
Retlin
Posts: 40
Joined: February 2nd, 2006, 1:47 am

Post by Retlin »

OK, I have an Imac, would appleworks work for the code? And if it does, what do I save it as and where do I put it?
There are two types of people in this world, those who can count, and those who can't.

There is no limitation to your procrastination.
User avatar
appleide
Posts: 1003
Joined: November 8th, 2003, 10:03 pm
Location: Sydney,OZ

Post by appleide »

Do you have OS X? (You must have... That was a stupid question..). Go into your applications folder, drag textedit into your dock (you'll need it often, messing around with WML ;) ) Then drag the .cfg files into the textedit app in your dock, and they'll be opened as txt files. When you create a new .cfg file, remember to make it PLAIN text. And when you save it, uncheck "hide extension" and "auto-add .txt extension" in the save dialog.

Hope it helps :)
Why did the fish laugh? Because the sea weed.
Retlin
Posts: 40
Joined: February 2nd, 2006, 1:47 am

Post by Retlin »

THANKS ALOT!!
There are two types of people in this world, those who can count, and those who can't.

There is no limitation to your procrastination.
Retlin
Posts: 40
Joined: February 2nd, 2006, 1:47 am

Post by Retlin »

Also, where do you get the giant block of letters for the map data? (i feel like such a noob…… :oops: )
There are two types of people in this world, those who can count, and those who can't.

There is no limitation to your procrastination.
Post Reply