Tutorial 2: Adding Roads
This tutorial will guide you through expanding the map created in Tutorial 1: Making a Basic Map with new Road intersects as well as adding a Road Network on top of them. It will also cover making a new HUD map that contains your new road meshes.
A road network is the series of interconnected Roads and Intersections that guide traffic and AI cars through the world.
You will need the following things to accomplish the steps in this tutorial:
- The Simpsons: Hit & Run for PC
- Lucas' Simpsons Hit & Run Mod Launcher
- Lucas' Simpsons Hit & Run Model Builder
SketchUp Make 2017
- Knowledge of how to use SketchUp in general will help as well as these tutorials may not go into very much detail about the specifics of how to use it.
- A Text Editor, we recommend Notepad++.
- The map created in Tutorial 1: Making a Basic Map
Part 1: The SketchUp File
Step 1: Expanding the map
In Tutorial 1, you created a small square. This doesn't really have any space for your Road network so the first thing you'll want to do is expand the map a bit.
First focus the "Zone001" group. Then you should add some 12 meter wide rectangles to each side of the map and some 12x12 squares to each corner. It would also be good to make some Materials and color them differently so they can be told apart.
After you make them, group the new shapes and name the group
Road [Intersect] [Road]. The new
[Road] tag on the end is how you tell the tool to include this mesh on the HUD map as roads.
When you're done, your outliner should look like this:
Step 2: Making the roads
Roads are very easy to create as they are just 1 or more connected lines with a special group name. Start by drawing 4 separate lines connecting the midpoints of each corner of the map.
Then select each line individually and group it. Once you have 4 groups tag them each with the following names:
Road001 [SimpleRoadPairRight]   
Road002 [SimpleRoadPairRight]   
Road003 [SimpleRoadPairRight]   
Road004 [SimpleRoadPairRight]   
In this case you use the
[SimpleRoadPairRight] tag to tell the tool that you want this line to be made into 2 parallel roads going the opposite direction of one another. The "Right" part means cars will drive on the right side of the road though there is an equivalent
[SimpleRoadPairLeft] tag. The 3 tags following that tag are as follows:
- Amount of traffic cars: The amount of traffic cars that can be on one side of the road at any given time. Use 0 to make it so there's no traffic.
- Lanes: The amount of lanes on the road. In this case, you want each side to just have 1 lane.
- Width: The width of the road. This is divided in half for each side of the road.
Step 3: Making the intersections
Intersections are also simple as they are just grouped circles. Draw 1 in each corner that fully covers the end of each road. Make sure to delete the face in each one, leaving just the edges of the circles.
Now select each circle individually and group it. Name each one with some tags as follows:
Intersection002 [Intersection] [Stop]
Intersection004 [Intersection] [Stop]
[Intersection] tag tells the tool that these circles should become Intersections. This example also adds the
[Stop] tag to the 2nd and 4th one which changes it so traffic will stop at these intersections instead of immediately continuing when they reach them.
Step 4: Making the Terra group
After you make the intersection groups, group all of them and the road groups from the previous step together and name the group "Terra" as these must go into the map's Terra file. This should leave your outliner looking like this:
Part 2: Configuring the Model Builder
Step 1: Including Base HUD Map rules
The first think you want to add to your rules is including the base HUD Map rules next to the Zone rules.
<Include Path="$(ModelBuilderPath)\Rules\HUDMap.xml"/> <!-- New Inclusion --> <Include Path="$(ModelBuilderPath)\Rules\Zone.xml"/>
Step 2: Adding a HUD Map file and Mesh
Now that you have the rules, you'll want to add a new OutputPure3DFile next to your other ones for the HUD Map as well as a mesh.
<!-- Make sure to change the level number in the file and mesh names to match the level --> <OutputPure3DFile Name="HUDMap" Path="$(OutputPath)\frontend\scrooby\resource\pure3d\l1hudmap.p3d"/> <Mesh Name="HUDMap"> <OutputPure3DFile Name="HUDMap" ChunkName="l1hudmapShape"/> </Mesh>
Step 3: Updating the ModelOutputInstructions
Next scroll down to your
ModelOutputInstructions named "Zone" and add a line to execute the new rules and one to set the
<ModelOutputInstructions Name="Zone"> <ExecuteInstructions Name="BaseHUDMap"/> <!-- New Instruction --> <ExecuteInstructions Name="BaseZone"/> <SetParameter Name="OutputHUDMapMesh" Value="HUDMap"/> <!-- New Instruction --> <SetParameter Name="VertexColours" Value="World"/> <SetParameter Name="FallbackMaterial" Value="Null"/> </ModelOutputInstructions>
Step 4: Build and check it out ingame
There's no new rules to add for the roads so you're actually already done!
Now it's time to run Build.bat to see if it works ingame.
If you've done everything right, the map should successfully build and look something like this.
That's it for this tutorial. If you'd like, you can download a completed ZIP of the mod created in this tutorial from the sidebar of this page (Tutorial 002 Complete.zip).
Up Next: ???