This article's documentation is for anything that uses the Source engine. Click here for more information.

Point devshot camera: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(→‎Basic Usage: why couldn't it be %mapname%_devshots.txt instead….)
 
(One intermediate revision by the same user not shown)
Line 36: Line 36:
</source>
</source>
}}
}}
{{important|This is the ''same file'' that is read for map descriptions in certain games (such as {{css}} {{csgo}} {{dods}} {{tf2}}). Make sure to rename it before packing and distributing the map!}}
=== Command line arguments ===
Launching the game with {{code|-makedevshots}} prints a few relevant [[command line options|command line arguments]] to the operating system's command prompt/terminal.
<pre>
-makedevshots usage:
  [ -usedevshotsfile filename ] -- get map list from specified file, default is to build for maps/*.bsp
  [ -startmap mapname ] -- restart generation at specified map (after crash, implies resume)
  [ -condebug ] -- prepend console.log entries with mapname or engine if not in a map
  [ +map mapname ] -- generate devshots for specified map and exit after that map
</pre>


== Keyvalues ==
== Keyvalues ==

Latest revision as of 08:18, 15 December 2025

Recycle-warning.png
This is a preserved entity in Counter-Strike: SourceHalf-Life 2: DeathmatchLeft 4 DeadLeft 4 Dead 2Portal 2Counter-Strike: Global Offensive
If the game has round restart mechanics this entity may not behave as expected.
C++ Class hierarchy
CPointDevShotCamera
CBaseEntity
C++ point_devshot_camera.cpp
Point viewcontrol.png

point_devshot_camera is a point entity available in all Source Source games. It is used by the -makedevshots system, which automatically takes screenshots at the position of every devshot camera in the level.


Basic Usage

Place a point_devshot_camera entity in your map and give it a name, the name of the area it looks at is a good name. If you want you can make sure the angle and location are good by using spectate ingame and also getpos in the console to find your co-ordinates and angle. Adjust the FOV to match what you're using ingame if you wish and that's all the entity itself needs.

Next, open up your compile options and either in the input bar at the bottom of the Normal mode add -makedevshots or in the $game_exe section of the Expert mode add the same thing. Make sure you remove options such as -dev so that your screenshots don't have the console in them!

Once you have compiled your map the mod will load up and just let it be, it will load the map and take the screenshots automatically. The screenshots will be saved to <mod>/screenshots/<mapname>/<cameraname> as TGA files.

An example of what can be achieved with these from Team Fortress 2(Archive)

Icon-Bug.pngBug:In Team Fortress 2 the first camera placed (with the lowest ID) may take a screenshot of the starting chalkboard. It is advised to create a fake first camera to prevent the actual first's images being of nothing but the chalkboard.  [todo tested in ?]

Devshot cameras can be loaded from a text file in the maps folder with the same name as the map, but with the extension *.txt, using standard keyvalue syntax. It's the same data as the entity keyvalues in Hammer.

Example
MapCameras
{
	TestCamera1
	{
	origin	"256 256 256"
	angles	"-15 50 0"
	FOV	90
	}
	
	TestCamera2
	{
	origin	"-256 -256 -256"
	angles	"90 0 0"
	FOV	90
	}
}
Icon-Important.pngImportant:This is the same file that is read for map descriptions in certain games (such as Counter-Strike: Source Counter-Strike: Global Offensive Day of Defeat: Source Team Fortress 2). Make sure to rename it before packing and distributing the map!

Command line arguments

Launching the game with -makedevshots prints a few relevant command line arguments to the operating system's command prompt/terminal.

-makedevshots usage:
  [ -usedevshotsfile filename ] -- get map list from specified file, default is to build for maps/*.bsp
  [ -startmap mapname ] -- restart generation at specified map (after crash, implies resume)
  [ -condebug ] -- prepend console.log entries with mapname or engine if not in a map
  [ +map mapname ] -- generate devshots for specified map and exit after that map

Keyvalues

Name (targetname) <string>
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also: Generic Keyvalues, Inputs and Outputs available to all entities
Camera Name (cameraname) <string>
Used as the name of the directory to store screenshots from this camera. Must be unique within the level.
Warning.pngWarning:Failing to set a name will lead to the screenshot process failing at runtime
Camera FOV (FOV) <integer>
FOV of this camera.
Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

Inputs

TakeScreenshot  (only in Portal 2: Community Edition)
Teleport and take a screenshot from this camera (Softlocks the player. Restart the map)