Closed ohlidalp closed 1 year ago
Very nice! Hopefully later on it'll be possible move road points the same way as other objects, (Character freezes in place, use arrow keys to adjust position + press R
to switch rotation axis)
@tritonas00 requested an option to export road points as AI waypoints. I added 2 sliders to specify a range, and an export button:
While at it, I also implemented an import of AI waypoints as procedural road points, with the same controls:
@CuriousMike56 Hopefully later on it'll be possible move road points the same way as other objects
Eventually yes, but not in this PR. That logic is hardcoded and somewhat dirty (reuses existing hotkeys), I don't want to extend it any further.
Road smoothing is real!
UPDATE: now supported by the TOBJ file format!
I actually developed this a year ago and it's been collecting dust in my git fork, I'm happy I finally integrated it.
It's complete. Not perfect but helpful. Hotkeys:
// Road editing
{"ROAD_EDITOR_POINT_INSERT", "Keyboard EXPL+INSERT", _LC("InputEvent", "insert road point") },
{"ROAD_EDITOR_POINT_GOTO", "Keyboard EXPL+G", _LC("InputEvent", "go to road point") },
{"ROAD_EDITOR_POINT_SET_POS", "Keyboard EXPL+M", _LC("InputEvent", "set road point position") },
{"ROAD_EDITOR_POINT_DELETE", "Keyboard EXPL+DELETE", _LC("InputEvent", "delete road point") },
{"ROAD_EDITOR_REBUILD_MESH", "Keyboard EXPL+B", _LC("InputEvent", "regenerate road mesh") },
This introduces scripting API for full procedural road management and also bundled script "road_editor.as" which allows interactive road editing!
To start the editor script, open console and say "loadscript road_editor.as".
Features:
You can also script custom meshes using
addQuad()
andaddCollisionQuad()
. AngelScript API documentation will be available at https://developer.rigsofrods.org/d4/d07/group___script2_game.html once this PR is merged.