(note: this approach is not recommended for new code. It's better to control this stuff with Lua. This is just an interim before this stuff is moved over to Lua, since I don't want to spend time converting it right now.)