ID:2309113
 
Code:
obj
Learn_Techniques
var/obj/Abilities/ability
icon = 'Abilities.dmi'
New(obj/Abilities/technique, screen_locc)
..()
ability = technique
var/obj/Abilities/A = new technique()
src.appearance = A.appearance

if(!locate(ability) in usr.contents) src.overlays += 'skill_shadow.dmi'

screen_loc = screen_locc
usr.client.screen += src


mob/proc
technique_screen_placement(skilltree_name)
for(var/obj/Learn_Techniques/A in usr.client.screen) usr.client.screen -= A
var amount_of_techniques = ( (skilltree_name in skill_tree["Basic"]) ? length(skill_tree["Basic"][skilltree_name]) : length(skill_tree[skilltree_name]))
var/list/list_of_techniques = ( (skilltree_name in skill_tree["Basic"]) ? skill_tree["Basic"][skilltree_name] : skill_tree[skilltree_name])


var/list/size_of_window = splittext(winget(src, "SkilltreeWindow.skilltreeMap", "size"), "x") // 1 = Width, 2 = Height

var x = (text2num(size_of_window[1]) / amount_of_techniques)
var y = amount_of_techniques > 4 ? (text2num(size_of_window[2]) / round((amount_of_techniques / 4), 1)) : text2num(size_of_window[2]) / 2
var x_align = 1

for(var/i = 1, i <= amount_of_techniques, i++)
if(x_align > 4) x_align = 1

if(i >= 4)
new/obj/Learn_Techniques(list_of_techniques[i], "skilltreeMap:0+0:[round(((x*x_align)/2)-16, 1)], 0+0:[round(((y * round(((i / 4)+1), 1) )-16), 1)]")
else
new/obj/Learn_Techniques(list_of_techniques[i], "skilltreeMap:0+0:[round(((x*x_align)/2)-16, 1)], 0+0:[round((y-16), 1)]")

x_align ++


Problem description:
I've tried several different things; there are no runtime/compile errors and I've made sure that the algorithm is actually functioning correctly. The map has letterboxing toggled off but, for some reason it won't display the object correctly in the map and I don't know why that is the case. Any assistance would be nice.
One immediately obvious problem is that you have usr in your New() proc. usr has no business in a proc unless you're 100% positive it's always triggered by a verb, but it's bad practice to assume that. Pass the player (which would be src in technique_screen_placement()) as an extra argument to new(), so you don't have to rely on usr.

Probably that is not the source of the issue, but it's something you can fix right away to rule out as a potential problem.

Another thing you can do while debugging is to change the screen loc so there isn't a map component, and it appears on the main map instead. That way you can at least determine if your placement, etc. is right or if they appear at all. If they appear, the problem is related to how skilltreeMap is setup; if they still don't, it's something else.
We resolved his issue in the discord last night. He was misunderstanding how secondary map controls determine their extents.

He didn't realize that his controls were stretching to accommodate ceil(SPRITE_WIDTH/TILE_WIDTH) rather than floor(SPRITE_WIDTH/TILE_WIDTH).

The end result was the secondary map accounting for blank space they didn't know existed.