Difference between revisions of "User:Wookipan/Map overview"

From Team Fortress Wiki
Jump to: navigation, search
(Bap)
 
(No longer hardcode title, new naming for coordinate params, add objective markers, update doc)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{| class="mw-collapsible {{#if:{{{collapsed|}}}|mw-collapsed}} navbox map-overview"
+
<includeonly>{| style="width:75%;" class="collapsible {{#if:{{{collapsed|}}}|collapsed}} navbox map-locations"
 
{{!}}-
 
{{!}}-
! style="background:#F3A957;font-size:1.2em;"{{!}}{{{title}}}
+
! style="background:#F3A957;font-size:1.2em;"{{!}}{{#if:{{{title|}}}|{{{title}}}|{{#ifexist:{{SUBPAGENAME}}|{{SUBPAGENAME}} - {{common string|map locations areas}}|Example title}}}}
 
|-
 
|-
 
|
 
|
 
<div class="{{#switch:{{{placement}}}|left=floatleft|right=floatright|floatleft}}">
 
<div class="{{#switch:{{{placement}}}|left=floatleft|right=floatright|floatleft}}">
 
<div class="container"><!--
 
<div class="container"><!--
-->[[Image:{{{image}}}|800px|link=]]
+
--><div class="mw-indicator"><!--
{{#if:{{{area1|}}}|<div class="marker" style="left: {{{x1}}}; top: {{{y1}}};"><div>1</div><div class="label">{{{area1}}}</div></div>|}}{{#if:{{{area2|}}}|<div class="marker" style="left: {{{x2}}}; top: {{{y2}}};"><div>2</div><div class="label">{{{area2}}}</div></div>|}}{{#if:{{{area3|}}}|<div class="marker" style="left: {{{x3}}}; top: {{{y3}}};"><div>3</div><div class="label">{{{area3}}}</div></div>|}}{{#if:{{{area4|}}}|<div class="marker" style="left: {{{x4}}}; top: {{{y4}}};"><div>4</div><div class="label">{{{area4}}}</div></div>|}}{{#if:{{{area5|}}}|<div class="marker" style="left: {{{x5}}}; top: {{{y5}}};"><div>5</div><div class="label">{{{area5}}}</div></div>|}}{{#if:{{{area6|}}}|<div class="marker" style="left: {{{x6}}}; top: {{{y6}}};"><div>6</div><div class="label">{{{area6}}}</div></div>|}}{{#if:{{{area7|}}}|<div class="marker" style="left: {{{x7}}}; top: {{{y7}}};"><div>7</div><div class="label">{{{area7}}}</div></div>|}}{{#if:{{{area8|}}}|<div class="marker" style="left: {{{x8}}}; top: {{{y8}}};"><div>8</div><div class="label">{{{area8}}}</div></div>|}}{{#if:{{{area9|}}}|<div class="marker" style="left: {{{x9}}}; top: {{{y9}}};"><div>9</div><div class="label">{{{area9}}}</div></div>|}}{{#if:{{{area10|}}}|<div class="marker" style="left: {{{x10}}}; top: {{{y10}}};"><div>10</div><div class="label">{{{area10}}}</div></div>|}}{{#if:{{{area11|}}}|<div class="marker" style="left: {{{x11}}}; top: {{{y11}}};"><div>11</div><div class="label">{{{area11}}}</div></div>|}}{{#if:{{{area12|}}}|<div class="marker" style="left: {{{x12}}}; top: {{{y12}}};"><div>12</div><div class="label">{{{area12}}}</div></div>|}}{{#if:{{{area13|}}}|<div class="marker" style="left: {{{x13}}}; top: {{{y13}}};"><div>13</div><div class="label">{{{area13}}}</div></div>|}}{{#if:{{{area14|}}}|<div class="marker" style="left: {{{x14}}}; top: {{{y14}}};"><div>14</div><div class="label">{{{area14}}}</div></div>|}}{{#if:{{{area15|}}}|<div class="marker" style="left: {{{x15}}}; top: {{{y15}}};"><div>15</div><div class="label">{{{area15}}}</div></div>|}}{{#if:{{{area16|}}}|<div class="marker" style="left: {{{x16}}}; top: {{{y16}}};"><div>16</div><div class="label">{{{area16}}}</div></div>|}}{{#if:{{{area17|}}}|<div class="marker" style="left: {{{x17}}}; top: {{{y17}}};"><div>17</div><div class="label">{{{area17}}}</div></div>|}}{{#if:{{{area18|}}}|<div class="marker" style="left: {{{x18}}}; top: {{{y18}}};"><div>18</div><div class="label">{{{area18}}}</div></div>|}}{{#if:{{{area19|}}}|<div class="marker" style="left: {{{x19}}}; top: {{{y19}}};"><div>19</div><div class="label">{{{area19}}}</div></div>|}}{{#if:{{{area20|}}}|<div class="marker" style="left: {{{x20}}}; top: {{{y20}}};"><div>20</div><div class="label">{{{area20}}}</div></div>|}}
+
--><div class="label"><!--
 +
-->{{common string|map locations notice}}
 +
</div></div><!--
 +
-->[[File:{{#if:{{{image|}}}|{{{image}}}|{{#if:{{SUBPAGENAME}} overview|{{#ifexist:{{SUBPAGENAME}}|{{SUBPAGENAME}}|Pier}}|}}}} {{#if:{{{image|}}}||overview.png}}|800px|link=]]
 +
{{#if:{{{area1|}}}|<div class="marker" style="left: {{{area-left1}}}; top: {{{area-top1}}};"><div>1</div><div class="label">{{{area1}}}</div></div>|}}{{#if:{{{area2|}}}|<div class="marker" style="left: {{{area-left2}}}; top: {{{area-top2}}};"><div>2</div><div class="label">{{{area2}}}</div></div>|}}{{#if:{{{area3|}}}|<div class="marker" style="left: {{{area-left3}}}; top: {{{area-top3}}};"><div>3</div><div class="label">{{{area3}}}</div></div>|}}{{#if:{{{area4|}}}|<div class="marker" style="left: {{{area-left4}}}; top: {{{area-top4}}};"><div>4</div><div class="label">{{{area4}}}</div></div>|}}{{#if:{{{area5|}}}|<div class="marker" style="left: {{{area-left5}}}; top: {{{area-top5}}};"><div>5</div><div class="label">{{{area5}}}</div></div>|}}{{#if:{{{area6|}}}|<div class="marker" style="left: {{{area-left6}}}; top: {{{area-top6}}};"><div>6</div><div class="label">{{{area6}}}</div></div>|}}{{#if:{{{area7|}}}|<div class="marker" style="left: {{{area-left7}}}; top: {{{area-top7}}};"><div>7</div><div class="label">{{{area7}}}</div></div>|}}{{#if:{{{area8|}}}|<div class="marker" style="left: {{{area-left8}}}; top: {{{area-top8}}};"><div>8</div><div class="label">{{{area8}}}</div></div>|}}{{#if:{{{area9|}}}|<div class="marker" style="left: {{{area-left9}}}; top: {{{area-top9}}};"><div>9</div><div class="label">{{{area9}}}</div></div>|}}{{#if:{{{area10|}}}|<div class="marker" style="left: {{{area-left10}}}; top: {{{area-top10}}};"><div>10</div><div class="label">{{{area10}}}</div></div>|}}{{#if:{{{area11|}}}|<div class="marker" style="left: {{{area-left11}}}; top: {{{area-top11}}};"><div>11</div><div class="label">{{{area11}}}</div></div>|}}{{#if:{{{area12|}}}|<div class="marker" style="left: {{{area-left12}}}; top: {{{area-top12}}};"><div>12</div><div class="label">{{{area12}}}</div></div>|}}{{#if:{{{area13|}}}|<div class="marker" style="left: {{{area-left13}}}; top: {{{area-top13}}};"><div>13</div><div class="label">{{{area13}}}</div></div>|}}{{#if:{{{area14|}}}|<div class="marker" style="left: {{{area-left14}}}; top: {{{area-top14}}};"><div>14</div><div class="label">{{{area14}}}</div></div>|}}{{#if:{{{area15|}}}|<div class="marker" style="left: {{{area-left15}}}; top: {{{area-top15}}};"><div>15</div><div class="label">{{{area15}}}</div></div>|}}{{#if:{{{area16|}}}|<div class="marker" style="left: {{{area-left16}}}; top: {{{area-top16}}};"><div>16</div><div class="label">{{{area16}}}</div></div>|}}{{#if:{{{area17|}}}|<div class="marker" style="left: {{{area-left17}}}; top: {{{area-top17}}};"><div>17</div><div class="label">{{{area17}}}</div></div>|}}{{#if:{{{area18|}}}|<div class="marker" style="left: {{{area-left18}}}; top: {{{area-top18}}};"><div>18</div><div class="label">{{{area18}}}</div></div>|}}{{#if:{{{area19|}}}|<div class="marker" style="left: {{{area-left19}}}; top: {{{area-top19}}};"><div>19</div><div class="label">{{{area19}}}</div></div>|}}{{#if:{{{area20|}}}|<div class="marker" style="left: {{{area-left20}}}; top: {{{area-top20}}};"><div>20</div><div class="label">{{{area20}}}</div></div>|}}
  
{{#if:{{{spawn1|}}}|<div class="marker {{#switch:{{{spawn-color1}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{xA}}}; top: {{{yA}}};"><div>A</div><div class="label">{{{spawn1}}}</div></div>|}}
+
{{#if:{{{spawn1|}}}|<div class="marker {{#switch:{{{spawn-color1}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{spawn-left1}}}; top: {{{spawn-top1}}};"><div>A</div><div class="label">{{{spawn1}}}</div></div>|}}<!--
{{#if:{{{spawn2|}}}|<div class="marker {{#switch:{{{spawn-color2}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{xB}}}; top: {{{yB}}};"><div>B</div><div class="label">{{{spawn2}}}
+
-->{{#if:{{{spawn2|}}}|<div class="marker {{#switch:{{{spawn-color2}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{spawn-left2}}}; top: {{{spawn-top2}}};"><div>B</div><div class="label">{{{spawn2}}}</div></div>|}}<!--
</div></div>|}}
+
-->{{#if:{{{spawn3|}}}|<div class="marker {{#switch:{{{spawn-color3}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{spawn-left3}}}; top: {{{spawn-top3}}};"><div>C</div><div class="label">{{{spawn3}}}</div></div>|}}<!--
{{#if:{{{spawn3|}}}|<div class="marker {{#switch:{{{spawn-color3}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{xC}}}; top: {{{yC}}};"><div>C</div><div class="label">{{{spawn3}}}</div></div>|}}
+
-->{{#if:{{{spawn4|}}}|<div class="marker {{#switch:{{{spawn-color4}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{spawn-left4}}}; top: {{{spawn-top4}}};"><div>D</div><div class="label">{{{spawn4}}}</div></div>|}}<!--
{{#if:{{{spawn4|}}}|<div class="marker {{#switch:{{{spawn-color4}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{xD}}}; top: {{{yD}}};"><div>D</div><div class="label">{{{spawn4}}}</div></div>|}}
+
-->{{#if:{{{spawn5|}}}|<div class="marker {{#switch:{{{spawn-color5}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{spawn-left5}}}; top: {{{spawn-top5}}};"><div>E</div><div class="label">{{{spawn5}}}</div></div>|}}<!--
{{#if:{{{spawn5|}}}|<div class="marker {{#switch:{{{spawn-color5}}}|red=spawn-color red|blu=spawn-color blu|mix=spawn-color mix|spawn-color red}}" style="left: {{{xE}}}; top: {{{yE}}};"><div>E</div><div class="label">{{{spawn5}}}</div></div>|}}
+
-->{{#if:{{{objective1|}}}|<div class="marker {{#switch:{{{objective-color1}}}|red=obj-color red|blu=obj-color blu|neutral=obj-color neutral|obj-color red}}" style="left: {{{objective-left1}}}; top: {{{objective-top1}}};"><div class="label">{{{objective1}}}</div></div>|}}<!--
 +
-->{{#if:{{{objective2|}}}|<div class="marker {{#switch:{{{objective-color2}}}|red=obj-color red|blu=obj-color blu|neutral=obj-color neutral|obj-color red}}" style="left: {{{objective-left2}}}; top: {{{objective-top2}}};"><div class="label">{{{objective2}}}</div></div>|}}<!--
 +
-->{{#if:{{{objective3|}}}|<div class="marker {{#switch:{{{objective-color3}}}|red=obj-color red|blu=obj-color blu|neutral=obj-color neutral|obj-color red}}" style="left: {{{objective-left3}}}; top: {{{objective-top3}}};"><div class="label">{{{objective3}}}</div></div>|}}<!--
 +
-->{{#if:{{{objective4|}}}|<div class="marker {{#switch:{{{objective-color4}}}|red=obj-color red|blu=obj-color blu|neutral=obj-color neutral|obj-color red}}" style="left: {{{objective-left4}}}; top: {{{objective-top4}}};"><div class="label">{{{objective4}}}</div></div>|}}<!--
 +
-->{{#if:{{{objective5|}}}|<div class="marker {{#switch:{{{objective-color5}}}|red=obj-color red|blu=obj-color blu|neutral=obj-color neutral|obj-color red}}" style="left: {{{objective-left5}}}; top: {{{objective-top5}}};"><div class="label">{{{objective5}}}</div></div>|}}<!--
 +
-->{{#if:{{{objective6|}}}|<div class="marker {{#switch:{{{objective-color6}}}|red=obj-color red|blu=obj-color blu|neutral=obj-color neutral|obj-color red}}" style="left: {{{objective-left6}}}; top: {{{objective-top6}}};"><div class="label">{{{objective6}}}</div></div>|}}
 
</div>
 
</div>
 
</div>
 
</div>
Line 21: Line 30:
 
{{#if:{{{area1|}}}|
 
{{#if:{{{area1|}}}|
 
<div><!--
 
<div><!--
--><div style="margin-bottom:.5em;">[[File:Marker circle.png|25px|link=]]<span style="padding:0 10px;font-weight:600;"><!--
+
--><div style="display:inline-block;min-width:10em;margin-bottom:.5em;">[[File:Map marker locations icon.png|25px|link=]]<span style="padding:0 10px;font-weight:600;"><!--
-->{{lang
+
-->{{common string|map locations areas}}
| en = Locations
 
| da = Steder
 
}}  
 
 
</span></div>
 
</span></div>
 
<div class="scroll-list">
 
<div class="scroll-list">
Line 54: Line 60:
 
{{#if:{{{spawn1|}}}|
 
{{#if:{{{spawn1|}}}|
 
<div style="margin-top:20px;"><!--
 
<div style="margin-top:20px;"><!--
--><div style="margin-bottom:.5em;">[[File:Marker mix.png|25px|link=]]<span style="padding:0 10px;font-weight:600;"><!--
+
--><div style="display:inline-block;margin-bottom:.5em;">[[File:Map marker spawn icon.png|25px|link=]]<span style="padding:0 10px;font-weight:600;"><!--
-->{{lang
+
-->{{common string|map locations spawns}}
| en = Spawns
 
| da = Baser
 
}}
 
 
</span></div>
 
</span></div>
 
<div class="list">
 
<div class="list">
Line 75: Line 78:
  
 
</includeonly><noinclude>
 
</includeonly><noinclude>
== Usage ==
+
__NOTOC__
This template allows you to add markers to an image. When hovering over the marker, the name of the area will appear.
+
{{doc begin}}
 +
== Description ==
 +
This template allows you to add markers to an image. When hovering over the marker, the name of the area will appear, accompanied by a scrollable list with each location.
 +
: In order to avoid cluttering articles, '''ALWAYS''' create the template as a subpage of the map locations template and then include the template into the source article of the respective map under the proper section, which would be at the bottom of the "Locations" section.
 +
:: For instance: [[Pier#Locations]]
 +
:If you are new to using templates, see Wikipedia's ''[[w:Help:A_quick_guide_to_templates|A quick guide to templates]]''.
 +
: The map example used here is the map [[Pier]]. The naming convention would then be: '''Template:Map locations/Pier'''.
 +
: Some map titles like [[Brimstone (map)]] will contain '''(map)''' and so will the file name of the map overview image. However, as this template is meant solely for maps it is unnecessary to name it as such and should be avoided.
 +
:: '''Important:''' Map overview images with titles that contain '''(map)''' must be overridden using the <code>image</code> parameter. Remember to type in the full file name, like so: <code>image = Brimstone (map) overview.png</code>
 +
 
 +
 
 +
=== Parameters ===
 +
; ''title''
 +
: Optional. Title of the box. Will automatically fetch the title of the subpage. Can be used to overide the title.
 +
; ''collapsed''
 +
: Optional. Collapses the box on load. Off by default. Use <code>collapsed = yes</code> to collapse the box.
 +
; ''image''
 +
: Optional. File name of the image to be used as the base for the map location template. The image will be fetched automatically and resized to a width of 800 pixels. Can be used to override the image.
 +
; ''placement''
 +
: Optional. The placement of the image. Has 2 values: <code>left</code> and <code>right</code>. The image will be placed to the left by default. Please only use this to invert the image placement if there is more than one map locations template present.
 +
 
 +
 
 +
You can add up to 20 locations on the map. Every location is controlled by three main attributes. Each location will then automatically be added to a bulleted list in numeric order.
 +
; area''1''
 +
: Required. Contains the name of a given area/location. Adds the respective number to the marker automatically.
 +
:: <code>area-left''1''</code> and <code>area-top''1''</code> - X and Y coordinates of the [[:File:Map marker locations icon.png|map marker]]. The number is to be replaced with a number from the range (1-20).
 +
 
 +
 
 +
You can add up to 5 spawn points on the map. Every spawn point is controlled by three main attributes. Each spawn point will then automatically be added to a bulleted list in alphabetical order.
 +
; spawn''1''
 +
: Optional. Contains the name of a given spawn point. Adds the respective letter to the marker automatically.
 +
:: <code>spawn-left''1''</code> and <code>spawn-top''1''</code> - X and Y coordinates of the [[:File:Map marker spawn icon.png|spawn point marker]]. The number is to be replaced with a number from the range (1-5).
 +
; spawn-color''1''
 +
: Required if ''spawn'' is set. The marker color value of the given spawn point. There are 3 marker color values: <code>red</code> (default), <code>blu</code> and <code>mix</code>. The marker color value <code>mix</code> are only to be used to indicate shared spawn rooms, as in the case with some maps.
  
This template's parameters are:
 
* <code>title</code> - Title of the box.
 
* <code>collapsed</code> - Collapses the box on load. Off by default. Use <code>collapsed = yes</code> to collapse the box.
 
* <code>image</code> - Filename of the image to be used as the base for the map location template. The image will be automatically resized to be 800 pixels wide.
 
* <code>placement</code> - The placement of the image. Has 2 values: <code>left</code> and <code>right</code>. The image will be placed to the left by default.
 
* You can add up to 20 locations on the map. Every location is controlled by three main attributes. The locations will then automatically be added to a bulleted list in numeric order.
 
** <code>area''1''</code> - Name of a given area/location. Adds the respective number to the marker.
 
*** <code>x''1''</code> and <code>y''1''</code> - X and Y coordinates of the [[:File:Map marker circle.png|map marker]]. The number is to be replaced with a number from the range (1-20).
 
* You can add up to 5 spawn points on the map. Every spawn point is controlled by three main attributes. The spawn points will then automatically be added to a bulleted list in alphabetical order.
 
** <code>spawn''1''</code> - Name of a given spawn point. Adds the respective letter to the marker.
 
*** <code>x''A''</code> and <code>y''A''</code> - X and Y coordinates of the [[:File:Map marker red.png|spawn point marker]]. The secondary letter is to be replaced with a letter from the range (A-E), and that letter ''must'' be capitalized.
 
***<code>spawn-color''1'' = <value></code> - The marker color value of the given spawn point. There are 3 marker color values: <code>red</code> (default), <code>blu</code>, <code>mix</code>. The marker color value <code>mix</code> are only to be used to indicate shared spawn rooms, as in the case with [[Payload]] maps.
 
  
* The best way to get the coordinates is to copy a 800px wide version of the image you will be using, then copying the map marker file, adjusting them in the appropiate places, then getting the coordinates of the '''upper left corner''' of the marker.
+
You can add up to 6 objectives on the map. Every objective is controlled by three main attributes. Unlike the other markers, the objective markers will not be listed and won't contain any number or letter.
 +
;objective''1''
 +
:Optional. Contains the name of a given objective. This can be used to mark any objective or point of interest, such as [[Capture the Flag#Intelligence|flags]], [[Control point (objective)|Control Points]], or [[Payload]] checkpoints.
 +
:: <code>objective-left''1''</code> and <code>objective-top''1''</code> - X and Y coordinates of the objective marker. The number is to be replaced with a number from the range (1-6).
 +
; objective-color''1''
 +
: Required if ''objective'' is set. The marker color value of the given objective. There are 3 marker color values: <code>red</code> (default), <code>blu</code> and <code>neutral</code>. The marker color value <code>neutral</code> are only to be used to indicate neutral Control Points or flags.
 +
 
 +
== Translation ==
 +
Translations for this template can be added under [[Template:Dictionary/common strings#map_locations_.28template.29]].
 +
 
 +
== Getting the coordinates ==
 +
To make the process as easy and simple as possible without the need of image editing software, it is highly recommended to use the built-in developer tools in various browsers, to ajust the marker placements with ease.
 +
* Once an area or spawn point has been defined with both its X and Y coordinates, the marker will be placed at the very bottom of the box, simply because it has not yet been given any coordinate values. You can ajust the coordinates  while editing by using the '''Show preview''' feature. Use the guide below accustomed to your browser.
 +
 
 +
==== For Google Chrome/Chromium & Firefox users ====
 +
* Right-click on the marker and select 'Inspect' (usually at the bottom). Once the inspector is open, select the parent element of the marker if not already selected. The element in question is: <code><nowiki><div class="marker" style="left: ; top: ;"></div></nowiki></code>
 +
* In the right side is a window divided into sections, with the first being <code>element.style</code> (or <code>element</code> in Firefox) which contains the coordinate values. In this guide, it is assumed that no values have been added, and to add them you must click on both <code>left</code> and <code>top</code> individually and press tab. Once done, simply add a value like <code>120px</code> and see if the marker changes position. It is important that you add <code>px</code> at the end of the value without a space, as it is used to define the unit type, which must be in pixels in this case. You can click on the value and use the up/down arrow keys to rapidly increase/decrease the pixel value. Once the marker is at a fitting position, copy the entire value and add it to the proper parameter.
 +
** '''Remember:''' <code>left</code> is for X coordinates, and <code>top</code> is for Y coordinates.
  
 
=== Example ===
 
=== Example ===
 
<pre>
 
<pre>
{{Map overview
+
{{User:Wookipan/Map overview
  | title = Pier - overview indicators
+
  | title = Pier - Locations
 
  | image = Pier overview.png
 
  | image = Pier overview.png
 
  |-
 
  |-
 
  | spawn1 = BLU first spawn
 
  | spawn1 = BLU first spawn
 
  | spawn-color1 = blu
 
  | spawn-color1 = blu
  | xA = 335px
+
  | spawn-left1 = 335px
  | yA = 150px
+
  | spawn-top1 = 150px
 +
|-
 
  | spawn2 = BLU second spawn
 
  | spawn2 = BLU second spawn
 
  | spawn-color2 = blu
 
  | spawn-color2 = blu
  | xB = 193px
+
  | spawn-left2 = 193px
  | yB = 230px
+
  | spawn-top2 = 230px
 +
|-
 
  | spawn3 = RED first spawn / BLU third spawn
 
  | spawn3 = RED first spawn / BLU third spawn
 
  | spawn-color3 = mix
 
  | spawn-color3 = mix
  | xC = 245px
+
  | spawn-left3 = 245px
  | yC = 400px
+
  | spawn-top3 = 400px
 +
|-
 
  | spawn4 = RED final spawn
 
  | spawn4 = RED final spawn
 
  | spawn-color4 = red
 
  | spawn-color4 = red
  | xD = 608px
+
  | spawn-left4 = 608px
  | yD = 512px
+
  | spawn-top4 = 512px
 +
|-
 +
| objective1 = Cart start
 +
| objective-color1 = blu
 +
| objective-left1 = 284px
 +
| objective-top1 = 148px
 +
|-
 +
| objective2 = Checkpoint A
 +
| objective-left2 = 210px
 +
| objective-top2 = 320px
 +
|-
 +
| objective3 = Checkpoint B
 +
| objective-left3 = 140px
 +
| objective-top3 = 440px
 +
|-
 +
| objective4 = Checkpoint C
 +
| objective-left4 = 337px
 +
| objective-top4 = 498px
 +
|-
 +
| objective5 = Checkpoint E
 +
| objective-left5 = 470px
 +
| objective-top5 = 416px
 +
|-
 +
| objective6 = Final point
 +
| objective-left6 = 620px
 +
| objective-top6 = 489px
 
  |-
 
  |-
 
  | area1 = Beach
 
  | area1 = Beach
  | x1 = 210px
+
  | area-left1 = 210px
  | y1 = 120px
+
  | area-top1 = 120px
 +
|-
 
  | area2 = Caves
 
  | area2 = Caves
  | x2 = 285px
+
  | area-left2 = 285px
  | y2 = 230px
+
  | area-top2 = 230px
 +
|-
 
  | area3 = Minivan parking space
 
  | area3 = Minivan parking space
  | x3 = 280px
+
  | area-left3 = 280px
  | y3 = 290px
+
  | area-top3 = 290px
 +
|-
 
  | area4 = Cliff
 
  | area4 = Cliff
  | x4 = 240px
+
  | area-left4 = 240px
  | y4 = 220px
+
  | area-top4 = 220px
 +
|-
 
  | area5 = Bridge
 
  | area5 = Bridge
  | x5 = 200px
+
  | area-left5 = 200px
  | y5 = 320px
+
  | area-top5 = 340px
 +
|-
 
  | area6 = Red carpet building
 
  | area6 = Red carpet building
  | x6 = 160px
+
  | area-left6 = 160px
  | y6 = 350px
+
  | area-top6 = 350px
 +
|-
 
  | area7 = Wine cellar
 
  | area7 = Wine cellar
  | x7 = 90px
+
  | area-left7 = 90px
  | y7 = 390px
+
  | area-top7 = 390px
 +
|-
 
  | area8 = Docks
 
  | area8 = Docks
  | x8 = 135px
+
  | area-left8 = 135px
  | y8 = 520px
+
  | area-top8 = 520px
 +
|-
 
  | area9 = Warehouse
 
  | area9 = Warehouse
  | x9 = 305px
+
  | area-left9 = 305px
  | y9 = 480px
+
  | area-top9 = 480px
 +
|-
 
  | area10 = Kitchen
 
  | area10 = Kitchen
  | x10 = 340px
+
  | area-left10 = 340px
  | y10 = 410px
+
  | area-top10 = 410px
 +
|-
 
  | area11 = Sandy beach
 
  | area11 = Sandy beach
  | x11 = 425px
+
  | area-left11 = 425px
  | y11 = 460px
+
  | area-top11 = 460px
 +
|-
 
  | area12 = Barn bridge
 
  | area12 = Barn bridge
  | x12 = 430px
+
  | area-left12 = 430px
  | y12 = 400px
+
  | area-top12 = 400px
 +
|-
 
  | area13 = Small barn
 
  | area13 = Small barn
  | x13 = 468px
+
  | area-left13 = 468px
  | y13 = 425px
+
  | area-top13 = 430px
 +
|-
 
  | area14 = Building adjacent to the barn
 
  | area14 = Building adjacent to the barn
  | x14 = 505px
+
  | area-left14 = 505px
  | y14 = 460px
+
  | area-top14 = 460px
 +
|-
 
  | area15 = Target range
 
  | area15 = Target range
  | x15 = 600px
+
  | area-left15 = 600px
  | y15 = 460px
+
  | area-top15 = 460px
 
}}
 
}}
 
</pre>
 
</pre>
Line 166: Line 249:
  
 
{{User:Wookipan/Map overview
 
{{User:Wookipan/Map overview
  | title = Pier - location indicators
+
  | title = Pier - Locations
 
  | image = Pier overview.png
 
  | image = Pier overview.png
 
  |-
 
  |-
 
  | spawn1 = BLU first spawn
 
  | spawn1 = BLU first spawn
 
  | spawn-color1 = blu
 
  | spawn-color1 = blu
  | xA = 335px
+
  | spawn-left1 = 335px
  | yA = 150px
+
  | spawn-top1 = 150px
 +
|-
 
  | spawn2 = BLU second spawn
 
  | spawn2 = BLU second spawn
 
  | spawn-color2 = blu
 
  | spawn-color2 = blu
  | xB = 193px
+
  | spawn-left2 = 193px
  | yB = 230px
+
  | spawn-top2 = 230px
 +
|-
 
  | spawn3 = RED first spawn / BLU third spawn
 
  | spawn3 = RED first spawn / BLU third spawn
 
  | spawn-color3 = mix
 
  | spawn-color3 = mix
  | xC = 245px
+
  | spawn-left3 = 245px
  | yC = 400px
+
  | spawn-top3 = 400px
 +
|-
 
  | spawn4 = RED final spawn
 
  | spawn4 = RED final spawn
 
  | spawn-color4 = red
 
  | spawn-color4 = red
  | xD = 608px
+
  | spawn-left4 = 608px
  | yD = 512px
+
  | spawn-top4 = 512px
 +
|-
 +
| objective1 = Cart start
 +
| objective-color1 = blu
 +
| objective-left1 = 284px
 +
| objective-top1 = 148px
 +
|-
 +
| objective2 = Checkpoint A
 +
| objective-left2 = 210px
 +
| objective-top2 = 320px
 +
|-
 +
| objective3 = Checkpoint B
 +
| objective-left3 = 140px
 +
| objective-top3 = 440px
 +
|-
 +
| objective4 = Checkpoint C
 +
| objective-left4 = 337px
 +
| objective-top4 = 498px
 +
|-
 +
| objective5 = Checkpoint E
 +
| objective-left5 = 470px
 +
| objective-top5 = 416px
 +
|-
 +
| objective6 = Final point
 +
| objective-left6 = 620px
 +
| objective-top6 = 489px
 
  |-
 
  |-
 
  | area1 = Beach
 
  | area1 = Beach
  | x1 = 210px
+
  | area-left1 = 210px
  | y1 = 120px
+
  | area-top1 = 120px
 +
|-
 
  | area2 = Caves
 
  | area2 = Caves
  | x2 = 285px
+
  | area-left2 = 285px
  | y2 = 230px
+
  | area-top2 = 230px
 +
|-
 
  | area3 = Minivan parking space
 
  | area3 = Minivan parking space
  | x3 = 280px
+
  | area-left3 = 280px
  | y3 = 290px
+
  | area-top3 = 290px
 +
|-
 
  | area4 = Cliff
 
  | area4 = Cliff
  | x4 = 240px
+
  | area-left4 = 240px
  | y4 = 220px
+
  | area-top4 = 220px
 +
|-
 
  | area5 = Bridge
 
  | area5 = Bridge
  | x5 = 200px
+
  | area-left5 = 200px
  | y5 = 320px
+
  | area-top5 = 340px
 +
|-
 
  | area6 = Red carpet building
 
  | area6 = Red carpet building
  | x6 = 160px
+
  | area-left6 = 160px
  | y6 = 350px
+
  | area-top6 = 350px
 +
|-
 
  | area7 = Wine cellar
 
  | area7 = Wine cellar
  | x7 = 90px
+
  | area-left7 = 90px
  | y7 = 390px
+
  | area-top7 = 390px
 +
|-
 
  | area8 = Docks
 
  | area8 = Docks
  | x8 = 135px
+
  | area-left8 = 135px
  | y8 = 520px
+
  | area-top8 = 520px
 +
|-
 
  | area9 = Warehouse
 
  | area9 = Warehouse
  | x9 = 305px
+
  | area-left9 = 305px
  | y9 = 480px
+
  | area-top9 = 480px
 +
|-
 
  | area10 = Kitchen
 
  | area10 = Kitchen
  | x10 = 340px
+
  | area-left10 = 340px
  | y10 = 410px
+
  | area-top10 = 410px
 +
|-
 
  | area11 = Sandy beach
 
  | area11 = Sandy beach
  | x11 = 425px
+
  | area-left11 = 425px
  | y11 = 460px
+
  | area-top11 = 460px
 +
|-
 
  | area12 = Barn bridge
 
  | area12 = Barn bridge
  | x12 = 430px
+
  | area-left12 = 430px
  | y12 = 400px
+
  | area-top12 = 400px
 +
|-
 
  | area13 = Small barn
 
  | area13 = Small barn
  | x13 = 468px
+
  | area-left13 = 468px
  | y13 = 425px
+
  | area-top13 = 430px
 +
|-
 
  | area14 = Building adjacent to the barn
 
  | area14 = Building adjacent to the barn
  | x14 = 505px
+
  | area-left14 = 505px
  | y14 = 460px
+
  | area-top14 = 460px
 +
|-
 
  | area15 = Target range
 
  | area15 = Target range
  | x15 = 600px
+
  | area-left15 = 600px
  | y15 = 460px
+
  | area-top15 = 460px
 
}}
 
}}

Latest revision as of 21:52, 30 January 2022


Documentation for Wookipan/Map overview

Description

This template allows you to add markers to an image. When hovering over the marker, the name of the area will appear, accompanied by a scrollable list with each location.

In order to avoid cluttering articles, ALWAYS create the template as a subpage of the map locations template and then include the template into the source article of the respective map under the proper section, which would be at the bottom of the "Locations" section.
For instance: Pier#Locations
If you are new to using templates, see Wikipedia's A quick guide to templates.
The map example used here is the map Pier. The naming convention would then be: Template:Map locations/Pier.
Some map titles like Brimstone (map) will contain (map) and so will the file name of the map overview image. However, as this template is meant solely for maps it is unnecessary to name it as such and should be avoided.
Important: Map overview images with titles that contain (map) must be overridden using the image parameter. Remember to type in the full file name, like so: image = Brimstone (map) overview.png


Parameters

title
Optional. Title of the box. Will automatically fetch the title of the subpage. Can be used to overide the title.
collapsed
Optional. Collapses the box on load. Off by default. Use collapsed = yes to collapse the box.
image
Optional. File name of the image to be used as the base for the map location template. The image will be fetched automatically and resized to a width of 800 pixels. Can be used to override the image.
placement
Optional. The placement of the image. Has 2 values: left and right. The image will be placed to the left by default. Please only use this to invert the image placement if there is more than one map locations template present.


You can add up to 20 locations on the map. Every location is controlled by three main attributes. Each location will then automatically be added to a bulleted list in numeric order.

area1
Required. Contains the name of a given area/location. Adds the respective number to the marker automatically.
area-left1 and area-top1 - X and Y coordinates of the map marker. The number is to be replaced with a number from the range (1-20).


You can add up to 5 spawn points on the map. Every spawn point is controlled by three main attributes. Each spawn point will then automatically be added to a bulleted list in alphabetical order.

spawn1
Optional. Contains the name of a given spawn point. Adds the respective letter to the marker automatically.
spawn-left1 and spawn-top1 - X and Y coordinates of the spawn point marker. The number is to be replaced with a number from the range (1-5).
spawn-color1
Required if spawn is set. The marker color value of the given spawn point. There are 3 marker color values: red (default), blu and mix. The marker color value mix are only to be used to indicate shared spawn rooms, as in the case with some maps.


You can add up to 6 objectives on the map. Every objective is controlled by three main attributes. Unlike the other markers, the objective markers will not be listed and won't contain any number or letter.

objective1
Optional. Contains the name of a given objective. This can be used to mark any objective or point of interest, such as flags, Control Points, or Payload checkpoints.
objective-left1 and objective-top1 - X and Y coordinates of the objective marker. The number is to be replaced with a number from the range (1-6).
objective-color1
Required if objective is set. The marker color value of the given objective. There are 3 marker color values: red (default), blu and neutral. The marker color value neutral are only to be used to indicate neutral Control Points or flags.

Translation

Translations for this template can be added under Template:Dictionary/common strings#map_locations_.28template.29.

Getting the coordinates

To make the process as easy and simple as possible without the need of image editing software, it is highly recommended to use the built-in developer tools in various browsers, to ajust the marker placements with ease.

  • Once an area or spawn point has been defined with both its X and Y coordinates, the marker will be placed at the very bottom of the box, simply because it has not yet been given any coordinate values. You can ajust the coordinates while editing by using the Show preview feature. Use the guide below accustomed to your browser.

For Google Chrome/Chromium & Firefox users

  • Right-click on the marker and select 'Inspect' (usually at the bottom). Once the inspector is open, select the parent element of the marker if not already selected. The element in question is: <div class="marker" style="left: ; top: ;"></div>
  • In the right side is a window divided into sections, with the first being element.style (or element in Firefox) which contains the coordinate values. In this guide, it is assumed that no values have been added, and to add them you must click on both left and top individually and press tab. Once done, simply add a value like 120px and see if the marker changes position. It is important that you add px at the end of the value without a space, as it is used to define the unit type, which must be in pixels in this case. You can click on the value and use the up/down arrow keys to rapidly increase/decrease the pixel value. Once the marker is at a fitting position, copy the entire value and add it to the proper parameter.
    • Remember: left is for X coordinates, and top is for Y coordinates.

Example

{{User:Wookipan/Map overview
 | title = Pier - Locations
 | image = Pier overview.png
 |-
 | spawn1 = BLU first spawn
 | spawn-color1 = blu
 | spawn-left1 = 335px
 | spawn-top1 = 150px
 |-
 | spawn2 = BLU second spawn
 | spawn-color2 = blu
 | spawn-left2 = 193px
 | spawn-top2 = 230px
 |-
 | spawn3 = RED first spawn / BLU third spawn
 | spawn-color3 = mix
 | spawn-left3 = 245px
 | spawn-top3 = 400px
 |-
 | spawn4 = RED final spawn
 | spawn-color4 = red
 | spawn-left4 = 608px
 | spawn-top4 = 512px
 |-
 | objective1 = Cart start
 | objective-color1 = blu
 | objective-left1 = 284px
 | objective-top1 = 148px
 |-
 | objective2 = Checkpoint A
 | objective-left2 = 210px
 | objective-top2 = 320px
 |-
 | objective3 = Checkpoint B
 | objective-left3 = 140px
 | objective-top3 = 440px
 |-
 | objective4 = Checkpoint C
 | objective-left4 = 337px
 | objective-top4 = 498px
 |-
 | objective5 = Checkpoint E
 | objective-left5 = 470px
 | objective-top5 = 416px
 |-
 | objective6 = Final point
 | objective-left6 = 620px
 | objective-top6 = 489px
 |-
 | area1 = Beach
 | area-left1 = 210px
 | area-top1 = 120px
 |-
 | area2 = Caves
 | area-left2 = 285px
 | area-top2 = 230px
 |-
 | area3 = Minivan parking space
 | area-left3 = 280px
 | area-top3 = 290px
 |-
 | area4 = Cliff
 | area-left4 = 240px
 | area-top4 = 220px
 |-
 | area5 = Bridge
 | area-left5 = 200px
 | area-top5 = 340px
 |-
 | area6 = Red carpet building
 | area-left6 = 160px
 | area-top6 = 350px
 |-
 | area7 = Wine cellar
 | area-left7 = 90px
 | area-top7 = 390px
 |-
 | area8 = Docks
 | area-left8 = 135px
 | area-top8 = 520px
 |-
 | area9 = Warehouse
 | area-left9 = 305px
 | area-top9 = 480px
 |-
 | area10 = Kitchen
 | area-left10 = 340px
 | area-top10 = 410px
 |-
 | area11 = Sandy beach
 | area-left11 = 425px
 | area-top11 = 460px
 |-
 | area12 = Barn bridge
 | area-left12 = 430px
 | area-top12 = 400px
 |-
 | area13 = Small barn
 | area-left13 = 468px
 | area-top13 = 430px
 |-
 | area14 = Building adjacent to the barn
 | area-left14 = 505px
 | area-top14 = 460px
 |-
 | area15 = Target range
 | area-left15 = 600px
 | area-top15 = 460px
}}

will yield