HowToAddMapsServerStendhal: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Chad3f
imported>Chad3f
Line 20: Line 20:


= Create a map file=
= Create a map file=

If you need to do custom zone configuration that is not possible via the "zones.xml" file (such as adding NPC's), for each zone, create one or more new Java source file(s) at '''src/games/stendhal/server/maps/<area>/<location>/<level>_<entity>.java'''. The directory path after '''maps/''' would be the same as your '''.tmx''' file uses. Ideally this would be one file per independant entity created (so they can be enabled/diabled separately).
To enable a zone in the server, edit the file '''data/conf/zones.xml''' and add an entry (in the appropriete level/top-down/left-right order), giving it the zone name and converted map filename to use:

<pre>
<zone name="int_myarea_mylocation" file="int_myarea_mylocation.xstend"/>
</pre>

Most zones can be configured just using this xml file. However, there are currently some things, such as NPC's that need special handling. If you need to do custom zone configuration for a zone, create one or more new java source file(s) at '''src/games/stendhal/server/maps/<area>/<location>/<level>_<entity>.java'''. The '''<area>/<location>''' path would be the same as your '''.tmx''' file uses. Ideally this would be one file per independant entity created (so they can be enabled/disabled separately). The level is used as '''[I/U/O][L/SL]#''' where I=Inside, U=Underground, O=Outside, L=Level, SL=Sub-Level, and # for the level (or sub-level without the minus) number.


Open the file and make sure that it looks like this:
Open the file and make sure that it looks like this:
Line 45: Line 52:
</pre>
</pre>


For each custom configuration code class, add appropriete "<configurator>" entries in your "<zone>" element, using the fully qualified package/class name of your java classes:
To enable a zone in the server, edit the file '''data/conf/zones.xml''' and add an entry (in the appropriete top-down/left-right/level order), giving it the zone name and converted map filename to use:

<pre>
<zone name="int_myarea_mylocation" file="int_myarea_mylocation.xstend"/>
</pre>

If you have custom configuration code, add appropriete "<configurator>" entries in your "<zone>" element, using the fully qualified package/class name of your java classes:


<pre>
<pre>