I've been trying to make a simple drag race scenario but I'm having a hard time. As far as I can tell, there are no "goals" that detect when the AI has passed a waypoint? I just want the scenario to fail the user if the AI car passes a waypoint first. And since I'm here, is there anyway to allow the players car to rev beyond about 2500 rpm during the scenario count down?
I created a race scenario but my AI car won't drive, here is my .prefab and .json file. Much of it is copy pasted from the drag race scenario from jungle rock island, the scenario im creating is in Hirochi Raceway. Yellow AI car wont drive .json Code: [ { "name": "scenarios.jungle_rock_island.drag_race.title", "description": "scenarios.jungle_rock_island.drag_race.description", "authors": "BeamNG", "difficulty": "55", "date": 1456401873, "levelObjects": { "tod" : { "time" : 0.85, "dayLength" : 120, "play" : false, }, }, "blackListActions": ["toggleShifterMode"] "lapConfig": ["wp_player_target"], "radiusMultiplierAI": 3, }, ] .prefab Code: //--- OBJECT WRITE BEGIN --- $ThisPrefab = new SimGroup() { canSave = "1"; canSaveDynamicFields = "1"; groupPosition = "0.000000 0.000000 0.000000"; new BeamNGWaypoint(wp_target_distance) { drawDebug = "0"; position = "-350.248993 169.878006 24.8045006"; rotation = "1 0 0 0"; scale = "1 1 1"; canSave = "1"; canSaveDynamicFields = "1"; }; new TSStatic() { shapeName = "levels/jungle_rock_island/art/shapes/race/race_rally_finish_checkpoint_red.dae"; playAmbient = "1"; meshCulling = "0"; originSort = "0"; useInstanceRenderData = "0"; instanceColor = "White"; collisionType = "Collision Mesh"; decalType = "Collision Mesh"; allowPlayerStep = "1"; prebuildCollisionData = "0"; renderNormals = "0"; forceDetail = "-1"; position = "684.166 -550.067 160.5"; rotation = "0 0 1 141.857"; scale = "1 1 1"; canSave = "1"; canSaveDynamicFields = "1"; }; new TSStatic() { shapeName = "levels/jungle_rock_island/art/shapes/race/race_rally_finish_checkpoint_red.dae"; playAmbient = "1"; meshCulling = "0"; originSort = "0"; useInstanceRenderData = "0"; instanceColor = "White"; collisionType = "Collision Mesh"; decalType = "Collision Mesh"; allowPlayerStep = "1"; prebuildCollisionData = "0"; renderNormals = "0"; forceDetail = "-1"; position = "707.797 -530.368 160.193"; rotation = "0 0 1 139.809"; scale = "1 1 1"; canSave = "1"; canSaveDynamicFields = "1"; }; new BeamNGWaypoint(wp_player_target) { drawDebug = "0"; position = "-386.574005 236.376999 24.9909"; rotation = "1 0 0 0"; scale = "6 6 6"; canSave = "1"; canSaveDynamicFields = "1"; }; new BeamNGWaypoint(wp_ai_target) { drawDebug = "0"; position = "-386.574005 236.376999 24.9909"; rotation = "1 0 0 0"; scale = "6 6 6"; canSave = "1"; canSaveDynamicFields = "1"; }; new BeamNGVehicle(aiCar) { JBeam = "sbr"; color = "0.996078 0.960784 0.00392157 1.248"; colorPalette0 = "White"; colorPalette1 = "0.5 0.5 0.5 0"; colorPalette2 = "White"; colorPalette3 = "White"; partConfig = "vehicles/sbr/hillclimb.pc"; renderDistance = "500"; renderFade = "0.1"; isAIControlled = "0"; dataBlock = "default_vehicle"; position = "-390.542633 251.309128 25.2136135"; rotation = "0.0859509 0.00601851 -0.996281 40.9113"; scale = "1 1 1"; canSave = "1"; canSaveDynamicFields = "1"; }; new BeamNGVehicle(scenario_player0) { JBeam = "sbr"; color = "0.0784314 0.109804 0.568627 1.132"; colorPalette0 = "White"; colorPalette1 = "White"; colorPalette2 = "White"; colorPalette3 = "White"; partConfig = "vehicles/sbr/hillclimb.pc"; renderDistance = "500"; renderFade = "0.1"; isAIControlled = "0"; dataBlock = "default_vehicle"; position = "-397.632874 253.663025 25.2136135"; rotation = "0 0 -1 40.5897"; scale = "1 1 1"; canSave = "1"; canSaveDynamicFields = "1"; }; }; //--- OBJECT WRITE END ---
(slight bump) Ok, I found out the answer to my other question. But whenever I repack the scenario folder thingy, It doesn't ask me where to save it to. Everything else about it seemed to work, until I reloaded it with all seven of my checkpoints (since it didn't save a .prefab AFIAK, I filled in the waypoints section myself.) None of the checkpoints were there except the first one, but when I went into the level editor, all the yellow sphere checkpoint thingies were where I put them. Here are some pictures to help: How I set it up in Notepad++ Showing my Waypoints
Some things changed since I wrote this guide. The prefab saving should happen correctly in Documents/BeamNG.Drive/levels now. As for your problem, please note 'waypoints' vs 'Waypoints'. It's case sensitive IIRC.
Scenarios and Time Trials seem pretty similar in-game, and in the game files. Are there are any major differences between the two that I should know about? I can't find a guide or any information at all on the creation of Time Trials, but I don't see them being much different than Scenarios - That's why I'm asking in this thread. I have several scenarios I made for personal use that are simply short circuits that I wanted to time myself around, so I feel like turning some into Time Trials as I'd have a leader board of my results.
They are indeed pretty similar, and the creation process is the same. There are some differences though, if i remember correctly the main differences are : - The folder they're in - In the .prefab, the player position is no longer 'scenario_player0', it's represented by various spawn spheres for each case (normal, rolling start, etc...). The best thing to do is to copy-paste a spawn-sphere from an existing quickrace and change it's name. - In the .json the 'vehicle' field is no longer needed, and a bunch of new fields are in place - There are brackets on the .json that are here on scenarios and not in quickrace Anyway, it's easy to port scenarios to quickraces, the best way to do it is to open official files on one side and your scenario files in the other, then play a game of spot the differences. The name of the fields are pretty clear, so it should be easy to guess what the new functions does. EDIT : You could also check my Juggernaut scenarios, they have scenarios and quickraces for the same track, so it will be even faster to spot the differences. And while I'm at it, here are some useful things about quickraces : - prefab named yourQuickraceName_forward and yourQuickraceName_reverse are only loaded when the quickrace is not in reverse for the 1st one, and in reverse for the second one. Useful for signs for example - If you want to have custom lua extensions, the game looks for the .lua file to load in levels\theLevel\theQuickraceName.lua, and not in levels\theLevel\quickrace\theQuickraceName.lua. It doesn't work like the scenarios that looks in levels\theLevel\scenarios\theScenarioName.lua.
Thanks Nadeox1 for a wonderful tutorial for how to create a scenario. just one doubt, how can I include my "mod" vehicles in the scenarios. I remember when I went to try for first time it was telling to specify the correct path. Please help....
Nadeox1 how to enter date after creating your own scenario?? when i tried to enter date normally it didn't accept. is there any special method to enter the creation date?
Dates are based on unix timestamp. Simply go here, and copy/paste the current unix time: https://www.unixtimestamp.com/
Thanks Nadeox1. One more doubt I have how to create races with 4 or 5 opponents in scenarios? Do you have any tutorial on this? 'cause half coding is done in Lua and i don't know how to do it??
Please help, something gone wrong while making my scenario, the car i want to place is not going smooth...seems like I pressed a wrong key by mistake!! See the video i have uploaded
It seems like you enabled grid snapping. Clicking on the icon I circled should fix the problem. About the AI races, yes you will have to do some coding in Lua. I would recommend making a bunch of simpler scenarios (point A to B races) before to familiarize yourself with the scenario creation process.
Thanks for your help! RyvyLo. about the AI races i'm just skeptical . i copy and paste the codes from other scenarios but AI is in no mood to race with me
hey does anybody know the lua programming for a police scenario where we have to chase two suspects. I want to make this scenario...i'm excited but the programming part is making me nervous!!
I have some code for that. Paste this in a blank lua file: https://pastebin.com/0CUgEfuj This code supports 3 evading suspects. I could make this more automatic, but I'm too lazy right now; I put this together really hastily. Make sure you edit the "nonPlayers" line. Don't forget to remove the "goal purpose = win" line in your json file. Also, the lua file has to be named the same as the other scenario files.
--- Post updated --- so like always im trying to create a race with one opponent same like the scenario "Mountain Race". but problems are not leaving me the AI only goes through 3 checkpoints (ignoring rest of the 16 checkpoints) and retrieves to the starting line again.. i don't know what is the reason behind this?? i copied the same lua code which was for the WCUSA's Mountain Race and made some changes but still it is the same. View the video down: ALSO THANKS GAMERGULL FOR THE EVADING SUSPECTS LUA CODE
I've always wanted to make my own races, so I'll try to help. I set up a test scenario, copied the code, and modified it to match my object names. It seemed to work fine. Double check your waypoint names, I guess? (By the way, I think I found a bug! There's no "aiInstance" variable declaration in the original mountain race code. It won't detect the AI if it wins.)
I created a police chase with two opponents successfully; all thanks to you Gamergull for providing the Lua code. next i want to create a race with 3 opponents..currently working on it
I have created my scenario "west coast chase series" and posted it under scenarios category..it is displaying some message that your mod is currently awaiting approval......what does that mean??
Ah, that's normal. One of the staff has to play and approve your mod to make sure that it works for everyone and is of decent or better quality. The staff can be busy, so this takes up to a week. It can be hard to contain your excitement (sure was for me! lol) but eventually, you get a message of approval. I like police chases, I'll be sure to check it out.