Extracts callouts from .vpk maps using ValveResourceFormat. The callouts are defined in env_cs_place entities. English localizations for the place names have been copied from the valve wiki.
The CS2CalloutExtractor.Cli is a command-line tool for extracting callouts from .vpk files and outputting them in JSON or CSV format.
Download the latest release for your platform from the Releases page.
Run the CLI with the following options:
CS2CalloutExtractor.Cli <pakFilePath> [--format <json|csv>] [--output <file>]pakFilePath(required): Path to the.vpkfile to extract callouts from.--format(optional): Output format. Can bejsonorcsv. Defaults tojson.--output(optional): Path to the output file. If not specified, the output will be printed to the console.
CS2CalloutExtractor.Cli "path/to/file.vpk" --format jsonCS2CalloutExtractor.Cli "path/to/file.vpk" --format csv --output callouts.csvThe CS2CalloutExtractor library provides functionality to extract callouts from .vpk files. It can be used in other .NET projects to programmatically access callout data.
You can install the library via NuGet:
dotnet add package CS2CalloutExtractorHere’s an example of how to use the library:
using System;
using System.Collections.Generic;
using System.IO;
using SteamDatabase.ValvePak;
using CS2CalloutExtractor;
using var package = new Package();
package.SetFileName("path/to/file.vpk");
package.Read(File.OpenRead("path/to/file.vpk"));
var localizedNames = new Dictionary<string, string>
{
{ "place_name_1", "Localized Name 1" },
{ "place_name_2", "Localized Name 2" }
};
var callouts = new ReadCallouts(package, localizedNames).Read();
foreach (var callout in callouts)
{
Console.WriteLine($"Name: {callout.Name}, MinBound: {callout.MinBound}, MaxBound: {callout.MaxBound}");
}Thanks to @ValveResourceFormat for making a great library that was used to extract the correct data.
The solution was heavily inspired by @hjbdev's cs2-vmap-tools, but I liked the challenge to be able to do it without decompiling the full map. His blogpost Counter-Strike 2: Where are the callouts stored? was a great help.
- .NET 9 SDK or later
- Visual Studio Code or another IDE
To build the library and CLI:
dotnet builddotnet run --project CS2CalloutExtractor.Cli -- <pakFilePath> [--format <json|csv>] [--output <file>]Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.