Altis Life Scripting Guide Pt 1 (Intro and File Structure)

Hi there, long time no see… Its been a while since the last post, I have been busy since working on loads of different projects (Not all of which are falling together like I had hoped). I have done a significant amount of work with the popular arma 3 mod and game mode Altis Life. I have found a distinct lack tutorials and guides on writing scripts and modifying it (other than specific script tutorials).

Altis Life has two main parts, the missions file/folder (many people chose not to compile the mission befre uploading it, this allows easier editing and modifying without having to redownload and upload the entire mission PBO. And the @life_server mod that has to run on the game server. This mainly handles things like multiplayer interactions such as bank transfers, and the interface to the database server.

Altis Life uses ExtDB extension to communicate with a SQL database, this means that player stats are persistent across server restarts. this is pretty much a black box in terms of scripting, so I recommend leaving it alone. Life uses a functions.h file to register all functions at mission start, this increases performance when scripts are run more than once as they are only compiled once.

I recently changed the way I Mod my server. I have decided to create my own file hierarchy next the the core one, this means it will be easier to port it over when the time comes to update to a new altis life version as fewer original core files have been modified.

 

File Structure

The mission folder has the following structure (this may vary with any scripts you have running)

Altis_Life.Altis (.pbo)
+---core //this folder contains the majority of the code and functionality for altis life
|   +---actions //this folder contains all the interaction menu items such as harvesting peaches or mining resources.
|   +---admin //this contains functionality for the admin meny ( TP
|   +---civilian //contains civilian specific things such as jail bank robbing/ robbing
|   +---config //contains global configs for things like clothing and vehicle shops, sellable items,and licences
|   +---cop // contains cop things like arresting and jailing people, sirens, cameras and spike strips
|   +---fsm //?contains time module I believe, not sure, this make time go faster on altis life.
|   +---functions //contains functions that are not specific to any faction such as picking up items,
|   |   ---network //contains functions that are MP specific or need to be broadcast over the network
|   +---gangs  //gang specific functions
|   +---housing //the housing system on altis
|   +---items //functions relating to specific items such as lockpick, pickaxe and blasting charge
|   +---medical //medic faction specific
|   +---pmenu //this is the player menu (z/y menu) contains scripts that draws the interface and some of the functionality
|   +---session //things such as syncing, and updating database
|   +---shops //shop functionality NOT the config though
|   ---vehicle //special vehicle functionality, such as tempest device and vehicle colour.  and the vehicle trunk
+---dialog //draws most of the UI for altis life specific menus
|   ---function //functionality for above
+---icons //duh
+---sounds // sounds like unlock and cop sirens
+---SpyGlass //altis life anti hack
---textures //textures for vehicles and uniforms and billboards etc.

 

And the server mod folder structure:

@life_server // contains code that should only be run on the server and is potentially dangerous if tampered with
+---Functions
|   +---Client
|   +---Gangs
|   +---Housing
|   +---Jail
|   +---MP //Player-player interactions
|   +---MySQL //MySQL Queries and DB interaction
|   +---Systems
|   ---WantedSystem
---shk_pos //used to generate player spawn position


Now that you understand how Altis Life is structured you need to decide where you need to modify files or add new ones.