The heart of the matter is
PRCSCR. That article links to a script template for placing chests and other placeables.
If you haven't already done the
tutorials, I'd suggest doing everything up to and including Placeables, then dip into the wiki when you need more information.