In a 2 quart pan, heat milk slowly over a low heat.
In a small bowl whisk together sugar and cornstarch. Add to hot milk and cook over medium heat, stirring often, until mixture thickens and starts to bubble. Cook for 3 minutes, stirring continually. Turn heat to lowest setting.
In another bowl whisk egg yolks. Add a small amount of hot milk mixture to yolks while whisking to warm yolks- not to cook them. In a thin stream add the warmed eggs to the the rest of the milk mixture, while whisking continually. Cook over low heat for 2 more minutes.
Remove custard from heat and stir in vanilla, butter, and chocolate.
Dissolve gelatin in cold water and stir into custard. Pour immediately into pie shell and refrigerate for at least 3 hours.