HowToAddMapsServerStendhal: Difference between revisions

Content deleted Content added
imported>Chad3f
imported>Chad3f
Line 20:
 
= 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/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>
 
IfMost youzones needcan tobe doconfigured customjust zoneusing configurationthis thatxml isfile. notHowever, possiblethere viaare thecurrently "zones.xml"some filethings, (such as adding NPC's), that need special handling. If you need to do custom zone configuration for eacha zone, create one or more new Javajava source file(s) at '''src/games/stendhal/server/maps/<area>/<location>/<level>_<entity>.java'''. The directory path after '''maps<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/diableddisabled 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:
Line 45 ⟶ 52:
</pre>
 
IfFor you haveeach 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>