Navigation

  • index
  • next |
  • previous |
  • Antistasi Guide documentation »
  • Dev Guide »
  • How to Extend Antistasi?

Logo of Antistasi Guide

Table of Contents

  • Beginners Guide for Antistasi v3.0
  • Detailed Reference Guide
  • Dev Guide
    • General
    • Development
      • Dev Tools Starter Setup
      • How to build Antistasi
      • Antistasi Porting Instructions
      • How to Extend Antistasi?
        • Important things to modify
        • Example additions
        • Event-System
        • Building the mod
      • Technical Standards for Core Code Contributions
      • Addon Functions & Folders Library
      • Debug Console Commands for Devs
      • Translation-Localization of Antistasi via Tolgee
    • Deprecated

GitHub

Star
Follow @official-antistasi-community

How to Extend Antistasi?

With the convertion to a mod Antistasi has added a lot of support for 3rd party mods to add to or alter its behaviour, this includes adding and overwriting Templates and Maps in the provided example on Github we have a example of doing just that, along with all the tools and steps to fully make your own mod to extend Antistasi

Once you have made your own mod with the additions or changes you wanted, simply load it alongside Antistasi the mod and voila you have succesfully added/changed a template/map to Antistasi.

An example Code for extending the Antistasi-mod can be found on Github.

Important things to modify

Important things to modify

  • Under addons/core/Includes you need to adapt script_mod.hpp to have a unique PREFIX and MODFOLDER.

  • Under all addons EXCEPT core you need to update script_component.hpp to have updateded path to match the MODFOLDER define in script_mod.hpp.

#include "\x\${MODFOLDER}\addons\core\Includes\script_mod.hpp"
  • Next you need to update all $PBOPREFIX$ with the new path x${MODFOLDER}addons${COMPONENT}.
    All ${Something} should be replaced with their corresponding elements.
Example

If MODFOLDER is A3AE you would replace all ${MODFOLDER} with A3AE.

#include "\x\A3AE\addons\core\Includes\script_mod.hpp"

Example additions

Example additions

Maps

Antistasi now supports 3rd party map porting.
There are two examples added for working with maps. Adding a new map and overwriting/applying additions for an existing map.
In this examples there are also demonstrations of mission specific overwrites of mapInfo and navGrid data as well as global overwrite/addition.
You will find all the information regarding this under A3AE/addons/maps.
Take care to study all the files in the addon to not miss crucial porting steps.

Templates

Antistasi now supports 3rd party template additions/overwrites.
To add new templates or overwrite existing ones follow the demonstration given in A3AE/addons/templates/Templates/Templates.hpp.
Note that while you can add addon vehicle templates to Antistasi at this time, it should be noted that it is still a limited system and you shouldn’t expect full functionality from them atm.
Again it’s important to read through all the files in the templates addon to not miss important steps.

Event-System

Mod integrated event system

Antistasi’s functionality is extendable by 3rd party mods through the events system, where you can subscribe to events whitin antistasi like for example vehicle initilisation.

A record of the events and their arguments can be found in the config under A3A >> Events where the class name is the event name and the sub class params contains a list of the arguments in order of argument index, each element of this list contains a description, a list of valid types (array, string, number, …) and a flag for if it is optional (not guarented to be passed along). In addition to this class of arguments is a flag for the execution location of the event (isLocal, 1 = local, 0 = global)

Subscribe to an Event

To subscribe to an event you use the A3A_Events_fnc_addEventListener.

/**
Description:
    Add a listener to an event, allowing you to trigger functions when that event occurs

Arguments:
0. <String> Event identifier, as registered in configFile >> A3A >> Events
1. <String> Unique identifier of listener
2. <String|Code> Code block or name of function to excecute on event occurance

Return Value:
<Array<Event, ID>> data needed to remove listener

Scope: Any
Environment: unscheduled
Public: Yes
Dependencies:

Example:
*/

["AIVehInit", "A3A_Events_example", "someFuncName"] call A3A_Events_fnc_addEventListener;
["AIVehInit", "A3A_Events_example", {systemChat "Example event listener triggered!"}] call A3A_Events_fnc_addEventListener;
["AIVehInit", "A3A_Events_example", someFunc] call A3A_Events_fnc_addEventListener;
Unsubscribe an Event

To remove an event listener use the A3A_Events_fnc_removeEventListener function.

/**
Description:
    Removes a event listener

Arguments:
0. <String> Event the listener is subscribed to
1. <String> The event listeners unique identifier

Return Value:
<Nil|Array> Nil if failed, deleted event listener otherwise

Scope: Any
Environment: unscheduled
Public: Yes
Dependencies:
*/

Example: ["AIVehInit", "A3A_Events_example"] call A3A_Events_fnc_removeEventListener;
Unsubscribe all Events

To remove all event listener of a type use the A3A_events_fnc_removeAllEventListeners function.

/**
Description:
    Removes all event listeners subscribed to a particular event

Arguments:
0. <String> Event to remove listeners from

Return Value: <Nil|Array> Nil if failed, the removed listeners otherwise

Scope: Any
Environment: unscheduled
Public: Yes
Dependencies:
*/

Example: ["AIVehInit"] call A3A_Events_fnc_removeAllEventListeners;

Building the mod

Building the mod

To build the mod you first need to navigate to ToolsBuilder and edit buildAddons.ps1.
On line 6 replace $addonName = "A3AE" with $addonName = "${your addons main folder name}", so if you name your extension A3A-AltisRemade then the line would be $addonName = "A3A-AltisRemade", save the file and close it.
Now all you need to do is run the script and it will build the mod for you (note: it will not sign it for you, this needs to be done manually before publishing with Arma 3 Tools -> DSUtils & Publisher).

Navigation

  • index
  • next |
  • previous |
  • Antistasi Guide documentation »
  • Dev Guide »
  • How to Extend Antistasi?
© Copyright 2024, Official Antistasi Community. Last updated 2024/October/14