Role plays can be more or less structured by the trainer. For example, two role players can be provided with only one or two sentences to describe a situation they are being asked to enact. That would be minimum structure.
Or one person can be provided with a script which tells them what kinds of things they are to say in the roleplay, while the learner improvises and practices.
Or, both learner and the other actor can be provided with a more extensive script to try. This approach is useful when the focus is less on skill learning, and more on examining emotional reactions or "how things feel".
Scripting role playing has the advantage of allowing the trainer or instructor to design role plays that are structured specifically to create certain specific learning outcomes.