So far I've just been using alignment. When I set an box to evil, they fight my hero's immediately. This works in 90% of situations, but if your concerned about them sneaking or being too far away or you have some situation where you don't want to change alignment, you'd have to use a different way
Thats exactly how i have it at the moment. It seems a bit clunky though. As i can sit for several seconds staring at the npc before it starts combat. And the way i have this setup is combat starts if a guard sees you out of your cell*After a short dialog* and unfortunately for me the "Charactersawcharacter" function has a greater range then the combat start.
Its also very important that the dialog starts before any type of combat.