Skip to main content

Scripted mods

We picked our lane: scripted mods. This lesson breaks down what that means in practice, so you can see clearly what kind of programming we will be doing.

New behavior requires logic​

Tuning a config file lets you adjust a setting the game already knows how to read (a vehicle's speed, an ammo count). A scripted mod does something more: it introduces behavior that never existed before.

A bodyguard that follows you and only shoots back if someone targets you doesn't exist as a simple setting in a menu. For that to happen, a script needs to evaluate the situation every frame: is the player under attack? who is the aggressor? what task should the bodyguard receive? Making those decisions in real time is exactly what your code does.

Your code runs directly inside the game​

A scripted mod is not an external program watching the game from a distance. It runs directly inside GTA V's process, hosted by ScriptHookVDotNet.

Every frame, the game engine grants your script a brief slice of time to execute: you observe the environment, issue an action, and immediately return control back to the engine. That is why keeping your code lightweight and non-blocking is essential: your script shares runtime space with the game engine itself.

You command, the engine executes​

Good news: you don't need to manually calculate the coordinates of every joint when a character walks. GTA's RAGE engine already knows how to make a ped walk, climb into a vehicle, or aim a weapon.

Your script coordinates these behaviors: assigning the right task at the right moment ("move to this point", "attack this target"), and updating orders when the situation changes.

Why this is great software practice​

Because while building mods, you practice all the core principles of real-world software engineering:

  • State: keeping track of what an actor is currently doing.
  • References: targeting entities in the world safely without crashing if they get deleted.
  • Lifecycles: cleaning up spawned entities and memory when they are no longer needed.
  • Event handling: reacting cleanly to player inputs in real time.

Unlike an abstract computer science textbook, the feedback here is immediate and visual inside a game world you love.

Where we go next​

The next workshop lessons cover the history of GTA modding and the setup. They will open after their examples and translations have been reviewed.