HowToAddMapsServerStendhal: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
No edit summary
imported>Kiheru
Create a map file: Added a note about defining daylight colouring
Line 38: Line 38:
<source lang="xml">
<source lang="xml">
<zone name="int_myarea_mylocation" file="interiors/myarea/mylocation.tmx"/>
<zone name="int_myarea_mylocation" file="interiors/myarea/mylocation.tmx"/>
<zone name="0_myarea_mylocation" level="0" x="100000" y="200000" file="Level 0/myarea/mylocation.tmx">
<zone name="0_myarea_mylocation" level="0" x="100000" y="200000" file="Level 0/myarea/mylocation.tmx"/>
</source>
</source>


In the case of non-interior zones, the level and x/y coordinate should also be included in the <zone> element (setting them in the tmx file has been deprecated). For interior zones, the level xml attribute should '''not''' be set (for now). The coordinate starts at the top-left corner, and should align against (but never overlap) other zones in the same level.
In the case of non-interior zones, the level and x/y coordinate should also be included in the <zone> element (setting them in the tmx file has been deprecated). For interior zones, the level xml attribute should '''not''' be set (for now). The coordinate starts at the top-left corner, and should align against (but never overlap) other zones in the same level.

If the new zone is outside, or otherwise should follow the normal daylight cycle, add a coloring method definition to it, like this:

<source lang="xml">
<zone name="0_myarea_mylocation" level="0" x="100000" y="200000" file="Level 0/myarea/mylocation.tmx">
<attributes>
<parameter name="color_method">time</parameter>
</attributes>
</zone>
</source>

About other possible coloring methods for maps, see [[LightsAndColor | Lights and Color]].


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>/<base-location>/<entity>.java'''. The '''<area>/<base-location>''' path would essentially be the same as your '''.tmx''' file uses. In case where locations have been split due to size (like _nw, _ne, _s, _n, etc), only the base location name is used.
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>/<base-location>/<entity>.java'''. The '''<area>/<base-location>''' path would essentially be the same as your '''.tmx''' file uses. In case where locations have been split due to size (like _nw, _ne, _s, _n, etc), only the base location name is used.