Modding Tools > Lucas' Simpsons Hit & Run Map Builder > Tutorials > Map Building Tutorials > #5: Adding Static Phys Collision

#5: Adding Static Phys Collision

This tutorial will guide you through adding some Static Phys collision to your map.

This type of collision is made up of boxes, spheres and cylinders.

Prerequisites

You will need the following to accomplish the steps in this tutorial:

  • The Simpsons Hit & Run for PC
  • Lucas' Simpsons Hit & Run Mod Launcher
    • Used to run a mod to actually try the map out ingame.
  • Lucas' Simpsons Hit & Run Map Builder
    • Used to actually build the map of course.
  • SketchUp Make 2017
    • Knowledge of how to use SketchUp in general will help as these tutorials will assume you're already at least a bit familiar with the software.
    • SketchUp Make 2016 as well as newer versions of SketchUp Pro may also work but these tutorials are created with Make 2017 in mind.
  • An advanced Text Editor, we recommend Notepad++ or Visual Studio Code
    • This is because you'll be working with XML files which are easier to edit in these programs.
  • Following the previous tutorials

Step 1: Importing the collision components

Much like Locators, collision objects have a few Special Components:

Go to File > Import and navigate to the Components folder next to the Map Builder's executable. From there, import "CollisionBox.skp" into your mod.

This will attach an instance of it on your cursor and you can go ahead and place it down anywhere on your terrain.

Repeat this for "CollisionCylinder.skp" and "CollisionSphere.skp".

Once you have all three components imported, go to the Components panel and click the little house icon to bring up the list of components in the current model. You should see all 3 of the components listed if you imported them correctly.

components panel with collision components

Step 2: Adding some collision

For this step, just go ahead and add a few of these collision components to your map.

a few collision components

Once you add some, select all of them and right click to make them into a group.

In order to make this into Static Phys collision, you need to use the appropriately named StaticPhys group tag.

This tag has a few parameters that follow it:

  • ClassTypeID: The Class Type ID
  • ATCEntry: TODO.
  • SoundResourceName: TODO.

These parameters represent the values stored in the Collision Effect chunk inside the Static Phys chunk.

Radical typically uses 7, 0 and nosound for these parameters.

For the purposes of these tutorials, go ahead and use these values on your group. Once you're done that, your outliner should look something like this:

static phys group in outliner

If you created this group outside of your "Zone001" group, make sure to drag it inside it to make it apart of that zone.

Step 3: Build and check it out ingame

There's no new rules to add for static phys collision (they're handled by the BaseZone ModelOutputInstructions) 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 your collision should work ingame:

static phys ingame

You should notice that your Static Phys collision is invisible ingame despite being visible in SketchUp. This is because the collision components use the NonWorldMesh group tag to tell the tool to not build their meshes as Static Entities.

Extra: Flat End Cylinders

It should be noted that, by default, all CollisionCylinder components build cylinders with rounded ends.

You can use the FlatEnd group tag on one of these components to make them have flat ends instead.

flat end tag in outliner

You're done!

That's it for this tutorial. You're ready to move on to the next one.

Donut Team © 2023 · v4.0