Template talk:Flotilla tracker

From YPPedia

Current Flotilla Position Template

So, I had this wild idea to include the current positions of flotillas on the BK's individual pages. I figured that it's not something that changes so often it would be a hassle to keep it up. If anyone disagrees with me on that, feel free to speak up. I designed the template to be easy when a change is needed. It simply runs on 3 functions: (ocean)island, (ocean)distance, and (ocean)direction.

(ocean) is obviously the name of the ocean. One set of parameters for each of the 5 production oceans. Since opal has no pictures yet for its islands, it wouldn't work with my template and would leave empty spots so I'll have to add it in when it's islands get pictures. And I haven't included Ice yet. Not sure if it would be considered important.

Anyhoo, in addition to ocean which prefixes every parameter, there are the 3 parameters of the template:
(ocean)island - Self explanatory, name of the island that the BK is closest to.
(ocean)distance - Number of league points the flotilla is from the aforementioned closest island.
(ocean)direction - Is the cardinal direction one would travel away from the island to get to the flotilla.

For example, I used Vargas' page to test the template and it can be seen in action here.

By imputing- |midnightisland=Oyster Island|midnightdistance=1|midnightdirection=south east I arrive at what you see in the finished product on the page. The ocean at the top, a picture of the closest island, and below that the statement: "Currently 1 league point(s) south east from Oyster Island" which gives the reader the exact location of the flotilla with only 3 parameters to enter when it changes. Looks like this:


Cerulean Emerald Meridian Obsidian





This Brigand King does not currently have a flotilla on Cerulean. It might be busy blockading or in hiding. This Brigand King does not currently have a flotilla on Emerald. It might be busy blockading or in hiding. This Brigand King does not currently have a flotilla on Meridian. It might be busy blockading or in hiding. This Brigand King does not currently have a flotilla on Obsidian. It might be busy blockading or in hiding.
Edit flotilla locations


My original idea instead of the picture of the island was to include this:


as it would better reflect the location but my template editing skills are not to the point where I was able to shrink down that image being as it wasn't actually an image but a generated set of visual parameters. Someone smarter than me might be able to and then I think that would serve better than the picture of the island?

Thoughts? Comments? Feel this is pointless on the wiki? Personally, I'm just happy I was able to code something that complex myself. I am getting moderately better at this. --Muffynz 00:59, 28 July 2007 (PDT)

Not sure if it is physically possible to bump things on the wiki but nonetheless, *bump* --Muffynz 22:24, 5 August 2007 (PDT)
I like the idea. A couple of comments; I'm not sure what, but something needs to happen when they aren't on an ocean, rather then the template error appearing. If no info entered about an ocean an image of the ocean without an island and a comment about not currently having a flotilla on that ocean. -- Cedarwings (t/c) 23:02, 5 August 2007 (PDT)
There we go, I did a little tinkering with the {{ifdef}} (Usage) template. I'll write up some instructions tomorrow. See Vargas the Mad for an updated version of it.--Muffynz 00:31, 6 August 2007 (PDT)
Not sure about the image but yes that works. The only other comment I had was about whether we should be including Opal in this as well. -- Cedarwings (t/c) 08:51, 6 August 2007 (PDT)
I had another thought, what about adding something for when a BK has control of an island. Maybe it will show an image of that island too. -- Cedarwings (t/c) 21:58, 15 August 2007 (PDT)
Oh now you're just making things difficult. Hmmm...let me think. That would require another {{ifdef}} (Usage) coding but I don't think it's impossible. I'll sleep on it. Because I am completely uninformed, is there ever a time when a BK just period does not show up anywhere? Not on a flotilla, planning, a blockade, or in ownership of an island? --Muffynz 23:16, 15 August 2007 (PDT)

template structure

I hate to say this, but this template is kind of a mess. Take a look at the current usage on the Admiral Finius page.

{{Flotilla tracker
|cobaltno=no
|hunteryes=yes|hunterisland=Immokalee Island|hunterdistance=3|hunterdirection=south-west
|midnightno=no
|sageno=no
|viridianyes=yes|viridianisland=Olin's Brow|viridiandistance=1|viridiandirection=east
}}

There are several problems here, including the existence of both a "<ocean>no" and "<ocean>yes" field for every ocean. The template should have a single field of "<ocean>" with a value of "yes" or "no". The template further compounds the problem by smooshing together multiple words to name the fields. I'd really like to see this cleaned up. Thanks! --Barrister 23:15, 4 October 2007 (PDT)

Here we go, I made a couple adjustments to the template. This is the same page re-done to match the changes:
{{Flotilla tracker
|cobalt=no
|hunter=yes|hunter island=Immokalee Island|hunter distance=3|hunter direction=south-west
|midnight=no
|sage=no
|viridian=yes|viridian island=Olin's Brow|viridian distance=1|viridian direction=east
}}
The ocean is now a single value, either yes or no. Also, to make things a tad easier, I went ahead and created the {{ifndef}} (Usage) template. Basically, it's the opposite of the {{ifdef}} (Usage) template. If the value {{{(ocean name) island}}} is not filled in, it automatically defaults to the stock picture of the league point and the note about the king not currently having a flotilla on the ocean. That way, if someone messes up editing the template it's easier for them to notice and even if they can't for some reason figure out how to fix it, the page looks aesthetically competent until someone comes along and corrects it. Is this more what you were looking for Barrister? -- Muffynz(t/c) 19:40, 7 October 2007 (PDT)
Aye, that's exactly what I was looking for. Thanks for cleaning it up so quickly. --Barrister 01:48, 8 October 2007 (PDT)

Rewrite

I want to re-write this template using #ifeq functions in place of the ifdef templates, so that the display of the text is entirely reliant on the state of the ocean's yes/no parameter, and not on whether the ocean's island parameter is defined or not. This would allow us to leave the parameters there in the page code when not in use, so we wouldn't have to redo them every time we change a "no" to a "yes". It'd also let us do away with the ocean yes/no sub-templates. This template has been here and in use for quite a while, so I thought I should post here before I start mucking around. Any objections or other thoughts? --Belthazar451 03:12, 7 May 2011 (UTC)