> For the complete documentation index, see [llms.txt](https://g3m.gitbook.io/g3mwiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://g3m.gitbook.io/g3mwiki/main/g3mlib/getting-started.md).

# Getting started

Create a .NET 10 application and reference the package:

```
dotnet new console --framework net10.0 --name DataInspector
cd DataInspector
dotnet add package G3MLib --version 1.0.1
```

## Read a DATA file

Replace the console application's `Program.cs` with:

```csharp
using G3MLib.DataFile;

if (args.Length != 1)
{
	Console.Error.WriteLine("Usage: DataInspector <data-file>");
	return;
}

using var input = File.OpenRead(args[0]);
using var data = GameMakerIO.Read(input,
	warningHandler: (warning, isImportant) => Console.Error.WriteLine(warning));

Console.WriteLine(data.GeneralInfo?.DisplayName?.Content ?? "Unnamed game");
Console.WriteLine($"Rooms: {data.Rooms?.Count ?? 0}");
Console.WriteLine($"Sprites: {data.Sprites?.Count ?? 0}");
```

Run it with an actual GameMaker resource file:

```
dotnet run -- /path/to/data.win
```

Use the same file you intend to inspect or patch, including its platform and game release. A `.win` extension does not make an arbitrary file a readable DATA file.

## Pick the API level

Use `GameMakerData` for direct resource edits. Use `PatchService` when the result should be a distributable changeset. Use `MergeService` for combining patches against one original. Use `ProjectContext` for a project of exported assets and configured installation actions.

These outputs have different formats. A `.g3mpatch` manifest is not `mod_config.json`, and a resource project is not a G3M profile.

Examples in this section use separate outputs. Keep the original and companion resources until the result has been read back and playtested.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://g3m.gitbook.io/g3mwiki/main/g3mlib/getting-started.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
