How to make own terrains?

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.
Dyplorus
Posts: 20
Joined: December 6th, 2013, 5:28 am

How to make own terrains?

Post by Dyplorus »

I know that there is probably coding involved with making new village sprites. But I don't know where to start when it comes to learning WML! >_< Any advice on how to start coding or any easier ways to make new village sprites.

What files do I even open?

What's required?

And what's the quickest way possible to creating your own village sprites?
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: How to make own terrains?

Post by beetlenaut »

If you want to replace some of the regular sprites with your own on just your computer, that's easy. You can copy over any existing village images in the directory data/core/images/terrain/village/. (Make copies of the originals first.) The images with "tile" in their names are only for the map editor, so you don't need to bother with those. If you need help finding the correct directory, follow the Create link at the top of this page and read Editing Wesnoth.

If you want to add your new sprites to a multiplayer map or scenario, that will require some technical coding. New terrain is possibly the hardest thing to work with in WML. Before you think about coding a new type of village, you need to get comfortable with some basics. Follow the Create link, and read about scenarios. Download A Simple Campaign from the server, and take a look at the files. Make some changes to that campaign (add a unit or an allied side for example), and make sure it still runs and your changes worked. Eventually, you will need to look up TerrainWML and TerrainGraphicsWML on the wiki. There are links here if you want to see where you are headed: http://wiki.wesnoth.org/ReferenceWML.

Have fun! Feel free to ask more questions if you get stumped.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Dyplorus
Posts: 20
Joined: December 6th, 2013, 5:28 am

Re: How to make own terrains?

Post by Dyplorus »

Thank you ^_^ so do I edit image in gimp? If so, is there anything I should know to avoid problems when editing the image?

and should I edit the copies once they're made or do I leave the copies alone and replace the originals?
Last edited by Dyplorus on December 7th, 2013, 3:17 am, edited 1 time in total.
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: How to make own terrains?

Post by beetlenaut »

You don't have to edit in GIMP, but it's free and powerful, so it's a good choice. Make sure you don't make the transparent background opaque, and you'll be fine.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Dyplorus
Posts: 20
Joined: December 6th, 2013, 5:28 am

Re: How to make own terrains?

Post by Dyplorus »

Okay, and you say I need to know coding to be able to use them in the map editor and see them in-game?
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: How to make own terrains?

Post by beetlenaut »

If you replace the current village images with your own, your images will show up in the game and editor with no coding required. The game pulls in the images by name, so if the map calls for "desert-camp.png," you can have whatever image you want in that file, and that's what will appear on screen. That will only work on your own computer of course. If you want to have your images available as an additional type of village along with all the regular ones, or share them with other people, then you will need to code them. Yes.

Actually, I recommend using the first method while you are drawing. That way you can wait until you are satisfied that they look good in the game before you try to code them. Just don't forget to save a copy of the originals so you can put them back later.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Dyplorus
Posts: 20
Joined: December 6th, 2013, 5:28 am

Re: How to make own terrains?

Post by Dyplorus »

beetlenaut wrote:If you replace the current village images with your own, your images will show up in the game and editor with no coding required. The game pulls in the images by name, so if the map calls for "desert-camp.png," you can have whatever image you want in that file, and that's what will appear on screen. That will only work on your own computer of course. If you want to have your images available as an additional type of village along with all the regular ones, or share them with other people, then you will need to code them. Yes.

Actually, I recommend using the first method while you are drawing. That way you can wait until you are satisfied that they look good in the game before you try to code them. Just don't forget to save a copy of the originals so you can put them back later.
okay, also, I've tried editing the type of units you can recruit before, but somehow it crashes my game...all I did was add the ID to the list of recruitable units. What was I missing? Also I tried editing the attack power of some units and it also crashed my game >_<
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: How to make own terrains?

Post by beetlenaut »

Dyplorus wrote:What was I missing?
If you show me exactly what you typed and where, I could probably tell you. Also, "crashed my game" is not very descriptive. I suspect that you actually got an error message and game returned you to the opening screen. If that is the case, you may have just made a typo, but the text of the error message would have given you some information (though it can't always correctly guess what you meant).

This is a hurdle you have to get past, so try the recruitment thing again. Then post the code you edited, and explain exactly what happened. A screenshot of any error message would be very helpful. If it works this time, try something more complicated like the attack power until you break it again. Then post that code.

Also, I don't know what editor you are using, but you can't use a word processor. You have to use something very simple. Use notepad if you have Windows.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Dyplorus
Posts: 20
Joined: December 6th, 2013, 5:28 am

Re: How to make own terrains?

Post by Dyplorus »

Okay so I tried to edit the faction "undead-default" and tried to add a leader and random leader. So I copied the ID of the "ancient lich" and added it to the leaders

what I edited:
here is the error message
Error loading game configuration files: 'Macro/file 'multiplayer/' is missing at_main.cfg:10 (the game will now exit)
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: How to make own terrains?

Post by beetlenaut »

I opened /data/multiplayer/factions/undead-default.cfg
I added "Ancient Lich" to leader and random-leader, so this is what I have now:

Code: Select all

#textdomain wesnoth-multiplayer
[multiplayer_side]
    id=Undead
    name= _"Undead"
    image="units/undead-necromancers/dark-sorcerer.png"
    {MAGENTA_IS_THE_TEAM_COLOR}
    type=Dark Sorcerer
    leader=Dark Sorcerer,Revenant,Deathblade,Bone Shooter,Necrophage,Ancient Lich
    random_leader=Dark Sorcerer,Revenant,Deathblade,Bone Shooter,Ancient Lich
    recruit=Skeleton,Skeleton Archer,Walking Corpse,Ghost,Vampire Bat,Dark Adept,Ghoul
    terrain_liked=Ss, Hh, Ha, Ww
    [ai]
        recruitment_pattern=fighter,fighter,archer,fighter,scout,archer
    [/ai]
[/multiplayer_side]
I opened the game, selected Multiplayer-->Local Game. I selected the Dark Forcast map, and set the leader of my side to Ancient Lich.
It worked fine. No problem. I used 1.10.7 and 1.11.7 because I don't know what you are using.

(This kind of post, by the way, is the way to get the best help. What you showed me is probably not what the file looks like now--even just the changed lines. Or is it?)

The only way I was able to get the error you posted was by renaming or deleting the whole multiplayer folder. So, what else did you do? (I'm helping with this because there is a rather large problem if it doesn't work, but modifying the multiplayer config files isn't going to help you understand how to add terrain to the maps. I suggested you modify a scenario file because that is what you will have to understand.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Dyplorus
Posts: 20
Joined: December 6th, 2013, 5:28 am

Re: How to make own terrains?

Post by Dyplorus »

I'm using 1.10.7

and I had the exact same thing. Still didn't work.


So I copied your code and replaced what I had, still didn't work :|
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: How to make own terrains?

Post by beetlenaut »

Your code is not the problem. The error message is saying that the multiplayer folder has been moved or had its name changed. That is your problem.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Dyplorus
Posts: 20
Joined: December 6th, 2013, 5:28 am

Re: How to make own terrains?

Post by Dyplorus »

beetlenaut wrote:Your code is not the problem. The error message is saying that the multiplayer folder has been moved or had its name changed. That is your problem.

well I never changed the name or moved it 0.o

Strange....

Im uninstalling and re-installing because either way, I can't play mulitplayer now >_<
User avatar
beetlenaut
Developer
Posts: 2867
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: How to make own terrains?

Post by beetlenaut »

You must have done something to in accidentally. In any case, reinstalling should fix it. Then, I suggest changing one of the mainline campaigns. Add a recruit type to the first scenario of An Orcish Incursion for example. (It's probably the simplest campaign.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
AI
Inactive Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: How to make own terrains?

Post by AI »

Also, one issue you're clearly having is that you're using notepad, which doesn't recognize LF-terminated lines, which is what we use. (you'll have noticed that everything seems to be on one line)
I've heard a lot of people recommend notepad++, though I can't say I've used it myself. You can also use wordpad, which doesn't have notepad's issues, but you have to be sure to save as a text file, not a word document or rich text format or anything like that.
Post Reply