Originally Posted By: 3run
Thank you very much! I'll look more into those 'file_' and 'str_' functions! laugh

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.

Best regards!
, your welcome laugh . I would indeed go for 1 shared function. It saves alot of duplicated code and when expanding or changing your game your happy you have only 1 action. To keep it flexible and clear I personally try to throw as much of the code in small functions that I call in the big action if conditions are met (e.g. if (clip <= 0 && ammo > 0) reload(); ).

Also instead of saving the object ID you could also retrieve the object ID from its filename (if each object ID has a different model ofcourse). Say:
Player.mdl = 0 / PLAYER_ID
Rat.mdl = 1 / RAT_ID
Depends ofcourse what you want to achieve, but its more readable in the text file that way and easier to mod/change. Plus if you ever want to add a map editor, this will speed up the process for mappers since its 1 less variable to worry about.