I’m trying to use beamngpy to automate some tests. How can I identify a map I downloaded when creating the scenario?
I downloaded a map called endless highway and I would like to be able to use it with beamngpy’s Scenario class
I’m trying to use beamngpy to automate some tests. How can I identify a map I downloaded when creating the scenario?
I downloaded a map called endless highway and I would like to be able to use it with beamngpy’s Scenario class
Hi Matheus,
To use the downloaded map “Endless Highway” with BeamNGpy, you’ll need to reference the exact level name as it’s specified in the mod files. For example, if the map’s folder name is “EH”, you should use that name when creating your scenario.
Here’s a sample script:
from beamngpy import BeamNGpy, Scenario, Vehicle
bng = BeamNGpy('localhost', 64256)
bng.open(None, '-gfx', 'dx11', listen_ip='*', launch=True)
vehicle = Vehicle('etk800', model='etkc', license='BeamNG', color='Black')
scenario = Scenario('EH', 'myEndlessHighway')
scenario.add_vehicle(vehicle, pos=(0,0,23.24), rot_quat=(0, 0, 0, 0.9238795))
bng.load_scenario(scenario)
bng.start_scenario()
In the above code, replace 'EH' with the exact level name used by the mod if it’s different. This way, BeamNGpy knows where to load the map from. You can use any normal BeamNGpy script and simply update the level name.
Let me know if you need more details or have other questions!