Creating, Interacting, and Saving an NPC

I’ve looked all around for the last hour, and couldn’t find anything on this - I’m not asking you to write the code for me, by all means.
But I was wondering how I could:
A. Create an NPC in game, that stays stationary.
B. When I hit “use” with my NPC - It does something (like open a Derma panel)
C. Save the NPC in the map, so it doesn’t disappear on a map restart

Could someone point me to some documentation, or at least try to explain how I could go about doing this?

Thank you!

I surmise that you could do part A by providing a position vector and spawning the NPC there on map startup in an autorun file, and modify an existing SNPC to not move at all (I think Dr. Hax does not move, so you could probably start with him and strip down his computer-throwing functionality until he’s just a standing shell)
Part B would involve (But you probably already knew). You need to make it call whatever function opens the derma menu.
Part C would require that you set up some kind of data file in the /data folder, you could probably throw in a per-map table of position vectors for the NPC spawn as well but I have 0 experience with storing data.

argh snip mostly irrelevant