HL2DM Vehicle Fix

From Valve Developer Community
Jump to: navigation, search

HL2DM Vehicle Prediction (Partial-Fix)

After many days of research and work, I have: A working predicted vehicle! O.k first things first:


Step 1

Make a mod for HL2MP.

Step 2

Build the code so you don't need to wait a long time once you input the new code to find errors.

Step 3

Next, follow this tutorial:

Step 4

Compile and fix any errors. (Right now your vehicles are predicted BUT the camera does not work, so now we are going to fix this )

Step 5

Open hammer using your mod and create a prop_vehicle_jeep or airboat. If you use the jeep make sure you assign the "buggy" model to it or else its just a red cube O.o. Next name the vehicle.

Step 6

Make a point_viewcontrol and move it to where you would like the camera to be when your are in the vehicle. Name it, and parent it to the vehicle. (Do NOT assign a "entity to look at" or else it will not work). Next set the flags "Infinate hold time" and "Interruptable by player" and un-check all the others.

Step 7

Next go back to the vehicle and open the "output" tab. Create a new output and set it as the following:

My output named: PlayerOn Target entity: "camera name" Via this input: enable

Create another and make it:

My output named: PlayerOff Target entity: "camera name" Via this input: disable

  • Optional*

Group the vehicle and camera and move then to the center of grids, then make into a prefab so you can spawn them easily

You now have a working vehicle to use in MP! For multiple vehicles in a level you need to make the names different such as add numbers to the names. I hope this will help you in the future who like me ran into this problem while making a mod. I'm sure if other coders helped make a code for a built in camera this would be very helpful!