MilMo Wiki

READ MORE

MilMo Wiki
Advertisement

DPL Help[]

Hello, I need help with the extension DPL, I would like to create templates using DPL, for example I want to create a template that loads the contents of other templates and generates a table with the loaded templates:

Example: Load the data from these templates CorruptedDropTable GemT6DropTable AlienDropTable GlobalDropTable

and then generate a template like this: https://milmo.gamepedia.com/Template:Droptable/Invader

Thank you for your help.

JuniorDark (talk) 13:16, 30 October 2018 (UTC)

Sure. the templates you list above don't actually exist though ... do you mean Template:Droptable/Invader, etc ? — Game widow ( talk ) 13:42, 30 October 2018 (UTC)

These templates: {{CorruptedDropTable}} {{GemT6DropTable}} {{AlienDropTable}} {{GlobalDropTable}}

JuniorDark (talk) 13:49, 30 October 2018 (UTC)

It would be far simpler if you had the amounts and drop rates included in the actual item infoboxes ({{Infobox/Item}}). You don't necessarily have to display those fields, though you can, but if they were included per item, this would be a daudle. The way you've set things up now, it would seem like there are an indefinite number of fields called item#, amount# etc. Here's an example of using infoboxes to make tables with dpl — Game widow ( talk ) 14:02, 30 October 2018 (UTC)


Yes but for what I looking it would be complicated because most of items have different drop rates depending on the type, place, level.

In the game there are several preset drops tables and each monster uses a number of these tables according to type, place, level, etc.

what I have in mind is use DPL to load the items from these templates and generate a single table.

Example: The Invader have these 4 droptables:

  • {{CorruptedDropTable}}
  • {{GemT6DropTable}}
  • {{AlienDropTable}}
  • {{GlobalDropTable}}

So I would use DPL on the Invader page to load these 4 droptables and generate a single table like this example:

  • {{Droptable/Invader}}

That's the idea I had, but if you have any easier way let me know.

JuniorDark (talk) 14:41, 30 October 2018 (UTC)

Perhaps i misunderstand, but that seems like a managable number of fields you could add to the infobox and just display or not as required on any given page. Am i correct in assuming that each of those droptables only provides 2 additional parameters (amount and drop rate) related to the object? — Game widow ( talk ) 15:36, 30 October 2018 (UTC)

Yes, but all these templates I mentioned are just a test to to give an example of the result I want. JuniorDark (talk) 15:46, 30 October 2018 (UTC)

For the sake of argument/demonstration, let's say i add these extra fields to your infobox template. Would you want them to be displayed, or just available for use with these dpl tables? I can do either. If they display, i could add 4 collapsed sections which would have the drop amounts and rates for each of those four categories and users could open the sections or not, so it would not take up much extra space by default. If they are not to be displayed, then they still need to be defined inside each template call, but there would be no visible difference in the infobox. In either case, the information would then be available to build those tables you want easily — Game widow ( talk ) 16:19, 30 October 2018 (UTC)

Yes i want them to be displayed, or what is easiest for everyone to understand. I was talking to one of developers and he wants something that syncs if he makes a change in the drop tables and update all pages that uses that drop table automatically. JuniorDark (talk) 16:34, 30 October 2018 (UTC)

Have a look at {{Infobox/Item}} now. That has the extra fields added and the example shows how it function. If that works for you, then we can make those dpl tables — Game widow ( talk ) 18:48, 30 October 2018 (UTC)

if I understood correctly with this example you mean add the amount and drop rate from each droptable in the infobox and then use the DPL to generate a table with the desired fields like global_amt and global_rate?

if so I think the infoboxes would be have a lot of data because an item could be in 10 different droptables with different amounts and chances, and if the developer decides to change something then you would have to go to the item page and change manually and we are talking about 500+ items.

Therefore I wanted to create a template for each droptable with a list with the name, amout, and drop rate. — JuniorDark (talk) 09:58, 31 October 2018 (UTC)

Then you don't want DPL, really. DPL basically works with existing data to display information. What you are describing is essentially the reverse and that would require a solution that involves either Lua (and the Scribunto extension), or some python scripting or Cargo (another, different extension) or a combination of the three, all of which are beyond my expertise. You should join us on Slack (and in particular, the #automation channel there) and see if someone can help you do that. — Game widow ( talk ) 11:06, 31 October 2018 (UTC)
I got it, I think the Cargo extension is adequate for my case, I already applied for Slack. Thank you very much for your help and sorry for the inconvenience. — JuniorDark (talk) 11:56, 31 October 2018 (UTC)
It's no inconvenience. I will enable cargo for you — Game widow ( talk ) 12:11, 31 October 2018 (UTC)
Advertisement