I have not found an easy way to add the number laps after a scenario has been fully loaded and in running mode. It looks like we cannot change the scenario table in the scenarios file from any other function except for executeScenario but If I do this it completely reloads the scenario again. The only other option I see is to create a quickrace which creates a whole other set of problems. Any idea's?
I created a function to do this. It takes the current scenario file and creates a function to update the scenario. It then resaves the scenario back with the new function. local function updateScenarioData(scenario) local newScenario = scenario local copyScenario = scenario_scenarios copyScenario['setScenario'] = function(sc) scenario = sc end scenario_scenarios = copyScenario scenario_scenarios.setScenario(newScenario) end