Here is a tip for O-scale modelers. If you are modifying your layout, use toothpicks as rebar for new rocks made from molds. For example, the Woodland Scenics Classic Rock Mold (C1236) produces a heavy rock and protrudes quite a bit when attached above the layout surface - how do you get it to stick to a vertical surface?
Carefully drill a few holes in the back of the rock. Break a few toothpicks in half, and glue the toothpicks into the holes (pointed side sticking out). Wait a minute or 2, then add glue to the back of the rock and exposed toothpicks, and attach the rock to your layout. The toothpicks will readily penetrate the plaster sheets, into the Styrofoam. The rock is solidly attached almost immediately. This works great for overhanging rocks that can only be partially attached to your mountainside. I used wood glue because it seems to work the best.