Module talk:Questreq

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search
This talk page is for discussing the Module:Questreq page.

How to update this page[edit source]

First off, why is this now a module? This is now a module because with Lua we can perform the task at hand many times more efficiently. So what's different?

  • Each quest is only listed once, unlike before where if a quest was a requirement for another quest, you would also have to add its required quests. It made the page huge and filled with redundancy.
  • Everything was done at once. This is mostly because of the above point. Now, we use recursion to list subrequirements.
  • Only 1 parameter, links are tidied automatically

Getting started[edit source]

So how do you update this template? First off, it's not a template. The Template:Questreq is just going to be a wrapper template so that everything is neater. The actual code for creating the list is hosted at Module:Questreq. You do not edit this page to add new quests. To add a new quest, you need to find Module:Questreq/data.

Why is the quest list on a different page? It's cleaner. If the main module has a problem that needs editing, it'll be more helpful to have significant changes split off from quest additions.

So how do you add a new quest? This is really easy actually, though someone without coding experience might find it confusioningz. I'll try to dumb it down as much as possible and take it step by step.

  1. Find Module:Questreq/data and open the editor
  2. Find where to place a quest in alphabetical order (remember that articles—the, a, an—are not included for ordering, so "The Giant Dwarf" begins with "Giant" and not "The")

Syntax[edit source]

  1. Add a new line and start it with a tab character (you can copy that blue colored character there or copy it in the editor when you're adding)
  2. After the tab character, add the quest name surrounded with apostrophes (') and surround that with square brackets. So if the quest was called "Mol is Cool", we would add ['Mol is Cool'] after the tab character.
  3. After that quest name, add this: = {},
  4. At this point, our whole line is:
    ['Mol is Cool'] = {},
    It is important that every quest follow this format
  5. If there are no required quests or miniquests for the quest you just added, then it is finished, and you can press save, but if there are, continue following these steps:
  6. For every quest that is required for what you are adding, edit the list (the stuff surrounded by {}) with the quest names
  7. Every quest name needs to be surrounded by apostrophes (') and all of this strings need to be followed by a comma (,) except for the last one
    • Let's say the quests required are "Fswe is Smelly" and "Battleben is a noob"
    1. Every quest when added to the list needs to follow the exact same casing. If there are any differences, then the list will not work properly. You can check the line the quest required is on to see what casing to use. See why it's important to keep it in alphabetical order?
    2. So we want to edit {} to include those quests. Following the instructions above, we would come out with {'Fswe is Smelly','Battleben is a noob'}
      • Final product is: ['Mol is Cool'] = {'Fswe is Smelly','Battleben is a noob'},
    • It is extremely important to remember that you cannot use an apostrophe in the quest name without escaping it, because the apostrophe is the delimiter of the string. Escaping means you add a backslash (\) before the apostrophe. So if another quest was called "Cook's Cult", it would be included in the list as Cook\'s Cult

If you're afraid of screwing up or forget what's important, here's what absolutely needs to be remembered for names:

  • Surrounded by apostrophes
  • Exact casing
  • Strict consistency in name
  • Commas to separate

Sub-requirements[edit source]

So what do I about quests required for the quests required for the quest I just added? Nothing, you do nothing. If you entered the name correctly into the list, then it will automatically make the sublists and the subsublists. In other words, only add quests that are direct requirements to the quest being added.

Special requirements[edit source]

What if a quest doesn't need to be completely finished, but it needs to have been started to progress with another? That's all thought of. If a quest doesn't need completion, then begin the string with Started:, with that exact casing and no spaces. So if we didn't need to complete Fswe is Smelly, then that part of the list would be 'Started:Fswe is Smelly'.

What if a quest only needs 1 or two quests to start, but requires a ton more for additional rewards? Then create 2 separate entries. The first one should be the normal quest name and the bare minimum requirements. So for example ['Fate of the Gods'] followed by the required quests. The second entry should be the same quest name, but prefixed with Full:, so ['Full:Fate of the Gods'].

What if what is required is not an actual quest or something else that makes it not appear in the list? Then you can still add it. If you needed 50 quest points from any means to start a quest, you can add '50 [[Quest Points]]'. If something is not found in the list, then the module will not attempt to look for a sublist. It will list it as a requirement, and be done with that point.

Do we need to have "(quest)" for some pages? Yes. The exact page name should be used for all quests. If there is a parenthetical, the link will be automatically tidied. So "Shilo Village (quest)" will be changed to [[Shilo Village (quest)|Shilo Village]] which displays [[Shilo Village (quest)|Shilo Village]]. no pls --Iiii I I I 04:42, August 6, 2015 (UTC)

Troubleshooting[edit source]

What is a script error? A script error means something went wrong. If you understand Lua, you can take a chance yourself, or you can leave a message either on my talk page or here.

I CAN'T SAVE THE PAGE!!! By default, you will be prevented from saving a change to these pages if your edit has a syntax error. You may need to start from scratch and follow the instructions more obediently. If you think you did as described perfectly and still can't save, then leave a message here or on my talk describing what you tried to do.

Something isn't displaying correctly........ That's not good. Post a message either on my talk or here.

Any other problems? My talk page or here. MolMan 16:07, October 14, 2014 (UTC)

All seems crystal clear. PS. Clearly it is 7eye who is smelly. User_talk:Fswe1 Fswe1 Brassica Prime symbol.png 07:15, October 15, 2014 (UTC)
rude --Iiii I I I 20:28, January 30, 2015 (UTC)
Added subheadings to the post GKFXtalk 13:36, April 25, 2017 (UTC)

multiple quests[edit source]

would love to use this module on some non-quest page, e.g., some items that requires certain quests to unlock. Is there a way to make it so that the module can list multiple quests within one {{Questrec|}}?Nayfaan (talk) 07:16, 19 September 2020 (UTC)