A flexible protocol, applicable to semirigid as well as floppy polyatomic systems, is developed for the variational solution of the rotational-vibrational Schrödinger equation. The kinetic energy operator is expressed in terms of curvilinear coordinates, describing the internal motion, and rotational coordinates, characterizing the orientation of the frame fixed to the nonrigid body. Although the analytic form of the kinetic energy operator might be very complex, it does not need to be known a priori within this scheme as it is constructed automatically and numerically whenever needed. The internal coordinates can be chosen to best represent the system of interest and the body-fixed frame is not restricted to an embedding defined with respect to a single reference geometry. The features of the technique mentioned make it especially well suited to treat large-amplitude nuclear motions. Reduced-dimensional rovibrational models can be defined straightforwardly by introducing constraints on the generalized coordinates. In order to demonstrate the flexibility of the protocol and the associated computer code, the inversion-tunneling of the ammonia ((14)NH(3)) molecule is studied using one, two, three, four, and six active vibrational degrees of freedom, within both vibrational and rovibrational variational computations. For example, the one-dimensional inversion-tunneling model of ammonia is considered also for nonzero rotational angular momenta. It turns out to be difficult to significantly improve upon this simple model. Rotational-vibrational energy levels are presented for rotational angular momentum quantum numbers J = 0, 1, 2, 3, and 4.