New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Procedural road editing using AngelScript #2976
Conversation
CODECHANGES: * new file ProceduralRoadAngelscript.cpp - binds ProceduralPointClass, ProceduralRoadClass, ProceduralObjectClass, ProceduralManagerClass * ProceduralRoad.h/cpp - added strong enums RoadType and TextureFit - extracted from class ProceduralRoad * TerrainAngelscript.cpp - added getter for procedural manager. * TObjFileFormat: accomodated new pointer type. rebase and fixup -- factory functions
To start it, open console and say "loadscript road_editor.as" Existing features: * add or remove roads * add or remove road points * move existing points using mouse * add new points at character position * build custom mesh using `addQuad` Planned features: * export roads in the 'editor_out.txt' file * select road segment type (pillars, borders...) * road smoothing with custom max. seg. length * adjustable min height above terrain * editable point height above terrain
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 |
New script API: * game.addWaypoint(vector3)
@tritonas00 requested an option to export road points as AI waypoints. I added 2 sliders to specify a range, and an export button: |
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. |
7d253ec
to
5d4f85c
Compare
Note: params rotX and rotZ are unpredictable and the exporter always sets them to zero. Param rotY is anticlockwise yaw around global Y, in degrees.
5d4f85c
to
59f254e
Compare
Old bug, pre-dates the standalone TObjParser
e5584b3
to
3719127
Compare
Currently cannot be controlled from TOBJ file format, only from scripting. New script API: * ImGui::SetNextItemWidth(float) * ImGui::InputInt(string, int&) * int ProceduralObjectClass.smoothing_num_splits
3719127
to
217a361
Compare
It's complete. Not perfect but helpful.
|
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.