User talk:Illviljan

From Path of Exile Wiki
Revision as of 12:38, 18 February 2021 by >Game widow (→‎Zendesk ticket)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

I think that info about tools for calculating talisman item level shoud be there where info about calculating talisman item level is, otherwise no one will see it.

I moved it down for consistency. Most external links are placed at the bottom of the page on this wiki, for example Chromatic Orbs, auras. I believe this is also common practice on as well. --Illviljan (talk) 12:42, 16 January 2016 (UTC)

Tips to improve your coding style

Hey, some tips to improve your coding style based on recent edit on Module:SMW data tables, I'll probably add it to general style guidelines too at some point

-- Shorten expressions when you can, this avoids performance overhead and is better readability

-- Don't
not (var == nil)
-- Do
var ~= nil

-- Use string format over .. for better readability.
-- For large strings you want to make a table and connect in one go, that's much faster.

-- Meh
"#ask:[[Is event::" .. g_args['type'] .. "]] [[Has release date::<" .. g_args['release_date'] .. "]]"
-- Better
string.format("#ask:[[Is event::%s]] [[Has release date::<%s]]", g_args.type, g_args.release_date)

-- meh
local out = ''
out = out .. 'a'
out = out .. 'b'
out = out .. 'c'
out = out .. 'd'
return ''

-- better
local out = {}
out[#out+1] = 'a'
out[#out+1] = 'b'
out[#out+1] = 'c'
out[#out+1] = 'd'
return table.concat(out, '')

-- Use local variables when it doesn't need to be in the argument dict

-- Don't
g_args['out'] = '<div style="text-align: left;">'

-- do
local out = '<div style="text-align: left;">'

-- Avoid code duplication

-- Current
-- Both lines do a lot of things that are basically the same
if g_args['image'] == nil then 
    g_args['picture'] = '<div class="image"> [[File:' .. g_args['name'] .. ' logo.png|alt=|250px]]</div>' 
    g_args['picture'] = '<div class="image"> [[File:' .. g_args['image'] .. '|alt=|250px]]</div>'

-- Better
local picture
if g_args['image'] == nil then 
    picture = g_args['name'] .. ' logo.png' 
    picture = g_args['image']
picture = string.format('<div class="image"> [[File:%s|alt=|250px]]</div>', picture)

-- There are lot of cases where you do a lot if ... elseif ... elseif ... end that basically do the same.
-- Look at some of my other modules, you can use a table to cut the code significantly down as well as making things easier to read

-- Example
if g_args['type'] == 'challenge' then
    g_args['type'] 			= 'Challenge league'
    g_args['short_name'] 		= g_args['name']:lower():gsub('league', ''):gsub('^%l', string.upper)
    g_args['ordinal_number'] 	= g_frame:callParserFunction("#ask:[[Is event::" .. g_args['type'] .. "]] [[Has release date::<" .. g_args['release_date'] .. "]]", "format=count")
elseif g_args['type'] == 'expansion' then
    g_args['type'] 			= 'Expansion'
    g_args['short_name'] 		= g_args['name'] 
    g_args['ordinal_number'] 	= g_frame:callParserFunction("#ask:[[Is event::" .. g_args['type'] .. "]] [[Has release date::<" .. g_args['release_date'] .. "]]", "format=count")		
elseif g_args['type'] == 'pvp' then
    g_args['type'] 			= 'PvP season'
    g_args['short_name'] 		= g_args['name']:lower():gsub('pvp season', ''):gsub('^%l', string.upper)
    g_args['ordinal_number'] 	= g_frame:callParserFunction("#ask:[[Is event::" .. g_args['type'] .. "]] [[Has release date::<" .. g_args['release_date'] .. "]]", "format=count")							
elseif g_args['type'] == 'race' then
    g_args['type'] 			= 'Race season'	
    g_args['short_name'] 		= g_args['name']:lower():gsub('race season', ''):gsub('^%l', string.upper)
    g_args['ordinal_number'] 	= g_frame:callParserFunction("#ask:[[Is event::" .. g_args['type'] .. "]] [[Has release date::<" .. g_args['release_date'] .. "]]", "format=count")		

-- rework:
local types = {
    challenge = {
        name = 'Challenge league',
        short_name = function ()
            return'league', ''):gsub('^%l', string.upper)
    -- add expansion/pvp/race here too

local type_data = types[g_args.type]
if type_data ~= nil then
    g_args.type =
    -- we know this is a function, so it can be called
    g_args.short_name = type_data.short_name()
    g_args.ordinal_number = g_frame:callParserFunction(string.format("#ask:[[Is event::%s]] [[Has release date::<%s]]", g_args.type, g_args.release_date), "format=count")	

--OmegaK2 (t|c) 21:15, 29 July 2016 (UTC)

Thanks. I might as well add some things that I've been wondering about.
  1. I've been favoring g_args because that's what h.handle_mapped_property_args(map) in Module:SMW_data_tables seems to require. How is that solved with local arguments?
  2. You seem to favor g_args.i over g_args['i'], why? g_args['i'] seems better after my testings since variables can easily be used, in for loops etc.
--Illviljan (talk) 22:00, 29 July 2016 (UTC)
1. Well yeah for that specific usage it makes sense, but otherwise don't. What the function does is pretty simple actually and what you're using here is pretty much resembling what I'm doing in the item module. I think it might be a good idea to put it into the util module (the whole "get argument, validate argument, set semantic property if validated and valid argument", display stuff") eventually. The logic has been different in the different modules, but I think I'll find a way streamline that.
To answer that question in general outside of that use case, you can ofc pass arguments to other functions
2. the first format is less characters and as a result more readable imho. I don't think it really matters. The second one makes sense when you actually use variables or have key names that contain invalid characters (like spaces)
--OmegaK2 (t|c) 22:22, 29 July 2016 (UTC)

Broke Hatred

Help! I made an edit on Hatred, and the Skills module returns an error for it now, and I have no idea what it means. sl|Hatred returns -> Module Error: No results found for search parameter "hatred".

Could you tell me what I did wrong so that I can avoid it in the future? Thanks

--Swang30 (talk) 05:05, 21 December 2016 (UTC)

It wasn't you, I broke Hatred (and a few other gems...). If you check Recent changes on the sidebar you'll see I tried a simple thing with a important module around that time but I failed and broke it instead. :) --Illviljan (talk) 08:29, 21 December 2016 (UTC)

Per Infobox vs. master price

I'm wondering - is it something that's agreed by PoE editors or own opinion? As far as I've seen infobox is just a short version of some data. In this case infobox hasn't doubled informations - it's just price and thing I've added was giving more informations. For new player vendor price isn't "something you can buy randomly from masters". It's obvious only for people who are into game a lot, i.e. they have hideout with leveled masters. Krzysiunet (talk) 20:51, 27 August 2017 (UTC)

{{Item}} is taking over the role that {{MasterUniquePrice}} and {{Item price}} was doing because it is supported by PyPoE and SMW. Two things that greatly helps us keeping the wiki up to date. Do you not think it is wasted time to maintain two values, one which is maintained manually, on 700+ pages? The hoover text for Purchase Cost on Martial ArtistryMartial Artistry
Crimson Jewel
Limited to: 1
Radius: Small
+(0.3-0.4) metres to Melee Strike Range while Unarmed
Passive Skills in Radius also grant: 1% increased Unarmed Attack Speed with Melee Skills
A gentle hand rarely leaves a mark on the world.Place into an allocated Jewel Socket on the Passive Skill Tree. Right click to remove from the Socket.
do explain that it can be bought from NPCs, but what are NPCs? I agree that the hoover text, unique item page and the real NPC page could certainly be improved to more clearly convey that.--Illviljan (talk) 22:00, 27 August 2017 (UTC)

Move of /sandbox page

Hi, just wanted to say thanks for moving the sandbox page i accidentally created. I got confused between my profile page and user page and created that link erroneously. Then i forgot what i was doing and neglected to clean it up. Thanks again! Alleryn (talk) 10:11, 31 August 2017 (UTC)

Lore on monster pages

Could you please provide a guideline for consistency regarding monster and lore pages?

It makes little sense to put all the lore, appearances and unique item references on the page of the first unique monster appearance. This conflict is especially apparent on figures that have multiple appearances and different boss fight mechanics (Doedre Stamatis, Shavronne of Umbra, Maligaro and Brutus).

Molldust (talk) 08:35, 21 May 2019 (UTC)

I just think it's unnecessary creating another page for a small paragraph of actual content. I can refer to Merveil and Dominus which have a bunch of lore and those pages doesn't feel that large to me. You did find a couple more examples using your approach than me though, so I suppose that's how it should be done? --Illviljan (talk) 16:06, 21 May 2019 (UTC)
You have a good point with small paragraphs getting scattered. It very much depends on the scope of the wiki. Sadly even the The Shaper page does contain little to no trivia/lore. Not even a reference to Zana being his daughter. The lore compilation is a very nice resource to look at.
How about this: A lore page should contain at least two proper sentences introducing the character, satisfactory map/story enctounters, unique items references and two-way linking from each map/unique monster page. The boss fights and playthrough notes could go on the area/map pages.
Piety of Theopolis is currently mess in that regard. I'm especially curious if Piety from the Crematorium and Lunaris Temple use the same skill set (excluding transformations).
Maybe there's a good way to structure that. Molldust (talk) 20:18, 23 May 2019 (UTC)
Sounds good. I do think the wiki lacks in the lore department a bit, I think we have just missed a editor that's really into the lore for a while unfortunately. Regarding skill comparisons I think creating a hover link similar to {{il}} but for monsters would help with that. --Illviljan (talk) 16:40, 24 May 2019 (UTC)
I want to bring monsters onto the wiki properly at some point anyway. Technically the only problem with it is the monster info is hard/impossible to verify, though we can just settle with what we have. --OmegaK2 (t|c) 20:58, 24 May 2019 (UTC)

Zendesk ticket

Hi there, we received a zendesk ticket from a user saying: "The helmet modifiers part of your website is missing."

I have absolutely no idea what they mean, but perhaps you do? — Game widow ( talk ) 21:28, 16 February 2021 (UTC)

Game widow, it's the good ol' Category:Pages where template include size is exceeded. I think this can be avoided if the table styling was moved to css, but I don't know how to do that. --Illviljan (talk) 05:28, 17 February 2021 (UTC)
I will try to get one of our Cargo experts to have a look — Game widow ( talk ) 19:28, 17 February 2021 (UTC)
I made a simpler version of the output here User:Illviljan/test5.--Illviljan (talk) 20:34, 17 February 2021 (UTC)
I still plan to address this, but I haven't gotten around to it yet. It's on my list. Vinifera7 (talk) 00:17, 18 February 2021 (UTC)
Thank you! — Game widow ( talk ) 12:38, 18 February 2021 (UTC)