RTOM or RTOW, Regulated Take-Off Mass or Weight, is assessed as the most limiting of the Structural weight S, WAT weight W (Weight for Altitude and Temperature), Field Length Limited weight F, and Obstacle clearance weight O. Other factors such as Brake Energy limited weight, En-route clearance, and Landing Go-Around and Landing distance might reduce take-off weight.
The WAT weight is prescribed in BCAR, JAR, FAR etc as minimum gradients of climb in the 1st, 2nd and 4th segments of the take-off gross flight path. eg 2.4% gradient for a twin in the 2nd segment.
Obstacle clearance is required as 35 ft over the most limiting obstacle, using the Net flight path, which is the gross flight path penalised by prescribed gradients for each segment.
A lower flap setting gives better climb gradient but takes more take-off distance. A higher flap setting gives shortest take-off distance. But if obstacles are present, all these factors have to be evaluated for the altitude, wind and temperature of the day.
V2 is a function of the weight that comes out of the evaluation. So if you are weight limited to a lower value, the V2 is reduced to that required for the lower weight.
All the above will be given as Flight Manual charts, but will normally be computed by RTOW software to give RTOW charts for each individual runway heading, accounting the unique distances and obstacles of each runway heading. The RTOW software can choose the optimum flap setting for the day.
For non limiting runways generic charts might be used. Your own Aircraft Flight Manual AFM and airline SOPS will determine exactly what is done in each type or airline. The above is what is done broadly speaking for Jetstreams, ATP's, 146's and RJ's in many of the airlines that fly them. The pilot may only see the final RTOW chart, or be presented with his RTOW and speeds by a despatcher, depending on airline.