I want to be able to check whether or not the player is able to see an npc for a check to speak with them in a king's quest style game.

if(object_in_viewport(object_id,viewsize_x,viewsize_y,player_pos) = true)
interactable = true
(this allows the code to continue with actions beyond this check)

I don't know how to structure this so that it will work within current gml, the concept is there but I could really use some help getting this to work.

PS: yes I know it would be easier to make rooms and drop the open area of movement just roll with it please