Scripting custom content for computer role-playing games requires the designer to tell a story by writing small fragments of computer code distributed among the characters, props, and locations of the game world. The main challenge of these games is to create believable motivations and behaviors for the dozens or even hundreds of characters and rooms with which the player may interact. We present the ScriptEase model of game scripting. This model is pattern-template based, allowing designers to quickly build complex game worlds without doing explicit programming. This is demonstrated by generating code for BioWare’s game Neverwinter Nights.