ID:1963339
 
(See the best response by Lummox JR.)
HUD Code:
mob/proc/ADD_HUD(mob/Unit/Unit)
///*
if(src.client.view!=40) return
//if(src.CheckWindow("BATTLE_HUD")) return
var/obj/HUD/HP/HP=new/obj/HUD/HP
src.client.screen+=HP
HP.screen_loc="NORTH-2,WEST+3"
HP.Percentage2Icon(Unit.HP,Unit.MaxHP)


Battle Options Code:
mob/proc/BattleOptions(var/mob/Unit,var/list/ActionList,var/list/TalkList,var/list/SupportList,var/list/AttackList,var/list/ItemList,var/list/RescueList)
usr.OpenWindow("BATTLE_HUD")
//usr.DisableWindow("Default")
var/counter=0

if(ActionList.Find("Talk"))
var/obj/BattleOption/Talk/Talk=new/obj/BattleOption/Talk
src<<output(Talk,"BATTLE_HUD.Info:1,[++counter]")


Problem description:
Above I posted two pieces of code from two completely different systems. The first proc ADD_HUD() is called upon MouseEntered on a mob and gives the player a visual display of the mob's health by adding an object to the screen. The second proc BattleOptions opens up a window containing a grid and outputs objects with the relevant options. Battle Options works fine, and it displays the Talk Option as expected. Problem is, as soon as I MouseEntered() a mob and the ADD_HUD() proc is called, in addition to it's normal functions, the Talk option is replaced by HP. These two systems seem completely unrelated to me, and for the life of me I cannot understand the interference. Can anyone help me identify the problem?


TL;DR: Screen object for HUD invading grid for no apparent reason.

Best response
You output an obj to your grid but didn't hold onto the reference. The reference got recycled, hence the grid shows the obj that took its place.
Thank you Lummox. I was having a real hard time with this one!