Quick Overview

Southclaws edited this page Jun 1, 2018 · 5 revisions

So you've now installed sampctl, what now?

This page covers the general concepts, terminology and use-cases for sampctl. If you read only one page on this wiki, it should be this one.

Concepts and Motivation

sampctl borrows a lot from modern languages. This includes things like

  • Declarative tooling: declaring what you want and letting the tool figure it out, instead of manually doing everything yourself
  • Dependencies: knowing exactly what your script needs and exactly what those scripts need.
  • Automation: Tools should do the menial tasks for you. sampctl will download server files, includes and plugins automatically.

You configure everything through a file called pawn.json that lives in your project folder. With this file, you:

  • Configure the compiler settings - you can have multiple configurations, for example one for development and one for a live server
  • Declare what includes your project requires using GitHub URLs so they can be automatically downloaded
  • Configure the runtime settings - this is a nicer alternative to the server.cfg file

Writing Libraries and Gamemodes

sampctl is designed to make development productive and efficient. Check out the Packages page to learn more about what packages are and why they are such a useful concept. Then you can read the pawn.json reference to learn how to properly configure your project.

sampctl provides tools for managing includes ("dependencies") and compiling Pawn code to .amx files. You should read the page on Modern Pawn and Testing Pawn.

A lot of these documents focus on writing libraries but the concepts are the same for gamemodes, filterscripts and even little test scripts where you just want to experiment with the Pawn language.

Hosting a Server

(Note: samp.json is deprecated and considered legacy, please use pawn.json)

sampctl also provides powerful tools for managing the server process. If the server crashes, sampctl will automatically restart it.

By configuring your server through the pawn.json file, you'll have a cross-platform way to handle configuration without touching the server.cfg file or having to remember to add .so to plugins on linux and download the correct files. sampctl does all of that automatically.

Terminology

sampctl introduces a few new words, be sure to familiarise yourself with them before asking for help or reading any more of the documentation.

  • package

    • A package is an isolated "box" of Pawn code with a list of dependencies it requires to compile. Read more about packages here.
  • dependency

    • Dependencies are just a fancy word for includes. The difference being you can declare that your code requires them but you don't need to waste time downloading them or searching for the right version. See the package definition docs on the dependencies field or the page on dependencies.
  • library

    • Not a new word but worth a mention as people use the word "include" a lot which essentially means the same thing. A library is an external collection of code you can include into yours to provide more functionality. "Library" is just a more general term that's used more widely across many programming languages.
  • build

    • Another word for "compile" but more focused towards Packages. A package definition file may declare multiple "builds" which means you can have a -d3 debug build, a -O2 optimised build, a -l precompiler-only build, etc. A build also includes dependencies too.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.