HowToAddMapsServerStendhal: Difference between revisions

Content deleted Content added
imported>Chad3f
imported>Chad3f
Line 44:
<pre>
<zone name="int_myarea_mylocation" file="int_myarea_mylocation.xstend"/>
<zone name="0_myarea_mylocation" level="0" x="100000" y="200000" file="0_myarea_mylocation.xstend">
</pre>
 
In the case of non-interior zones, the level and x/y coordinate should also be included in the <zone> element, as the settings in the tmx file will soon be deprecated. For interior zones, the level xml attribute should '''not''' be set (for now).
 
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, 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.
Line 50 ⟶ 53:
'''There is a proposed new naming convention:'''
 
This replaces the <location> package with a <Location>_ prefix on the java filename, where tmx file underscores are converted to ''camel case'' (upper case each first letter instead) for the prefix. As a result, the filename should always contain exactly two underscores. The previous remaining rules still apply.
 
Some new convention tmx path to java filefilename examples are:
 
Level 0/desert/oasis.tmx -> .../maps/desert/Oasis_OL0_NomadNPC.java