-
Notifications
You must be signed in to change notification settings - Fork 7
Getting Started with CSP Lua Scripting
You're probably here because you're interested in creating stuff using the Lua Scripting functionality that is part of Custom Shaders Patch for Assetto Corsa.
I'm going to run through as many of the basics as I can to get you started. I will NOT be covering how to code, that is your own adventure.
-
Download CSP 1.76 or newer
This was the first major release that publicly opened Lua scripting.
(NOTE: I would always recommend using the latest non-preview build for public development)
-
Install CSP into your AC install
-
Navigate to
\assettocorsa\extension\internal\lua-sdk
Here you will find all the libraries specific to the script you want to make. It is VITAL you know how to use the
control + F
(aka search) function in your text editor, 90% of answers is one search away. If you can't find a value, or a function, it won't be available for that script type. -
Read the
README.md
file -
Ensure the Lua Debug app is enabled in
CSP > GUI > Developer Apps
You will then find this in-game at the bottom of the new app taskbar.
Once opened, it will show you:
- a) If your script is running
- b) Any errors it may have
- c) Live debug, logs, and performance
-
How to get create a Lua app.
-
The config required as part of the CSP Server Extra Options in order for clients to use the server scripts. Extra values here
-
Useful if you want to understand how most functions work internally. This is usually behind on CSP Preview build libraries which come in their own download.
-
These contain some light examples of different script types. I will covering the same thing in more detail in other pages.
-
These are found here
\assettocorsa\extension\internal\lua-apps
You can edit them locally to effect the in-game app. Note, they will be reverted if you change/reinstall CSP -
This is a showcase of the CSP Lua API and what is possible. It works well and is good for showcasing some advanced functions. It is imperative that you read the README on how to install it.