Forum:Add spell costs to Template:Infobox spell

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search
Forums: Yew Grove > Add spell costs to Template:Infobox spell
This page or section is an archive.
Please do not edit the contents of this page.
This thread was archived on 14 March 2011 by Cook Me Plox.

Quite frankly, I'm tired of seeing this at the bottom of every spell page:

Fire Surge costs 2972 coins for each cast. If using an air staff, the price is reduced to 2377 coins per cast. If using a fire staff, the price is reduced to 1532 coins per cast.

I don't know about you guys, but to me, the above looks clunky and odd; it simultaneously manages to present too much information and doesn't present enough. For example, the cost if using smoke runes is not accounted for, but adding it would give us four related figures in one paragraph of text, with no particular organization to the lot. And that's not the worst; what about Stun?

Stun costs 1788 coins per cast. If an earth staff or equivalent is used, it costs 1572 coins per cast. If a water staff or equivalent is used, it costs 1476 coins per cast. If a tome of frost and earth staff or equivalent, or a mud staff, is used, it costs 1260 coins per cast. If using mud runes, it costs 12012 coins per cast.

Yuck. Wouldn't a nice table be a better way to present all this information?

The aforelinked table is merely a prototype, a design idea. It doesn't have to look like that if people think it's intolerably ugly. However, as a test, I added it to a page, and there was way too much whitespace. I figured that it might be okay to add to the template that lists all the other spell information on the right (which would be this little number), and built a proof of concept here (though please note that on the actual spell pages, the values on the top half of the box would actually be filled in).

Implementing this is where I have trouble. Originally, as in my edit to Fire Surge, I was going to just write up a custom table for each page. Each spell requires a different number of different types of runes, and has different combinations of elemental staves and/or combination runes that could be used to cast it. I am not sufficiently skilled with the {{#if tool of transcluded templates to do anything except create something like this (I don't care enough to look up the actual wikicode or even do a good job on this demonstration, so bear with me):

{{#if{{{PAGENAME}}} = Wind Strike
|<code that makes the table display that Wind Strike uses one air and one mind, and displays its cost>
|<code that says you can cast Wind Strike with an air staff, so displays the adjusted cost>
{{#if{{{PAGENAME}}} = Water Strike
|<code that makes the table display that Water Strike uses one water, one air and one mind, and displays its cost>
|<code that says you can cast Water Strike with an air staff, so displays the adjusted cost>
|<code that says you can cast Water Strike with a water staff, so displays the adjusted cost>
|<code that says you can cast Water Strike with an air staff and tome of frost, so displays the adjusted cost>
|<code that says you can cast Water Strike with mist runes, so displays the adjusted cost>

Etc etc. That would get it done, but it's extremely inelegant, would REALLY bloat up the infobox, and would take forever. I'm betting someone else could think of a better way to implement it.

So. This thread is primarily solicitation of coding advice and/or help with this little project. However, since someone will complain if I start a Yew Grove thread without actually proposing anything, consider the aforementioned project to be proposed. People who have glaring objections to the infobox being modified in this way can voice them. Aesthetic suggestions on how to implement this are quite welcome too.

Discuss. --Andorin (Talk) (Contribs) 09:14, January 22, 2011 (UTC)

Discussion[edit source]

Support glaring objections - This will help present the same information, if not more, in an easier to see as well as more straightforward location. Sounds good, 222 talk 09:18, January 22, 2011 (UTC)

Support - Per Brains - better way to present often-used information. sssSp7p.pngIjLCqFF.png 09:21, January 22, 2011 (UTC)

Comment - There a several ways to implement such a thing, but none of them are particularly easy, and all would require work, probably much of it. AXYYGBucket detail.pngrwojy 09:57, January 22, 2011 (UTC)

Support - Per 222. bad_fetustalk 10:30, January 22, 2011 (UTC)

Add cost/xp - Seeing as we're adding the cost per cast, it feels like we should include this too. The way I see it, people will generally look for the cost of a spell, to work out the cost/xp. I suggest adding something to the infobox to say how much 1xp costs - the problem of combat spells could be avoided by stating that the price shown is for the minimum xp received. Real Nub 13:28, January 22, 2011 (UTC)

Cost per xp of a combat spell is difficult to accurately assess because of the additional experience gained from dealing damage with it. --Andorin (Talk) (Contribs) 20:19, January 22, 2011 (UTC)

Support - Finally. User_talk:Fswe1 Fswe1 Brassica Prime symbol.png 13:48, January 22, 2011 (UTC)

Strong oppose adding to infobox - That most certainly looks horrible in an infobox, and is not the essential information that belongs there. Of course, I like the box in general, and agree that the current state of affairs is unacceptable. Therefore, I think it's a better idea just to stick that box at the bottom of the page where the paragraph is currently found. --LiquidTalk 14:19, January 22, 2011 (UTC)

Support - And suggestion. I can make something that it automatically calculates the cost for the spell, but then the cost parameter must be the same for all spells. Then I can let it calculate the price using #explode. Making a list of all spell costs in #if's is definetely not needed(then atleast use #switch), as then we could as well add another parameter for it in the infobox. 1 thing though, how were you going to put it in the infobox? like this?

Cost 9001 coins
(With water staff: 1337 coins.
With air staff: 8000 coins.
With water and air staff: 336 coins)

As I think that wouldn't be very good to put that in the small infobox. We could seperate the text from the infobox though, but that it is still included in the infobox template, but just appears as the starting line of text. JOEYTJE50TALKpull my finger 14:33, January 22, 2011 (UTC)

Support - Per Brains. Matt (t) 03:00, January 23, 2011 (UTC)

Support templating the cost, neutral on this being in the infobox - I do think it would be a good idea to template-ify this information, but I don't know if its bloating the infobox is a good idea.

From a technical standpoint, rather than have a mass switch based on spell, I think 14 parameters taking the input of the number of each rune would be better (i.e. applying Template:SpellCost), then adding some code to deal with staves and such. A bonus of this in the infobox is that we can remove the cost parameter, if it is decided to add it to the infobox. Quest.png Gaz Lloyd 7:^]Events!99s 13:48, January 23, 2011 (UTC)

We could also use #explode to make it automatic. That would put a little bit more load on wikia servers, but it is easier to use then. We should let the people decide: Should it be automatic and require a little bit more server load, but be easier to use, or should it be manual, and require less server load, but be a little bit harder to use? JOEYTJE50TALKpull my finger 14:11, January 23, 2011 (UTC)

Strong oppose - Per Liquid. --クールネシトーク 14:03, January 23, 2011 (UTC)

Support - If we can present something better like this, we've got to do it.   Swizz Talk   Events!   15:34, January 23, 2011 (UTC)

Support, oppose placement in infobox-It should be added where the text is now--Dragon longsword.png Nicholas4132 Coins 1000.png 21:34, February 6, 2011 (UTC)

{{closure}} --Andorin (Talk) (Contribs) 21:24, February 15, 2011 (UTC)

Support, oppose inside infobox - A seperate tabulated template handles that info better and is easier to debug. Rewlf2 07:22, February 24, 2011 (UTC)

I could also make something that the default first scentence of the page is a line with the costs, which is 100% bugless. Then it isn't inside the infobox, but still in the same template. JOEYTJE50TALKpull my finger 09:52, February 24, 2011 (UTC)

Closed - Consensus to add it outside the infobox. ʞooɔ 22:33, March 14, 2011 (UTC)