Prop vehicle apc

From Valve Developer Community

Table of contents

Entity Description

A prop_vehicle_apc using its typical models/combine_apc.mdl model.
Enlarge
A prop_vehicle_apc using its typical models/combine_apc.mdl model.

A Combine APC vehicle with mounted guns, that can be blown up and driven by a vehicle driver or a npc_apcdriver.

It can not be driven by the player, even with a different vehicle script file. (It is "enterable", but that's it. You will just get stuck under the vehicle, facing to the right, and most importantly won't be able to exit the APC again. To prevent the vehicle from being entered, you should set its VehicleLocked (Start locked) keyvalue to Yes.)

The APC should generally be given the models/combine_apc.mdl world model and the scripts/vehicles/apc_npc.txt vehicle script file. To have the APC drive and/or shoot, create an npc_apcdriver and assign the APC to its vehicle (Vehicle to drive) keyvalue.

The wheels of the prop are not solid, but you can prevent the player going through them by immersing them within one or more Player Clip brushes.

Keyvalues

Defines the name that other entities refer to this entity by.
  • hammerid [Episode Two Update]
<integer readonly> This id is used for debugging purposes in Hammer.
  • origin
<origin> The position of this entity's center in the world. Rotating entities rotate around their origin.
  • globalname
<string> Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
Pitch Yaw Roll (Y Z X)
This entity's angular orientation in the world (also used for angular effect entities).
  • mindxlevel
<choices> Minimum DX Level
Literal Value Description
0 default (lowest)
70 dx7
  • maxdxlevel
<choices> Maximum DX Level
Literal Value Description
0 default (lowest)
60 dx6
  • model
<studio> World Model (Maximum string length: 128)
  • skin
<integer> Some models have multiple versions of their textures called skins. Set this to a number other than 0 to use that skin instead of the default.
  • disableshadows
<boolean> Used to disable dynamic shadow casting from this entity.
  • solid
<choices> Collisions - using other values may give undesired results
Literal Value Description
0 Not Solid
2 Use Bounding Box
6 Use VPhysics
  • screenspacefade
<boolean> The method by which the fading distance should be determined. If off, the fade distances is the distance from the player's view to the object, in inches. If on, the fade distance is the size of the object onscreen, in pixels. The fademindist value will represent the number of pixels wide covered by the prop when it starts to fade, and the fademaxdist value will represent the *minimum* number of pixels wide covered by the prop when it fades.
  • fademindist
<float> Start Fade Dist/Pixels - Distance at which the prop starts to fade. (-1 = Use fademaxdist.)
Image:note.png Note: If this entity is in a 3D Skybox, this value will automatically be scaled properly.
  • fademaxdist
<float> End Fade Dist/Pixels - Max fade distance at which the prop is visible. (0 = Don't fade out.)
Image:note.png Note: If this entity is in a 3D Skybox, this value will automatically be scaled properly.
  • fadescale
<float> Fade Scale - If you specify a fade in the worldspawn, or if the engine is running under dx7, the engine will forcibly fade out props even if fademindist/fademaxdist isn't specified. This scale factor gives you some control over the fade. Using 0 here turns off the forcible fades. Numbers smaller than 1 cause the prop to fade out at further distances, and greater than 1 cause it to fade out at closer distances.
  • lightingorigin
<target_destination> Select an info_lighting to specify a location to sample lighting from, instead of using this entity's origin.
  • vehiclescript
<string> Vehicle Script File
Literal Value Description Comment
"scripts/vehicles/airboat.txt" Airboat Use prop_vehicle_airboat
"scripts/vehicles/apc.txt" APC Use prop_vehicle_apc
"scripts/vehicles/apc_npc.txt" NPC Driven APC Use prop_vehicle_apc
"scripts/vehicles/crane.txt" Crane Use prop_vehicle_crane
"scripts/vehicles/digger.txt" ---
"scripts/vehicles/driveway.txt" ---
"scripts/vehicles/fastdigger.txt" ---
"scripts/vehicles/jetski.txt" Jet Ski
"scripts/vehicles/prisoner_pod.txt" Combine Prisoner Transportation Pod Use prop_vehicle_prisoner_pod
"scripts/vehicles/reference_vehicle.txt" Modify this to make your own vehicle, or use it alone!
"scripts/vehicles/jeep_test.txt" Jeep Use prop_vehicle_jeep
"scripts/vehicles/choreo_vehicle.txt" [Episode One Update] Choreographed vehicle Use prop_vehicle_choreo_generic
"scripts/vehicles/choreo_vehicle_ep1_dogintro.txt" [Episode One Update] Episode 1 Dog Intro Choreo Use prop_vehicle_choreo_generic
"scripts/vehicles/choreo_vehicle_ep2_barn1.txt" [Episode Two Update] Episode 2 Barn Scene Choreo Use prop_vehicle_choreo_generic
"scripts/vehicles/choreo_vehicle_ep2_hangar.txt" [Episode Two Update] Episode 2 Hanger Ending Choreo Use prop_vehicle_choreo_generic
"scripts/vehicles/choreo_vehicle_ep2_intro.txt" [Episode Two Update] Episode 2 Intro Choreo Use prop_vehicle_choreo_generic
"scripts/vehicles/choreo_vehicle_ep2_Outland_02.txt" [Episode Two Update] Episode 2 Choreo Use prop_vehicle_choreo_generic
"scripts/vehicles/choreo_vehicle_ep2_playertrapped.txt" [Episode Two Update] Episode 2 Choreo Use prop_vehicle_choreo_generic
"scripts/vehicles/jalopy.txt" [Episode Two Update] Episode 2 Jalopy (Charger) Use prop_vehicle_jeep
  • actionScale
<float> Scale of action input / framerate
  • VehicleLocked
<boolean> Starts locked
  • missilehint
<target_destination> Name of one or more info_apc_missile_hint entities to use to determine what to hit.

Inputs

Defines the name that other entities refer to this entity by.
  • hammerid [Episode Two Update]
<integer readonly> This id is used for debugging purposes in Hammer.
  • Action <float>
Set the speed of the action animation
  • TurnOn
Turn on: Start engine & enable throttle
  • TurnOff
Turn off: Stop engine, disable throttle, engage brakes.
  • Lock
Prevent the player from entering or exiting the vehicle.
  • Unlock
Re-allow the player to enter or exit the vehicle.
  • HandBrakeOn
  • HandBrakeOff
  • FireMissileAt <target_destination>
A target to fire a missile at
  • Destroy
Causes the APC to blow up.

Outputs

Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
!activator = activator
  • PlayerOn
Player entered the vehicle.
!activator = player
  • PlayerOff
Player exited the vehicle.
!activator = player
  • PressedAttack
Player Pressed attack key
  • PressedAttack2
Player Pressed attack2 key
State of attack button. Also called when player exits vehicle
State of attack2 button. Also called when player exits vehicle
  • OnFiredMissile
Fired when the APC shoots a missile.
  • OnDeath
Fired when the APC is killed.
!activator = killer
  • OnDamaged [Episode One Update]
Fired when the APC is damaged.
  • OnDamagedByPlayer [Episode One Update]
Fired when the APC is damaged by the player.