Hello everyone! I have two questions. First- what is the vehicles names I should use for game files? I noticed the d15 uses "pickup", and the covet uses "hatch". What are the names of the other vehicles? Second- how can I trigger events during a scenario? I mean, after you cross a certain waypoint, I want something to happen. How can I do it?
And for the second one, you can trigger events after crossing a waypoint using this lua code : Code: local function onRaceWaypoint(data, goal) if data.waypointName == 'yourWaypointNameHere' then theEvent() end end return { onRaceWaypoint = onRaceWaypoint, }
Ok, thanks for that. Although I was hoping for a way to do it through the new scenario creation format. The way its done through the scenario.json I have created a few lua scripts but it seems they didn't work after the latest update. Did you have any issues with this?
Um... I understand the code, but since I'm new to modding in Beamng, is there a way where I can see what events commands exist? I mean, I have no idea what syntax and what commands should be in the "TheEvent()" section. If there's a tutorial to .lua files usage, it would be useful if someone could link it for me.
Yeah this is the hard part, understanding what command does what. If you don't know how to use Lua but you understand the principle of programmation, it's easy to learn it with google. There's some BeamNG specific lua documentation on the wiki and in "BeamNG.drive\lua\lua-doc.zip" but it's hard to understand what arguments corresponds to what. The best way I found is to open other scenarios's Lua and see what's possible ( Scepheo's scenarios are the best, especially the Random Tour one ). There's also a script extender called bnse which add a lot of events and has a clear and easy to understand documentation, I recommend to check it out.