HowToAddMapsServerStendhal
Of course you have already read:
Ok, and I assume that you can write or at least read Java.
- Modify map TMX file
The maps files are just XML files with special tags, open your maps and make sure that you set x,y position of your map on the world. Semos village is right now (500000,500000) so use something near yours to set correctly the map position.
Now you need to create the stend map files. There are two options: - Generate it using tiled ( Save as xstend ) - Run at stendhal folder: ant convertmaps
The later is prefered as it will also update world.tmx graphics.
- Modify world.tmx
Now make sure if your map is new that world.tmx shows it by adding a new tileset with your map image. This step is just for your mental wellness. Stendhal don't use world.tmx.
- Create a map file
Create a new Java source file at games/stendhal/server/maps/<name>.java
Open the file and make sure that it looks like this:
package games.stendhal.server.maps;
import games.stendhal.server.StendhalRPWorld;
public class MapName implements IContent
{
public MapName(StendhalRPWorld world)
{
}
}
This is an empty map area file. This file is used just to populate the areas that has previously added to World in the file StendhalRPWorld.java inside the onInit method.
public void onInit() throws Exception
{
// Load zones. Written from left to right and from up to down.
// Please respect it!
// Ground level
addArea("0_semos_mountain_n_w4");
addArea("0_semos_mountain_n2_w2");
addArea("0_semos_mountain_n2_w");
addArea("0_semos_mountain_n2");
Find where your zone should be and just place it between that.