Thank you very much! I'll look more into those 'file_' and 'str_' functions!
Edit: maybe I won't save function's name at all, but object's ID instead. So I'll have only one function for NPCs (same for items etc), and inside of that function I'll set specific parameters for each NPC depending on it's ID.