|
Post by Ra1pid on Aug 10, 2021 12:21:52 GMT
So I was asked a few times about how to edit maps, and with a recent YT comment asking about adding roads, I think it's best to write a tutorial here about the process of doing so. All parts done! Check the next posts for the next parts of the tutorial.First, let's talk about editing maps. If you want to edit a map, first locate the archive in which it is stored. When you run RoR, the address to the archive will show up in the description. Steps to prepare a map for editing:1. Create a copy of the archive to edit. It's always best to keep an unedited version of the map as a backup. 2. Extract .terrn2, .tobj and .odef files so that you can open them with a text editor. You will need to edit these files to edit your map. 3. Rename these files:- .terrn2 - Defines the terrain. Open each .terrn2 file in the archive to select for editing. Delete all other unnecessary .terrn2 files.
- .tobj - Defines the terrain objects. In the .terrn2 file you selected, the name of the .tobj file you need to use will be listed.
Make sure these two files are renamed before you continue. 4. Edit file contents:- .terrn2
Name ~ Indicates name of map. Change to differentiate from original. [Objects] ~ Heading for .tobj file listed below. Make sure the .tobj file name matches with your newly renamed .tobj file.
5. Once you've done these steps, your map is ready for editing. Steps on editing a map by adding objects coming soon. Cheers, ~ Ra1pid
|
|
|
Post by Ra1pid on Aug 11, 2021 12:33:40 GMT
Editing a map by adding objects To add any object, including roads, to a map, you will have to add an entry for each object instance in the .tobj file. Currently, there is a default road object already defined in RoR, so you can use that in any .tobj file. The format for a simple entry in the .tobj file is this:
x, y, z, rx, ry, rz, odefname Parameters:
x,y,z : Coordinates to place the object (x, y and z values).
rx,ry,rz : Rotation according to x, y and z axes.
odefname : Name of the object (without .odef extension). Here is an example entry used in Beach Road:
1024, 3, 619, 90, 0, 0, BeachRoad
Steps to place an object on a map: 1. Start RoR and enter the map. You can acquire some coordinates in-game. 2. Move the player/vehicle position to where you want to place the object and press hotkey H. This will print out the player position to the RoR.log. * Alternatively, you can enter the Console in-game and type the command pos . You can then copy the line from the Console and paste it elsewhere to use. This will only give you the player coordinates and no rotation values. 3. Exit RoR and open up Rigs of Rods/logs/RoR.log If you used the hotkey method, the registered coordinates will be stored here. 4. In RoR.log, search for 'Position:' and copy all lines starting with it. These are the coordinates you registered in-game. Example of such a line: 17:46:30: Position: 875.549, 67.6607, 1155.26, 0, 366.073, 0 5. Paste them in the .tobj file and remove the timestamp and Position parameters. The resulting line should look like this:
875.549, 67.6607, 1155.26, 0, 366.073, 0 6. Add a comma after the last parameter, and then enter in the name of the object you want to use for each line. A sample line should look like this:
875.549, 67.6607, 1155.26, 0, 366.073, 0, road 7. Save the .tobj file and transfer it into map archive. 8. Run RoR and enter the map. Chances are the objects may be rotated badly, but that can be fixed later on.
Next part will be on editing object placements in the map. Cheers, ~ Ra1pid
|
|
|
Post by Ra1pid on Aug 12, 2021 13:14:35 GMT
Editing object placements in a map To edit the objects in your edited map, there are 2 ways to do so: 1. Manually edit the coordinates and rotation by trial and error (very hard) 2. Use Terrain Editing mode in-game. (easier) This tutorial will cover how to use the Terrain Editing mode to edit the objects you placed in the map. Since this mode cannot move roads, Paged Geometry trees or grass, you will have to use a custom road object in place of the default road object. Attached below is the BeachRoad object that you can use in your map. Simply drag all files into the map's archive. beach road.zip (235.46 KB) In the .tobj file, rename all road objects to BeachRoad and save it into the archive. Steps to use Terrain Editing mode to edit objects1. Start RoR and enter the map.2. Press Ctrl+Y to enter Terrain Editing mode. Now you will be able to edit the terrain objects. List of Controls for the Terrain Editing mode:CTRL+ Y - Activates the editor Enter - Selects nearest object based on free camera or RoRBot's position Middle mouse click - Select object CTRL+ [ and CTRL+ ] - Cycles through objects as listed in the `.tobj` file. If the terrain features a race, race checkpoints will appear first. W A S D - Movement (only in same elevation level) Up and Down Arrow Keys - Movement up and down Left and Right Arrow Keys - Rotation R - Change rotation axis I - Reset object rotation CTRL+ Y - Exit editor and save changes
3. Move the camera or walk to the nearest road object and press Enter. This will select the road object to edit. If the road isn't selected, you can move hit Enter again to exit and try to get closer to it, or simply cycle through the objects ( CTRL+ [ and CTRL+ ]) till you select the road object. 4. Use Left and Right Arrow keys to rotate the object, and hit R to change the rotation axis. If the rotation has gone awry, hit hotkey I to reset it. 5. Use W A S D to move the object around and Up and Down Arrow keys to change its elevation level.6. Once you've finished editing the object, repeat steps 3-5 for each object that you need to edit.7. After editing all the objects, press CTRL+Y to save the changes and exit the editor. 8. Exit RoR and open Rigs of Rods/config/editor_out.cfg You can open .cfg files with a text editor. 9. Copy all the lines with the objects you edited in-game. If you used BeachRoad, then copy all lines with the term BeachRoad. 10. In the .tobj file of the map you edited, replace the lines defining the unedited objects with the copied lines. If you used BeachRoad, then replace all lines using that term with the newly copied lines from the .cfg file. 11. Save the .tobj file and transfer it into the edited map archive.12. Open RoR and enter the edited map to check the changes. If you need to make adjustments, you can simply repeat steps 2-11 to do so. Good luck! ~ Ra1pid
|
|