Skip to content
Paulo Rafael edited this page Feb 17, 2024 · 14 revisions

Introduction

Welcome to the Zartex 2.0 Lua Scripting wiki!
First of all, Zartex 2.0 converts Lua code into Driv3r mission files. where we can test and play it, it's easier this way.
The wiki is still underconstruction so expect missing functions, classes and methods around.

  • What is Lua?

Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.

  • Why Lua?

Lua is a lightweight programming language and can be widely used between codes imported from other programming languages ​​easily through a Just-In-Time (JIT) compiler.

The Beginning

To begin starting to make Lua missions for Driv3r, you're gonna need the latest Zartex 2.0 release.

OK, now, Create a new Lua file for example tutorial.lua and save it somewhere in your computer.

Let's start up by creating our player:

local Player = MISSION.CreateCharacter(X,Y,Z,angle, SKIN_TANNER, 1, "Player", -1, -1, 1.0, 0.0, 0, 1.0)

And don't forget to set what city in the game you're working with, for example:

MISSION.missionSummary.Level = "Miami_Day"

Good job! now let's begin scripting our logic for the mission where everything is really going to happen to the game! Let's start with our logic start:

local LogicStart = MISSION.LogicStart("Mission Name - Start")

Driv3r Lua Operation

Once you're all done scripting your Lua mission script: open Zartex 2.0;
Go to File >> Import Lua Script >> Driv3r Lua (but remember to open a .mpc file as base first)
Select your file and have fun! any errors will be displayed if the file is invalid so make sure to fix them first.